Skip to content

Commit 7da1565

Browse files
1222-takeshimitsudome-rharihitodewep21yukkysaito
authored
feat: add traffic_light_recognition packages (autowarefoundation#94)
* release v0.4.0 * check if gdown command exists (autowarefoundation#707) * Add nodelets of tlr nodes (autowarefoundation#715) * Add classifier nodelet Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Replace boost::shared_ptr into std::shared_ptr Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Add lock guard Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Add detetcor nodelet Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Integrate main into node Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Add SubscriberStatusCallback Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * add image_transport_decompresser nodelet Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * Add visualizer nodelet Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * fixed bug Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * Fix plugin name Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Launch nodelet Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * Fix classifier constructor Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * add decompresser node Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * fix typo Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * fixed bug Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * fixed bug Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * cosmetic change Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * add param Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * fix bug Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * Fix build warning Signed-off-by: Daisuke Nishimatsu <border_goldenmarket@yahoo.co.jp> * change rgb Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * change rgb Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> * remove libutils dependency when unable gpu (autowarefoundation#761) * Fix typo cliped -> clipped (autowarefoundation#776) Signed-off-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * install launch when disable gpu (autowarefoundation#829) * add launch and xml install when disable gpu * remove unnecessary install * change raw pointer to vector and shared_ptr (#817) * change raw pointer to vector and shared_ptr * fix bug * Fix/cublas dependency (autowarefoundation#849) * fix cublas depencency * fix cublas depencency * remove ROS1 packages temporarily Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Revert "remove ROS1 packages temporarily" This reverts commit 9b343cf4c11815735a176ef31f9e6e9948f20c74. Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * add COLCON_IGNORE to ros1 packages Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Rename launch files to launch.xml (#28) * Port traffic light classifier (autowarefoundation#70) * port package.xml and CMakeLists.txt Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * port ROS messages Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * port to ros2 Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * make wget buildtool_depend Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * remove main function Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * add connectCb as a timer callback Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * fix indentation Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * remove catkin includes and libraries from CMakeLists.txt Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * [traffic_light_ssd_fine_detector] port to ROS2 (autowarefoundation#113) Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> * Ros2 port traffic light map (autowarefoundation#99) * remove colcon ignore * ported CMakelists * port package * remove colcon ignore * ported CMakelists * port package * ported traffic_light_map_detector to ROS2 - compiling * port launch and config files, tidied up * change rclcpp duration arguments * launch file corrections * lookupTransform uses exact timestamp * Convert calls of Duration to Duration::from_seconds where appropriate (autowarefoundation#131) * Rename h files to hpp (autowarefoundation#142) * Change includes * Rename files * Adjustments to make things compile * Other packages * Adjust copyright notice on 532 out of 699 source files (autowarefoundation#143) * Use quotes for includes where appropriate (autowarefoundation#144) * Use quotes for includes where appropriate * Fix lint tests * Make tests pass hopefully * fixing trasient_local in ROS2 packages (autowarefoundation#160) * adding linters in traffic_light_map_based_detector (autowarefoundation#179) * traffic_light_classifier: Fix engine save dir (autowarefoundation#250) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * traffic light map based detector: Fix launch (autowarefoundation#253) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Ros2 v0.8.0 traffic light map based detector (autowarefoundation#262) * change alpha (autowarefoundation#903) Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com> * fix typos in perception (autowarefoundation#862) Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> * Ros2 v0.8.0 traffic light classifier (autowarefoundation#261) * fix typos in perception (autowarefoundation#862) * update README.md in perception (autowarefoundation#1007) * update traffic light recognition model (autowarefoundation#1086) * update traffic light recognition model * download model when hash has changed * fix CMakeLists * udpate tl model to scale ai dataset one (autowarefoundation#1118) Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> Co-authored-by: Satoshi Tanaka <st14.828soccer@gmail.com> Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> * Ros2 v0.8.0 traffic light ssd fine detector (autowarefoundation#260) * fix typos in perception (autowarefoundation#862) * update README.md in perception (autowarefoundation#1007) * update traffic light recognition model (autowarefoundation#1086) * update traffic light recognition model * download model when hash has changed * fix CMakeLists * udpate tl model to scale ai dataset one (autowarefoundation#1118) Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> Co-authored-by: Satoshi Tanaka <st14.828soccer@gmail.com> Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> * Rename ROS-related .yaml to .param.yaml (autowarefoundation#352) * Rename ROS-related .yaml to .param.yaml Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Remove prefix 'default_' of yaml files Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Rename vehicle_info.yaml to vehicle_info.param.yaml Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Rename diagnostic_aggregator's param files Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix overlooked parameters Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ros2 v0.8.0 beta rm std msgs ssd traffic light (autowarefoundation#395) (autowarefoundation#400) * rm std_msgs float32 * fix typo Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> * add use_sim-time option (autowarefoundation#454) * Fix rolling build errors (autowarefoundation#1225) * Add missing include files Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Replace rclcpp::Duration Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use reference for exceptions Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Use from_seconds Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Sync public repo (autowarefoundation#1228) * [simple_planning_simulator] add readme (autowarefoundation#424) * add readme of simple_planning_simulator Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com> * Update simulator/simple_planning_simulator/README.md * set transit_margin_time to intersect. planner (autowarefoundation#460) * Fix pose2twist (autowarefoundation#462) Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Ros2 vehicle info param server (autowarefoundation#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 (autowarefoundation#425) * Fix topic name of traffic_light_classifier Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of traffic_light_visualization Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix topic name of traffic_light_map_based_detector Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint traffic_light_recognition Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint traffic_light_classifier Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint traffic_light_classifier Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix lint traffic_light_ssd_fine_detector Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Fix issues in hdd_reader (autowarefoundation#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 (autowarefoundation#463) * Rviz overlay render fix (autowarefoundation#461) * Moved painiting in SteeringAngle plugin to update() Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * super class now back to MFD Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * uncrustified Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * acquire data in mutex Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * back to RTD as superclass Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Rviz overlay render in update (autowarefoundation#465) * Moved painiting in SteeringAngle plugin to update() Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * super class now back to MFD Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * uncrustified Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * acquire data in mutex Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * removed unnecessary includes and some dead code Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * Adepted remaining vehicle plugin classes to render-in-update concept. Returned to MFD superclass Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> * restored RTD superclass Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp> Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> Co-authored-by: Makoto Tokunaga <vios-fish@users.noreply.github.com> Co-authored-by: Adam Dąbrowski <adam.dabrowski@robotec.ai> * Unify Apache-2.0 license name (autowarefoundation#1242) * Remove use_sim_time for set_parameter (autowarefoundation#1260) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * handle wrong route (autowarefoundation#1312) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> * Dealing with wrong image size (autowarefoundation#1320) * Dealing with wrong image size * Fix typo Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> * Perception components (autowarefoundation#1368) * [bev_optical_flow]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [object_merger]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [object_range_splitter]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [shape_estimation]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [map_based_prediction]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [naive_path_prediction]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [roi_image_saver]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [lidar_apollo_instance_segmentation]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [object_flow_fusion]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [traffic_light_map_based_detector]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * [dynamic_object_visualization]: component node Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Fix typo Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Use sensor data qos for traffic light recognition (autowarefoundation#1440) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Fix/ssd fine detector (autowarefoundation#1421) (autowarefoundation#1468) * modify fitInFrame * cosmetic change * bug fix * bug fix * cosmetic change Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> * Feature/tl map based detector ros2 (autowarefoundation#1475) * refactor and rectified distortion (autowarefoundation#1397) * refactor and rectified distortion * fix typo * cosmetic change * add readme * cosmetic change * cosmetic change * update readme * Update perception/traffic_light_recognition/traffic_light_map_based_detector/src/node.cpp Co-authored-by: Akihito Ohsato <aohsato@gmail.com> * use image geometry (autowarefoundation#1439) Co-authored-by: Akihito Ohsato <aohsato@gmail.com> * Apply lint Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> Co-authored-by: Akihito Ohsato <aohsato@gmail.com> * Add pre-commit (autowarefoundation#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 <kmiya@outlook.com> * 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 <kmiya@outlook.com> Co-authored-by: pre-commit <pre-commit@example.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Fix build error with TensorRT v8 (autowarefoundation#1612) * Fix build error with TensorRT v8 Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Fix typo Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Add markdownlint and prettier (autowarefoundation#1661) * Add markdownlint and prettier Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore .param.yaml Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * suppress warnings for declare parameters (autowarefoundation#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 traffic light classifier (autowarefoundation#1762) * add Werror * fix type * fix unused * Fix -Wunused-parameter (autowarefoundation#1836) * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * fix spell * Fix lint issues Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore flake8 warnings Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> * Fix compiler warnings (autowarefoundation#1837) * Fix -Wunused-private-field Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-variable Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wformat-security Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Winvalid-constexpr Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wdelete-non-abstract-non-virtual-dtor Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wdelete-abstract-non-virtual-dtor Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Winconsistent-missing-override Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wrange-loop-construct Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix "invalid application of 'sizeof' to an incomplete type" Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore -Wgnu-anonymous-struct and -Wnested-anon-types Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix lint Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore -Wno-deprecated-declarations in CUDA-related packages Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix mistake Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-parameter Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix clang warnings (autowarefoundation#1859) * Fix -Wreturn-std-move Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-private-field Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Ignore -Wnonportable-include-path for mussp Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix -Wunused-const-variable Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix "can not be used when making a shared object" Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Invoke code formatter at pre-commit (autowarefoundation#1935) * Run ament_uncrustify at pre-commit * Reformat existing files * Fix copyright and cpplint errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp> * add sort-package-xml hook in pre-commit (autowarefoundation#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 * Fix readme traffic light map based detector (autowarefoundation#2282) * fix type of ~input/route in readme * fix some grammar mistakes * Change formatter to clang-format and black (autowarefoundation#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 <kenji.miyake@tier4.jp> * Remove ament_cmake_uncrustify and ament_clang_format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply Black Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix for cpplint * Fix include double quotes to angle brackets Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Apply clang-format Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix build errors Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add COLCON_IGNORE (autowarefoundation#500) Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * [traffic_light_ssd_fine_detector] support autoware auto msgs (autowarefoundation#514) * remove COLCON_IGNORE * support autoware auto msgs * fix sort pacakagge * [traffic_light_map_based_detector] support autoware auto msgs (autowarefoundation#511) * [traffic_light_classifier] support autoware auto msgs (autowarefoundation#504) * update README of traffic_light_classifier (autowarefoundation#649) * update README of traffic_light_classifier * Update label explanation (autowarefoundation#652) * Update README.md * fix format * fix markdown lint * update readme Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> * add readme for traffic light ssd fine detector (autowarefoundation#637) * declare variable before subscriber registration (autowarefoundation#705) * update traffic light classifier readme (autowarefoundation#726) * Update traffic light topic name (autowarefoundation#729) * Update traffic light topic name Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Update traffic light topic name in perception Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> Co-authored-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp> Co-authored-by: Daichi Murakami <harihitode@gmail.com> Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com> Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> Co-authored-by: Nikolai Morin <nnmmgit@gmail.com> Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Co-authored-by: simon-t4 <49227606+simon-t4@users.noreply.github.com> Co-authored-by: nik-tier4 <71747268+nik-tier4@users.noreply.github.com> Co-authored-by: Kazuki Miyahara <kmiya@outlook.com> Co-authored-by: Satoshi Tanaka <st14.828soccer@gmail.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com> Co-authored-by: tkimura4 <tomoya.kimura@tier4.jp> Co-authored-by: Takamasa Horibe <horibe.takamasa@gmail.com> Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: Makoto Tokunaga <vios-fish@users.noreply.github.com> Co-authored-by: Adam Dąbrowski <adam.dabrowski@robotec.ai> Co-authored-by: Akihito Ohsato <aohsato@gmail.com> Co-authored-by: Keisuke Shima <19993104+KeisukeShima@users.noreply.github.com> Co-authored-by: pre-commit <pre-commit@example.com> Co-authored-by: Hiroki OTA <hiroki.ota@tier4.jp> Co-authored-by: Takeshi Ishita <ishitah.takeshi@gmail.com> Co-authored-by: Kenji Miyake <kenji.miyake@tier4.jp> Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> Co-authored-by: Yusuke Muramatsu <yukke42@users.noreply.github.com>
1 parent ea6439f commit 7da1565

35 files changed

+3582
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(traffic_light_classifier)
3+
4+
if(NOT CMAKE_CXX_STANDARD)
5+
set(CMAKE_CXX_STANDARD 14)
6+
endif()
7+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
8+
add_compile_options(-Wall -Wextra -Wpedantic -Wno-deprecated-declarations -Werror)
9+
endif()
10+
11+
option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)
12+
# set flags for CUDA availability
13+
option(CUDA_AVAIL "CUDA available" OFF)
14+
find_package(CUDA)
15+
if (CUDA_FOUND)
16+
find_library(CUBLAS_LIBRARIES cublas HINTS
17+
${CUDA_TOOLKIT_ROOT_DIR}/lib64
18+
${CUDA_TOOLKIT_ROOT_DIR}/lib
19+
)
20+
if (CUDA_VERBOSE)
21+
message(STATUS "CUDA is available!")
22+
message(STATUS "CUDA Libs: ${CUDA_LIBRARIES}")
23+
message(STATUS "CUDA Headers: ${CUDA_INCLUDE_DIRS}")
24+
endif ()
25+
set(CUDA_AVAIL ON)
26+
else()
27+
message(STATUS "CUDA NOT FOUND")
28+
set(CUDA_AVAIL OFF)
29+
endif (CUDA_FOUND)
30+
31+
# set flags for TensorRT availability
32+
option(TRT_AVAIL "TensorRT available" OFF)
33+
# try to find the tensorRT modules
34+
find_library(NVINFER NAMES nvinfer)
35+
find_library(NVONNXPARSER nvonnxparser)
36+
find_library(NVINFER_PLUGIN NAMES nvinfer_plugin)
37+
if(NVINFER AND NVONNXPARSER AND NVINFER_PLUGIN)
38+
if (CUDA_VERBOSE)
39+
message(STATUS "TensorRT is available!")
40+
message(STATUS "NVINFER: ${NVINFER}")
41+
message(STATUS "NVPARSERS: ${NVPARSERS}")
42+
message(STATUS "NVINFER_PLUGIN: ${NVINFER_PLUGIN}")
43+
message(STATUS "NVONNXPARSER: ${NVONNXPARSER}")
44+
endif ()
45+
set(TRT_AVAIL ON)
46+
else()
47+
message(STATUS "TensorRT is NOT Available")
48+
set(TRT_AVAIL OFF)
49+
endif()
50+
51+
# set flags for CUDNN availability
52+
option(CUDNN_AVAIL "CUDNN available" OFF)
53+
# try to find the CUDNN module
54+
find_library(CUDNN_LIBRARY
55+
NAMES libcudnn.so${__cudnn_ver_suffix} libcudnn${__cudnn_ver_suffix}.dylib ${__cudnn_lib_win_name}
56+
PATHS $ENV{LD_LIBRARY_PATH} ${__libpath_cudart} ${CUDNN_ROOT_DIR} ${PC_CUDNN_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}
57+
PATH_SUFFIXES lib lib64 bin
58+
DOC "CUDNN library." )
59+
if(CUDNN_LIBRARY)
60+
if (CUDA_VERBOSE)
61+
message(STATUS "CUDNN is available!")
62+
message(STATUS "CUDNN_LIBRARY: ${CUDNN_LIBRARY}")
63+
endif ()
64+
set(CUDNN_AVAIL ON)
65+
66+
else()
67+
message(STATUS "CUDNN is NOT Available")
68+
set(CUDNN_AVAIL OFF)
69+
endif()
70+
71+
# Download caffemodel and prototxt
72+
set(PRETRAINED_MODEL_LINK "https://drive.google.com/uc?id=15CQceCn9TZDU6huKJacQvUnDiLHionb3")
73+
set(PRETRAINED_MODEL_HASH 7dc31c696b0400ddfc2cc5521586fa51)
74+
set(LAMP_LABEL_LINK "https://drive.google.com/uc?id=1D7n3oGSWLkWgxET6PcWqEzOhmmPcqM52")
75+
set(LAMP_LABEL_HASH 20167c8e9a1f9d2ec7b0b0088c4100f0)
76+
77+
find_program(GDOWN_AVAIL "gdown")
78+
if (NOT GDOWN_AVAIL)
79+
message(STATUS "gdown: command not found. External files could not be downloaded.")
80+
endif()
81+
set(PATH "${CMAKE_CURRENT_SOURCE_DIR}/data")
82+
if (NOT EXISTS "${PATH}")
83+
execute_process(COMMAND mkdir -p ${PATH})
84+
endif()
85+
set(FILE "${PATH}/traffic_light_classifier_mobilenetv2.onnx")
86+
message(STATUS "Checking and downloading traffic_light_classifier_mobilenetv2.onnx")
87+
if (EXISTS "${FILE}")
88+
file(MD5 "${FILE}" EXISTING_FILE_HASH)
89+
if (NOT "${PRETRAINED_MODEL_HASH}" EQUAL "${EXISTING_FILE_HASH}")
90+
message(STATUS "... file hash changed. Downloading now ...")
91+
execute_process(COMMAND gdown --quiet "${PRETRAINED_MODEL_LINK}" -O ${PATH}/traffic_light_classifier_mobilenetv2.onnx)
92+
endif()
93+
else()
94+
message(STATUS "... file does not exist. Downloading now ...")
95+
execute_process(COMMAND gdown --quiet "${PRETRAINED_MODEL_LINK}" -O ${PATH}/traffic_light_classifier_mobilenetv2.onnx)
96+
endif()
97+
98+
set(FILE "${PATH}/lamp_labels.txt")
99+
message(STATUS "Checking and downloading lamp_labels.txt")
100+
if (EXISTS "${FILE}")
101+
file(MD5 "${FILE}" EXISTING_FILE_HASH)
102+
if (NOT "${LAMP_LABEL_HASH}" EQUAL "${EXISTING_FILE_HASH}")
103+
message(STATUS "... file does not exist. Downloading now ...")
104+
execute_process(COMMAND gdown --quiet "${LAMP_LABEL_LINK}" -O ${PATH}/lamp_labels.txt)
105+
endif()
106+
else()
107+
message(STATUS "... file does not exist. Downloading now ...")
108+
execute_process(COMMAND gdown --quiet "${LAMP_LABEL_LINK}" -O ${PATH}/lamp_labels.txt)
109+
endif()
110+
111+
find_package(ament_cmake_auto REQUIRED)
112+
ament_auto_find_build_dependencies()
113+
find_package(OpenCV REQUIRED)
114+
find_package(Boost REQUIRED COMPONENTS filesystem)
115+
116+
if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
117+
add_definitions(-DENABLE_GPU)
118+
119+
include_directories(
120+
utils
121+
${OpenCV_INCLUDE_DIRS}
122+
${CUDA_INCLUDE_DIRS}
123+
)
124+
125+
ament_auto_add_library(libutils SHARED
126+
utils/trt_common.cpp
127+
)
128+
target_link_libraries(libutils
129+
${OpenCV_LIBRARIES}
130+
${NVINFER}
131+
${NVONNXPARSER}
132+
${NVINFER_PLUGIN}
133+
${CUDA_LIBRARIES}
134+
${CUBLAS_LIBRARIES}
135+
${CUDA_curand_LIBRARY}
136+
${CUDNN_LIBRARY}
137+
${Boost_LIBRARIES}
138+
)
139+
140+
ament_auto_add_library(traffic_light_classifier_nodelet SHARED
141+
src/color_classifier.cpp
142+
src/cnn_classifier.cpp
143+
src/nodelet.cpp
144+
)
145+
target_link_libraries(traffic_light_classifier_nodelet
146+
libutils
147+
${OpenCV_LIBRARIES}
148+
)
149+
rclcpp_components_register_node(traffic_light_classifier_nodelet
150+
PLUGIN "traffic_light::TrafficLightClassifierNodelet"
151+
EXECUTABLE traffic_light_classifier_node
152+
)
153+
154+
ament_auto_package(INSTALL_TO_SHARE
155+
data
156+
launch
157+
)
158+
159+
else()
160+
message(STATUS "CUDA and/or TensorRT were not found. build only color classifier")
161+
162+
include_directories(
163+
${OpenCV_INCLUDE_DIRS}
164+
)
165+
166+
ament_auto_add_library(traffic_light_classifier_nodelet SHARED
167+
src/color_classifier.cpp
168+
src/nodelet.cpp
169+
)
170+
target_link_libraries(traffic_light_classifier_nodelet
171+
${OpenCV_LIBRARIES}
172+
)
173+
174+
rclcpp_components_register_node(traffic_light_classifier_nodelet
175+
PLUGIN "traffic_light::TrafficLightClassifierNodelet"
176+
EXECUTABLE traffic_light_classifier_node
177+
)
178+
179+
ament_auto_package(INSTALL_TO_SHARE
180+
data
181+
launch
182+
)
183+
184+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# traffic_light_classifier
2+
3+
## Purpose
4+
5+
traffic_light_classifier is a package for classifying traffic light labels using cropped image around a traffic light. This package has two classifier models: `cnn_classifier` and `hsv_classifier`.
6+
7+
## Inner-workings / Algorithms
8+
9+
### cnn_classifier
10+
11+
Traffic light labels are classified by MobileNetV2.
12+
13+
### hsv_classifier
14+
15+
Traffic light colors (green, yellow and red) are classified in HSV model.
16+
17+
### About Label
18+
19+
The message type is designed to comply with the unified road signs proposed at the [Vienna Convention](https://en.wikipedia.org/wiki/Vienna_Convention_on_Road_Signs_and_Signals#Traffic_lights). This idea has been also proposed in [Autoware.Auto](https://gitlab.com/autowarefoundation/autoware.auto/autoware_auto_msgs/-/merge_requests/16).
20+
21+
There are rules for naming labels that nodes receive. One traffic light is represented by the following character string separated by commas. `color1-shape1, color2-shape2` .
22+
23+
For example, the simple red and red cross traffic light label must be expressed as "red-circle, red-cross".
24+
25+
These colors and shapes are assigned to the message as follows:
26+
![TrafficLightDataStructure.jpg](./image/TrafficLightDataStructure.jpg)
27+
28+
## Inputs / Outputs
29+
30+
### Input
31+
32+
| Name | Type | Description |
33+
| --------------- | ---------------------------------------------------------- | ---------------------- |
34+
| `~/input/image` | `sensor_msgs::msg::Image` | input image |
35+
| `~/input/rois` | `autoware_auto_perception_msgs::msg::TrafficLightRoiArray` | rois of traffic lights |
36+
37+
### Output
38+
39+
| Name | Type | Description |
40+
| -------------------------- | -------------------------------------------------------- | ------------------- |
41+
| `~/output/traffic_signals` | `autoware_auto_perception_msgs::msg::TrafficSignalArray` | classified signals |
42+
| `~/output/debug/image` | `sensor_msgs::msg::Image` | image for debugging |
43+
44+
## Parameters
45+
46+
### Node Parameters
47+
48+
| Name | Type | Description |
49+
| ----------------- | ---- | ------------------------------------------- |
50+
| `classifier_type` | int | if the value is `1`, cnn_classifier is used |
51+
52+
### Core Parameters
53+
54+
#### cnn_classifier
55+
56+
| Name | Type | Description |
57+
| ----------------- | ---- | ------------------------------------ |
58+
| `model_file_path` | str | path to the model file |
59+
| `label_file_path` | str | path to the label file |
60+
| `precision` | str | TensorRT precision, `fp16` or `int8` |
61+
| `input_c` | str | the channel size of an input image |
62+
| `input_h` | str | the height of an input image |
63+
| `input_w` | str | the width of an input image |
64+
65+
#### hsv_classifier
66+
67+
| Name | Type | Description |
68+
| -------------- | ---- | ---------------------------------------------- |
69+
| `green_min_h` | int | the minimum hue of green color |
70+
| `green_min_s` | int | the minimum saturation of green color |
71+
| `green_min_v` | int | the minimum value (brightness) of green color |
72+
| `green_max_h` | int | the maximum hue of green color |
73+
| `green_max_s` | int | the maximum saturation of green color |
74+
| `green_max_v` | int | the maximum value (brightness) of green color |
75+
| `yellow_min_h` | int | the minimum hue of yellow color |
76+
| `yellow_min_s` | int | the minimum saturation of yellow color |
77+
| `yellow_min_v` | int | the minimum value (brightness) of yellow color |
78+
| `yellow_max_h` | int | the maximum hue of yellow color |
79+
| `yellow_max_s` | int | the maximum saturation of yellow color |
80+
| `yellow_max_v` | int | the maximum value (brightness) of yellow color |
81+
| `red_min_h` | int | the minimum hue of red color |
82+
| `red_min_s` | int | the minimum saturation of red color |
83+
| `red_min_v` | int | the minimum value (brightness) of red color |
84+
| `red_max_h` | int | the maximum hue of red color |
85+
| `red_max_s` | int | the maximum saturation of red color |
86+
| `red_max_v` | int | the maximum value (brightness) of red color |
87+
88+
## Assumptions / Known limits
89+
90+
<!-- Write assumptions and limitations of your implementation.
91+
92+
Example:
93+
This algorithm assumes obstacles are not moving, so if they rapidly move after the vehicle started to avoid them, it might collide with them.
94+
Also, this algorithm doesn't care about blind spots. In general, since too close obstacles aren't visible due to the sensing performance limit, please take enough margin to obstacles.
95+
-->
96+
97+
## (Optional) Error detection and handling
98+
99+
<!-- Write how to detect errors and how to recover from them.
100+
101+
Example:
102+
This package can handle up to 20 obstacles. If more obstacles found, this node will give up and raise diagnostic errors.
103+
-->
104+
105+
## (Optional) Performance characterization
106+
107+
<!-- Write performance information like complexity. If it wouldn't be the bottleneck, not necessary.
108+
109+
Example:
110+
111+
### Complexity
112+
113+
This algorithm is O(N).
114+
115+
### Processing time
116+
117+
...
118+
-->
119+
120+
## References/External links
121+
122+
[1] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov and L. Chen, "MobileNetV2: Inverted Residuals and Linear Bottlenecks," 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, 2018, pp. 4510-4520, doi: 10.1109/CVPR.2018.00474.
123+
124+
## (Optional) Future extensions / Unimplemented parts
125+
126+
<!-- Write future extensions of this package.
127+
128+
Example:
129+
Currently, this package can't handle the chattering obstacles well. We plan to add some probabilistic filters in the perception layer to improve it.
130+
Also, there are some parameters that should be global(e.g. vehicle size, max steering, etc.). These will be refactored and defined as global parameters so that we can share the same parameters between different nodes.
131+
-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /usr/bin/env python
2+
3+
# set up parameters that we care about
4+
PACKAGE = 'traffic_light_classifier'
5+
6+
from dynamic_reconfigure.parameter_generator_catkin import *
7+
8+
gen = ParameterGenerator ()
9+
# def add (self, name, paramtype, level, description, default = None, min = None, max = None, edit_method = ""):
10+
gen.add ("green_min_h", int_t, 0, "min h green", 50, 0, 180)
11+
gen.add ("green_max_h", int_t, 0, "max h green", 120, 0, 180)
12+
gen.add ("green_min_s", int_t, 0, "min s green", 100, 0, 255)
13+
gen.add ("green_max_s", int_t, 0, "max s green", 200, 0, 255)
14+
gen.add ("green_min_v", int_t, 0, "min v green", 150, 0, 255)
15+
gen.add ("green_max_v", int_t, 0, "max v green", 255, 0, 255)
16+
gen.add ("yellow_min_h", int_t, 0, "min h yellow", 0, 0, 180)
17+
gen.add ("yellow_max_h", int_t, 0, "max h yellow", 50, 0, 180)
18+
gen.add ("yellow_min_s", int_t, 0, "min s yellow", 80, 0, 255)
19+
gen.add ("yellow_max_s", int_t, 0, "max s yellow", 200, 0, 255)
20+
gen.add ("yellow_min_v", int_t, 0, "min v yellow", 150, 0, 255)
21+
gen.add ("yellow_max_v", int_t, 0, "max v yellow", 255, 0, 255)
22+
gen.add ("red_min_h", int_t, 0, "min h red", 160, 0, 180)
23+
gen.add ("red_max_h", int_t, 0, "max h red", 180, 0, 180)
24+
gen.add ("red_min_s", int_t, 0, "min s red", 100, 0, 255)
25+
gen.add ("red_max_s", int_t, 0, "max s red", 255, 0, 255)
26+
gen.add ("red_min_v", int_t, 0, "min v red", 150, 0, 255)
27+
gen.add ("red_max_v", int_t, 0, "max v red", 255, 0, 255)
28+
29+
exit (gen.generate (PACKAGE, "traffic_light_classifier", "HSVFilter"))
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2020 Tier IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_
16+
#define TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_
17+
18+
#include <opencv2/core/core.hpp>
19+
#include <opencv2/highgui/highgui.hpp>
20+
21+
#include <autoware_auto_perception_msgs/msg/traffic_signal.hpp>
22+
23+
#include <vector>
24+
25+
namespace traffic_light
26+
{
27+
class ClassifierInterface
28+
{
29+
public:
30+
virtual bool getTrafficSignal(
31+
const cv::Mat & input_image,
32+
autoware_auto_perception_msgs::msg::TrafficSignal & traffic_signal) = 0;
33+
};
34+
} // namespace traffic_light
35+
36+
#endif // TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_

0 commit comments

Comments
 (0)