From 4a2842d76a3bc32d83734c0d0a2a063a55b48898 Mon Sep 17 00:00:00 2001 From: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:26:55 +0900 Subject: [PATCH 1/3] feat: add map packages (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * release v0.4.0 * add resolution param in lanelet2_extension (#760) * Fix/extend drivable area beyond goal (#781) * update llt2 extention query func Signed-off-by: Kosuke Murakami * extend drivable area over goal point Signed-off-by: Kosuke Murakami * apply clang Signed-off-by: Kosuke Murakami * update get preeceeding func Signed-off-by: Kosuke Murakami * update preceeding func in lanechange Signed-off-by: Kosuke Murakami * update comment Signed-off-by: Kosuke Murakami * Fix intersection preceeding lane query (#807) * modified interseciton module to add lanelets in intersection to objective lanelets due to change in getPreceedingLaneletSequences() Signed-off-by: mitsudome-r * update comment Signed-off-by: mitsudome-r * Install executables in lanelet2_map_preprocessor (#834) Signed-off-by: mitsudome-r * remove ROS1 packages temporarily Signed-off-by: mitsudome-r * Revert "remove ROS1 packages temporarily" This reverts commit 3290a8b9e92c9eae05d9159c8b9fd56ca8935c01. Signed-off-by: mitsudome-r * add COLCON_IGNORE to ros1 packages Signed-off-by: mitsudome-r * Rename launch files to launch.xml (#28) * port map_tf_generator (#32) * port map_tf_generator Signed-off-by: Takamasa Horibe * add missing dependency Signed-off-by: Takamasa Horibe * fix pointor, tf_broadcaster, add compile option Signed-off-by: Takamasa Horibe * use ament_auto Signed-off-by: Takamasa Horibe * Port lanelet2 extension (#36) * remove COLCON_IGNORE Signed-off-by: mitsudome-r * port to ROS2 Signed-off-by: mitsudome-r * minor fix Signed-off-by: mitsudome-r * fix CI Signed-off-by: mitsudome-r * remove unnecessary semi-colon Signed-off-by: mitsudome-r * fix library to executable for lanelet2_extension_sample and autoware_lanelet2_validation Signed-off-by: mitsudome-r * fix usage for ROS2 Signed-off-by: mitsudome-r * fix usage message and parameter declaration Signed-off-by: mitsudome-r * fix getting map_file parameter Signed-off-by: mitsudome-r * Port map loader (#44) * port map_loader to ROS2 Signed-off-by: mitsudome-r * fix unintended change Signed-off-by: mitsudome-r * Update map/map_loader/CMakeLists.txt Co-authored-by: Takamasa Horibe Co-authored-by: Takamasa Horibe * Add geometry2 to repos (#76) * add geometry2 package temporarily until new release Signed-off-by: mitsudome-r * trigger-ci Signed-off-by: mitsudome-r * add tf2 dependency to the packages that use tf2_geometry_msgs Signed-off-by: mitsudome-r * Revert "Add geometry2 to repos (#76)" (#96) * Revert "Add geometry2 to repos (#76)" This reverts commit 7dbe25ed5ff7d5f413fda567dcc77a70c79a7826. * Re-add tf2 dependencies * Revert "Re-add tf2 dependencies" This reverts commit e23b0c8b0826cf9518924d33349f9de34b4975df. * Debug CI pipeline * Revert "Debug CI pipeline" This reverts commit 58f1eba550360d82c08230552abfb64b33b23e0f. * Explicitly install known versions of the geometry packages * No need to skip tf2 packages anymore Co-authored-by: Esteve Fernandez * Rename h files to hpp (#142) * Change includes * Rename files * Adjustments to make things compile * Other packages * Adjust copyright notice on 532 out of 699 source files (#143) * Use quotes for includes where appropriate (#144) * Use quotes for includes where appropriate * Fix lint tests * Make tests pass hopefully * Run uncrustify on the entire Pilot.Auto codebase (#151) * Run uncrustify on the entire Pilot.Auto codebase * Exclude open PRs * fixing trasient_local in ROS2 packages (#160) * added linters to lanelet1_extension (#170) * adding linters to map_loader (#171) * adding linters to map_tf_generator (#172) * apply env_var to use_sim_time (#222) * Ros2 v0.8.0 map loader and lanelet2 extension (#279) * Ros2 v0.8 fix typo of "preceding" (#323) * Fix typo of getPrecedingLaneletSequences * Fix comment * Fix rviz2 low FPS (#390) * add nullptr check when publish concatenate data (#369) * Add warning msg when concat pointcloud is not published (#388) Signed-off-by: Kenji Miyake * Change lineString2Marker Signed-off-by: Takagi, Isamu * Change trafficLight2TriangleMarker Signed-off-by: Takagi, Isamu * Change laneletDirectionAsMarker Signed-off-by: Takagi, Isamu * Remove debug code Signed-off-by: Takagi, Isamu * Fix linter problems Signed-off-by: Takagi, Isamu Co-authored-by: Taichi Higashide Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * [map_loader] modify colors for lane markers for better visualization (#398) Signed-off-by: mitsudome-r * fix empty marker (#423) * Fix typo in map module (#437) * add license (#443) Signed-off-by: Kosuke Murakami * avoid pushing empty marker (#441) * avoid pushing empty marker * size0 -> empty * add use_sim-time option (#454) * Sync public repo (#1228) * [simple_planning_simulator] add readme (#424) * add readme of simple_planning_simulator Signed-off-by: Takamasa Horibe * Update simulator/simple_planning_simulator/README.md * set transit_margin_time to intersect. planner (#460) * Fix pose2twist (#462) Signed-off-by: Takagi, Isamu * Ros2 vehicle info param server (#447) * add vehicle_info_param_server * update vehicle info * apply format * fix bug * skip unnecessary search * delete vehicle param file * fix bug * Ros2 fix topic name part2 (#425) * Fix topic name of traffic_light_classifier Signed-off-by: Takagi, Isamu * Fix topic name of traffic_light_visualization Signed-off-by: Takagi, Isamu * Fix topic name of traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu * Fix topic name of traffic_light_map_based_detector Signed-off-by: Takagi, Isamu * Fix lint traffic_light_recognition Signed-off-by: Takagi, Isamu * Fix lint traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu * Fix lint traffic_light_classifier Signed-off-by: Takagi, Isamu * Fix lint traffic_light_classifier Signed-off-by: Takagi, Isamu * Fix lint traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu * Fix issues in hdd_reader (#466) * Fix some issues detected by Coverity Scan and Clang-Tidy * Update launch command * Add more `close(new_sock)` * Simplify the definitions of struct * fix: re-construct laneletMapLayer for reindex RTree (#463) * Rviz overlay render fix (#461) * Moved painiting in SteeringAngle plugin to update() Signed-off-by: Adam Dabrowski * super class now back to MFD Signed-off-by: Adam Dabrowski * uncrustified Signed-off-by: Adam Dabrowski * acquire data in mutex Signed-off-by: Adam Dabrowski * back to RTD as superclass Signed-off-by: Adam Dabrowski * Rviz overlay render in update (#465) * Moved painiting in SteeringAngle plugin to update() Signed-off-by: Adam Dabrowski * super class now back to MFD Signed-off-by: Adam Dabrowski * uncrustified Signed-off-by: Adam Dabrowski * acquire data in mutex Signed-off-by: Adam Dabrowski * removed unnecessary includes and some dead code Signed-off-by: Adam Dabrowski * Adepted remaining vehicle plugin classes to render-in-update concept. Returned to MFD superclass Signed-off-by: Adam Dabrowski * restored RTD superclass Signed-off-by: Adam Dabrowski Co-authored-by: Takamasa Horibe Co-authored-by: tkimura4 Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Kazuki Miyahara Co-authored-by: Makoto Tokunaga Co-authored-by: Adam DÄ…browski * Revert "fix: re-construct laneletMapLayer for reindex RTree (#463)" (#1229) This reverts commit d2ecdfe4c58cb4544c9a3ee84947b36b7ee54421. * add pcd file check (#1232) * add pcd file check * add space * add & * use namespace * Unify Apache-2.0 license name (#1242) * Remove use_sim_time for set_parameter (#1260) Signed-off-by: wep21 * Map components (#1311) * Make pointcloud map loader component Signed-off-by: wep21 * Make lanelet2 map loader component Signed-off-by: wep21 * Make map tf generator component Signed-off-by: wep21 * Apply lint Signed-off-by: wep21 * Rename parameter for lanelet2 map path Signed-off-by: wep21 * Fix license Signed-off-by: wep21 * Add comment for filesystem Signed-off-by: wep21 * Fix variable name for glob Signed-off-by: wep21 * Fix dependency for query (#1519) * Fix a small bug (#1644) * Fix minor flaws detected by Clang-Tidy (#1647) - misc-throw-by-value-catch-by-reference - cppcoreguidelines-init-variables - readability-isolate-declaration * Add pre-commit (#1560) * add pre-commit * add pre-commit-config * add additional settings for private repository * use default pre-commit-config * update pre-commit setting * Ignore whitespace for line breaks in markdown * Update .github/workflows/pre-commit.yml Co-authored-by: Kazuki Miyahara * exclude svg * remove pretty-format-json * add double-quote-string-fixer * consider COLCON_IGNORE file when seaching modified package * format file * pre-commit fixes * Update pre-commit.yml * Update .pre-commit-config.yaml Co-authored-by: Kazuki Miyahara Co-authored-by: pre-commit Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Porting traffic light viz (#1284) * Feature/traffic light viz (#1001) * add tl map viz * bug fix * update map visualizer * add launch * add install in cmake * remove unused file * fix build error * Fix lint Signed-off-by: wep21 * Fix typo Signed-off-by: wep21 * Fix topic name and qos Signed-off-by: wep21 * Replace deprecated duration api Signed-off-by: wep21 Co-authored-by: Yukihiro Saito Co-authored-by: wep21 * Add markdownlint and prettier (#1661) * Add markdownlint and prettier Signed-off-by: Kenji Miyake * Ignore .param.yaml Signed-off-by: Kenji Miyake * Apply format Signed-off-by: Kenji Miyake * Feature/compare elevation map (#1488) * suppress warnings for declare parameters (#1724) * fix for lanelet2_extension * fix for traffic light ssd fine detector * fix for topic_state_monitor * fix for dummy diag publisher * fix for remote cmd converter * fix for vehicle_info_util * fix for multi object tracker * fix for freespace planner * fix for autoware_error_monitor * add Werror for multi object tracker * fix for multi object tracker * add Werror for liraffic light ssd fine detector * add Werror for topic state monitor * add Werror * add Werror * add Werror * add Werror * fix style * suppress warnings for map (#1773) * add compile option * fix error * add compile option * add maybe unused * fix sign-compare * delete unused * add parentheses * fix for uncrusify * Fix typo * use U * use U Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Fix clang warnings (#1859) * Fix -Wreturn-std-move Signed-off-by: Kenji Miyake * Fix -Wunused-private-field Signed-off-by: Kenji Miyake * Ignore -Wnonportable-include-path for mussp Signed-off-by: Kenji Miyake * Fix -Wunused-const-variable Signed-off-by: Kenji Miyake * Fix "can not be used when making a shared object" Signed-off-by: Kenji Miyake * Sync v1.3.0 (#1909) * Add elevation_map to autoware_state_monitor (#1907) Signed-off-by: kosuke55 * Disable saving elevation map temporarily (#1906) Signed-off-by: kosuke55 * Fix typos in README of map_loader (#1923) * Fix typos in README of map_loader * Apply Prettier * fix some typos (#1941) * fix some typos * fix typo * Fix typo Signed-off-by: Kenji Miyake Co-authored-by: Kenji Miyake * Add autoware api (#1979) * Invoke code formatter at pre-commit (#1935) * Run ament_uncrustify at pre-commit * Reformat existing files * Fix copyright and cpplint errors Signed-off-by: Kenji Miyake Co-authored-by: Kenji Miyake * Save elevation_map with pcd md5sum (#1988) * Save elevation_map with pcd md5sum Signed-off-by: kosuke55 * Update sample launch * Fix cpplint * Use hash-library instead of openssl * Use call by reference * Apply format * Set CMAKE_CXX_STANDARD 17 * Save input_pcd.json and shorten directory name when loading multiple pcd * Remove erasing last _ * Modify concatenating file path * Apply Format * Add hash_library_vendor to build_depends.repos * Modify include way * Change function and variable names * Use return * Remove unnecessary input variable * Use unique_ptr * Rename digestMd5 to digest_md5 * Modify variable name * Remove file.close() * Use hash of json * Read hash of json directory * Add newline to package.xml * Add isPcdFile * Fix pre-commit * Use icPcdFile when giving file of pcd * Feature/add virtual traffic light planner (#1588) * Fix deprecated constant of transient local (#1994) Signed-off-by: Takagi, Isamu * Fix lint errors in lanelet2_extension (#2028) Signed-off-by: Kenji Miyake * add sort-package-xml hook in pre-commit (#1881) * add sort xml hook in pre-commit * change retval to exit_status * rename * add prettier plugin-xml * use early return * add license note * add tier4 license * restore prettier * change license order * move local hooks to public repo * move prettier-xml to pre-commit-hooks-ros * update version for bug-fix * apply pre-commit * Revert "[map_loader] modify colors for lane markers for better visualization (#398)" (#2063) This reverts commit 046dc9a770bf03fb8813ddf6aa1b2f05e9357b67. * Fix elevation_map_loader downsample (#2055) * Add elevation_map data dir (#2093) * Minor fixes of map_loader's README (#2116) * Minor fixes of map_loader's README * Fix map_loader run command Co-authored-by: kosuke55 * Fix elevation_map hash due to mutiple slashes of pcd path (#2192) * Fix elevation_map hash due to mutiple slashes of pcd path * Use filesystem lexically_normal * Fix broken links of images on lanelet2_extension docs (#2206) * Add lanelet XML API (#2262) * show traffic light id marker (#1554) (#1678) * show traffic light id * fix typo Co-authored-by: satoshi-ota Co-authored-by: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Co-authored-by: satoshi-ota * Feature/porting behavior path planner (#1645) * Add behavior path planner pkg with Lane Change (#1525) * add lanelet extension funcs Signed-off-by: Takamasa Horibe * add planning msgs for FOA Signed-off-by: Takamasa Horibe * add behavior_path_planner pkg Signed-off-by: Takamasa Horibe * apply clang format Signed-off-by: Takamasa Horibe * add error handling for config load failure Signed-off-by: Takamasa Horibe * replace word: foa with remote control Signed-off-by: Takamasa Horibe * add readme Signed-off-by: Takamasa Horibe * use pointer for return value of path Signed-off-by: Takamasa Horibe * fix hz Signed-off-by: Takamasa Horibe * remove debug print Signed-off-by: Takamasa Horibe * remove shide-shift & avoidance related files Signed-off-by: Takamasa Horibe * Clip path by goal * add build depend for behavior tree cpp Signed-off-by: Takamasa Horibe * temporally disable lint test in lanelet2_extension Signed-off-by: Takamasa Horibe Co-authored-by: rej55 * Add avoidance module in behavior_path_planner (#1528) * Revert "remove shide-shift & avoidance related files" This reverts commit d819ea0291fca251012e4b9ffd16de3896830aa2. * refactor findNewShiftPoint func Signed-off-by: Takamasa Horibe * remove duplicated decleration Signed-off-by: Takamasa Horibe * fix barkward length issue - add clipPathLenght func in avoidance Signed-off-by: Takamasa Horibe * refactor: - translate english - minor modification for traffic distance Signed-off-by: Takamasa Horibe * support debug marker in behavior_path_planner Signed-off-by: Takamasa Horibe * clean up side shift module Signed-off-by: Takamasa Horibe * change topic name Signed-off-by: Takamasa Horibe * remove japanese Signed-off-by: Takamasa Horibe * Update planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/include/behavior_path_planner/scene_module/side_shift/side_shift_module.hpp Co-authored-by: Yukihiro Saito * fix typo Signed-off-by: Takamasa Horibe * remove unused var Signed-off-by: Takamasa Horibe * adress reviewer comments: - add const for variables - add comment - fix typo Signed-off-by: Takamasa Horibe * fix typo Signed-off-by: Takamasa Horibe Co-authored-by: Yukihiro Saito * Replace behavior_path utilities with autoware_utils (#1532) * replace calcDistance Signed-off-by: Takamasa Horibe * replace arange Signed-off-by: Takamasa Horibe * replave convertToEigenPt with autoware_utils::fromMsg Signed-off-by: Takamasa Horibe * replace normalizeRadian Signed-off-by: Takamasa Horibe * cosmetic change Signed-off-by: Takamasa Horibe * import #1526 into behavior path planner (#1531) Signed-off-by: Takamasa Horibe * Fix/behavior path empty path output guard (#1536) * add guard Signed-off-by: Takamasa Horibe * Update planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/src/behavior_path_planner.cpp * fix lateral jerk calculation (#1549) Signed-off-by: Takamasa Horibe * fix: error handling on exception in behavior_path_planner (#1551) Signed-off-by: Takamasa Horibe * Fix ignore too steep avoidance path (#1550) * ignore too steep path Signed-off-by: Takamasa Horibe * Update planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp * parametrize lateral jerk limit Signed-off-by: Takamasa Horibe * Update planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/include/behavior_path_planner/scene_module/avoidance/avoidance_module.hpp Co-authored-by: tkimura4 Co-authored-by: tkimura4 * use offsetNoThrow and add error log (#1615) Signed-off-by: Takamasa Horibe * Ignore object ahead goal for avoidance (#1618) * Ignore object ahead goal for avoidance * Add flag * Fix position of definition of goal_pose * Fix arclength calculation * Fix position of definition of goal_pose * fix intersection stop line (#1636) * fix intersection stop line * fix typo * add document (#1635) Signed-off-by: Takamasa Horibe * Port behavior path planner to ros2 Signed-off-by: wep21 * Apply lint Signed-off-by: wep21 * Fix typo Signed-off-by: wep21 * Fix map qos Signed-off-by: wep21 * debug slope calculation in behavior (#1566) * update * update * revert change of autoware_utils * define getPose in behavior_path_planner * update * update * update * update * interpolate z in obstacle_avoidance_planner * update velocity controller * fix detection area and scene * Update planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/src/utilities.cpp Co-authored-by: tkimura4 * update comment in velocity controller * remove debug print * update Co-authored-by: tkimura4 * Address review: Fix config file name Signed-off-by: wep21 * pre-commit fixes Signed-off-by: wep21 * Fix redeclaring parameters Signed-off-by: wep21 * Add missing tf2 geometry function Signed-off-by: wep21 * Apply lint Signed-off-by: wep21 * Fix rclcpp Time initialization Signed-off-by: wep21 * Use now() instead of msg stamp Signed-off-by: wep21 * Use throttle output in getExpandedLanelet Signed-off-by: wep21 * Add missing const Signed-off-by: wep21 * Fix lint Signed-off-by: wep21 Co-authored-by: Takamasa Horibe Co-authored-by: rej55 Co-authored-by: Yukihiro Saito Co-authored-by: tkimura4 Co-authored-by: Takayuki Murooka * change type of traffic light marker (SPHERE_LIST->SPHERE) (#1789) * fix alpha (#1797) * Feature/improve intersection detection area (#1958) * exclude ego_lanes from detection_area * add empty handling * remove unused function * Fix for uncrustify Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Apply format (#1999) Signed-off-by: Kenji Miyake Fix cpplint Signed-off-by: Kenji Miyake * Feature/expand drivable area (#1812) * check if ego lane has adjacent lane or not * expand drivable area by using lanelet * remove unnecessary operator * use extra drivable area * fix variable names * fix indent * get polygon by id * fix variable name * remove redundant logic * update area name * disable expand by default Co-authored-by: satoshi-ota * add shoulder road lanelets (#2121) * add shoulder lanelets * Update map/lanelet2_extension/lib/query.cpp Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> * Update map/lanelet2_extension/lib/visualization.cpp Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> * Update map/lanelet2_extension/include/lanelet2_extension/visualization/visualization.hpp Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> * Update map/lanelet2_extension/include/lanelet2_extension/visualization/visualization.hpp Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> * Update map/lanelet2_extension/lib/visualization.cpp Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> * Feature/no stopping area reg element (#2144) * add no stopping area to ll2 * add no stopping area visualization * add no stopping area marker to RVIZ * make no stopping area stop line as optional * Update map/map_loader/src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Co-authored-by: tkimura4 * Add document for new map format (#1778) * add roadside lane doc * fix typo * fix typo * fix typo * fix typo * Add markdown lint * add reason for new subtype definition * fix typo Co-authored-by: kyoichi * Change formatter to clang-format and black (#2332) * Revert "Temporarily comment out pre-commit hooks" This reverts commit 748e9cdb145ce12f8b520bcbd97f5ff899fc28a3. * Replace ament_lint_common with autoware_lint_common Signed-off-by: Kenji Miyake * Remove ament_cmake_uncrustify and ament_clang_format Signed-off-by: Kenji Miyake * Apply Black Signed-off-by: Kenji Miyake * Apply clang-format Signed-off-by: Kenji Miyake * Fix build errors Signed-off-by: Kenji Miyake * Fix for cpplint * Fix include double quotes to angle brackets Signed-off-by: Kenji Miyake * Apply clang-format Signed-off-by: Kenji Miyake * Fix build errors Signed-off-by: Kenji Miyake * Add COLCON_IGNORE (#500) Signed-off-by: Kenji Miyake * port lanelet2_extension (#483) * port with auto_msgs * remove COLCON_IGNORE Co-authored-by: Takayuki Murooka * port map loader (#508) * remove COLCON_IGNORE in system_packages and map_tf_generator (#532) * add readme (#561) * fix old description Co-authored-by: mitsudome-r Co-authored-by: Taichi Higashide Co-authored-by: Kosuke Murakami Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: Nikolai Morin Co-authored-by: Takamasa Horibe Co-authored-by: Esteve Fernandez Co-authored-by: nik-tier4 <71747268+nik-tier4@users.noreply.github.com> Co-authored-by: isamu-takagi <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: Kazuki Miyahara Co-authored-by: tkimura4 Co-authored-by: Makoto Tokunaga Co-authored-by: Adam DÄ…browski Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com> Co-authored-by: pre-commit Co-authored-by: Yukihiro Saito Co-authored-by: wep21 Co-authored-by: Kosuke Takeuchi Co-authored-by: Hiroki OTA Co-authored-by: Kenji Miyake Co-authored-by: Takeshi Ishita Co-authored-by: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Co-authored-by: satoshi-ota Co-authored-by: rej55 Co-authored-by: Takayuki Murooka Co-authored-by: Sugatyon <32741405+Sugatyon@users.noreply.github.com> Co-authored-by: kyoichi Co-authored-by: Takayuki Murooka Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com> --- .../script/map_hash_generator | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 autoware_iv_internal_api_adaptor/script/map_hash_generator diff --git a/autoware_iv_internal_api_adaptor/script/map_hash_generator b/autoware_iv_internal_api_adaptor/script/map_hash_generator new file mode 100755 index 0000000..be467d2 --- /dev/null +++ b/autoware_iv_internal_api_adaptor/script/map_hash_generator @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +# Copyright 2021 Tier IV, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import hashlib +import pathlib + +from autoware_external_api_msgs.msg import MapHash +from autoware_external_api_msgs.msg import ResponseStatus +from autoware_external_api_msgs.srv import GetTextFile +import rclpy +from rclpy.node import Node +from rclpy.qos import QoSDurabilityPolicy +from rclpy.qos import QoSProfile + + +class MapHashGenerator(Node): + def __init__(self): + super().__init__("map_hash_generator") + self.lanelet_path = self.declare_parameter("lanelet2_map_path", "").value + self.lanelet_text = self.load_lanelet_text(self.lanelet_path) + self.lanelet_hash = self.generate_file_hash(self.lanelet_text) + + qos_profile = QoSProfile(depth=1, durability=QoSDurabilityPolicy.TRANSIENT_LOCAL) + msg = MapHash() + msg.lanelet = self.lanelet_hash + self.pub = self.create_publisher(MapHash, "/api/autoware/get/map/info/hash", qos_profile) + self.pub.publish(msg) + + self.srv = self.create_service( + GetTextFile, "/api/autoware/get/map/lanelet/xml", self.on_get_lanelet_xml + ) # noqa: E501 + + def on_get_lanelet_xml(self, request, response): + response.status.code = ResponseStatus.SUCCESS + response.file.text = self.lanelet_text + return response + + @staticmethod + def load_lanelet_text(path): + path = pathlib.Path(path) + return path.read_text() if path.is_file() else "" + + @staticmethod + def generate_file_hash(data): + return hashlib.sha256(data.encode()).hexdigest() if data else "" + + +def main(args=None): + rclpy.init(args=args) + node = MapHashGenerator() + rclpy.spin(node) + rclpy.shutdown() + + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + pass From 9afe6c729adc113a1c5f7989334d25661ad22500 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Date: Wed, 8 Dec 2021 10:35:03 +0900 Subject: [PATCH 2/3] feat: add pcd map hash generator (#745) (#130) Signed-off-by: wep21 Co-authored-by: Taichi Higashide Co-authored-by: Tomoya Kimura --- .../script/map_hash_generator | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/autoware_iv_internal_api_adaptor/script/map_hash_generator b/autoware_iv_internal_api_adaptor/script/map_hash_generator index be467d2..b7aa8c5 100755 --- a/autoware_iv_internal_api_adaptor/script/map_hash_generator +++ b/autoware_iv_internal_api_adaptor/script/map_hash_generator @@ -31,11 +31,15 @@ class MapHashGenerator(Node): super().__init__("map_hash_generator") self.lanelet_path = self.declare_parameter("lanelet2_map_path", "").value self.lanelet_text = self.load_lanelet_text(self.lanelet_path) - self.lanelet_hash = self.generate_file_hash(self.lanelet_text) + self.lanelet_hash = self.generate_lanelet_file_hash(self.lanelet_text) + + self.pcd_map_path = self.declare_parameter("pointcloud_map_path", "").value + self.pcd_map_hash = self.generate_pcd_file_hash(self.pcd_map_path) qos_profile = QoSProfile(depth=1, durability=QoSDurabilityPolicy.TRANSIENT_LOCAL) msg = MapHash() msg.lanelet = self.lanelet_hash + msg.pcd = self.pcd_map_hash self.pub = self.create_publisher(MapHash, "/api/autoware/get/map/info/hash", qos_profile) self.pub.publish(msg) @@ -54,9 +58,44 @@ class MapHashGenerator(Node): return path.read_text() if path.is_file() else "" @staticmethod - def generate_file_hash(data): + def generate_lanelet_file_hash(data): return hashlib.sha256(data.encode()).hexdigest() if data else "" + def update_hash(self, m, path): + try: + with open(path, "rb") as pcd_file: + m.update(pcd_file.read()) + except FileNotFoundError as e: + self.get_logger().error(e) + return False + return True + + def generate_pcd_file_hash(self, path): + path = pathlib.Path(path) + if path.is_file(): + if not path.suffix == ".pcd": + self.get_logger().error(f"[{path}] is not pcd file") + return "" + m = hashlib.sha256() + if not self.update_hash(m, path): + return "" + return m.hexdigest() + + if path.is_dir(): + m = hashlib.sha256() + for pcd_file_path in sorted(path.iterdir()): + if not pcd_file_path.suffix == ".pcd": + continue + if not self.update_hash(m, pcd_file_path): + return "" + if m.hexdigest() == hashlib.sha256().hexdigest(): + self.get_logger().error(f"there are no pcd files in [{path}]") + return "" + return m.hexdigest() + + self.get_logger().error(f"[{path}] is neither file nor directory") + return "" + def main(args=None): rclpy.init(args=args) From fff7145eff9a4bf01339c747d5c79de502499053 Mon Sep 17 00:00:00 2001 From: Tomoya Kimura Date: Fri, 10 Dec 2021 15:50:18 +0900 Subject: [PATCH 3/3] feat: change pachage name: autoware_msgs -> tier4_msgs (#150) * change pkg name: autoware_*_msgs -> tier_*_msgs Signed-off-by: tomoya.kimura * ci(pre-commit): autofix * autoware_external_api_msgs -> tier4_external_api_msgs Signed-off-by: tomoya.kimura * ci(pre-commit): autofix * fix description Signed-off-by: tomoya.kimura Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Takeshi Miura <57553950+1222-takeshi@users.noreply.github.com> --- autoware_iv_internal_api_adaptor/script/map_hash_generator | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoware_iv_internal_api_adaptor/script/map_hash_generator b/autoware_iv_internal_api_adaptor/script/map_hash_generator index b7aa8c5..5fb5755 100755 --- a/autoware_iv_internal_api_adaptor/script/map_hash_generator +++ b/autoware_iv_internal_api_adaptor/script/map_hash_generator @@ -17,13 +17,13 @@ import hashlib import pathlib -from autoware_external_api_msgs.msg import MapHash -from autoware_external_api_msgs.msg import ResponseStatus -from autoware_external_api_msgs.srv import GetTextFile import rclpy from rclpy.node import Node from rclpy.qos import QoSDurabilityPolicy from rclpy.qos import QoSProfile +from tier4_external_api_msgs.msg import MapHash +from tier4_external_api_msgs.msg import ResponseStatus +from tier4_external_api_msgs.srv import GetTextFile class MapHashGenerator(Node):