Skip to content

Commit

Permalink
feat: add traffic_light_recognition packages (#94)
Browse files Browse the repository at this point in the history
* 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 (#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 (#113)

Signed-off-by: mitsudome-r <ryohsuke.mitsudome@tier4.jp>

* Ros2 port traffic light map (#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 (#131)

* 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

* fixing trasient_local in ROS2 packages (#160)

* adding linters in traffic_light_map_based_detector (#179)

* traffic_light_classifier: Fix engine save dir (#250)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* traffic light map based detector: Fix launch (#253)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Ros2 v0.8.0 traffic light map based detector (#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 (#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 (#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 (#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 (#395) (#400)

* rm std_msgs float32

* fix typo

Co-authored-by: taikitanaka3 <65527974+taikitanaka3@users.noreply.github.com>

* add use_sim-time option (#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 (#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 (#460)

* Fix pose2twist (#462)

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* 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 <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 (#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 <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 (#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 (#500)

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* [traffic_light_ssd_fine_detector] support autoware auto msgs (#514)

* remove COLCON_IGNORE

* support autoware auto msgs

* fix sort pacakagge

* [traffic_light_map_based_detector] support autoware auto msgs (#511)

* [traffic_light_classifier] support autoware auto msgs (#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>
  • Loading branch information
1 parent ea6439f commit 7da1565
Show file tree
Hide file tree
Showing 35 changed files with 3,582 additions and 0 deletions.
1 change: 1 addition & 0 deletions perception/traffic_light_classifier/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data/*
184 changes: 184 additions & 0 deletions perception/traffic_light_classifier/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
cmake_minimum_required(VERSION 3.5)
project(traffic_light_classifier)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wno-deprecated-declarations -Werror)
endif()

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)
# set flags for CUDA availability
option(CUDA_AVAIL "CUDA available" OFF)
find_package(CUDA)
if (CUDA_FOUND)
find_library(CUBLAS_LIBRARIES cublas HINTS
${CUDA_TOOLKIT_ROOT_DIR}/lib64
${CUDA_TOOLKIT_ROOT_DIR}/lib
)
if (CUDA_VERBOSE)
message(STATUS "CUDA is available!")
message(STATUS "CUDA Libs: ${CUDA_LIBRARIES}")
message(STATUS "CUDA Headers: ${CUDA_INCLUDE_DIRS}")
endif ()
set(CUDA_AVAIL ON)
else()
message(STATUS "CUDA NOT FOUND")
set(CUDA_AVAIL OFF)
endif (CUDA_FOUND)

# set flags for TensorRT availability
option(TRT_AVAIL "TensorRT available" OFF)
# try to find the tensorRT modules
find_library(NVINFER NAMES nvinfer)
find_library(NVONNXPARSER nvonnxparser)
find_library(NVINFER_PLUGIN NAMES nvinfer_plugin)
if(NVINFER AND NVONNXPARSER AND NVINFER_PLUGIN)
if (CUDA_VERBOSE)
message(STATUS "TensorRT is available!")
message(STATUS "NVINFER: ${NVINFER}")
message(STATUS "NVPARSERS: ${NVPARSERS}")
message(STATUS "NVINFER_PLUGIN: ${NVINFER_PLUGIN}")
message(STATUS "NVONNXPARSER: ${NVONNXPARSER}")
endif ()
set(TRT_AVAIL ON)
else()
message(STATUS "TensorRT is NOT Available")
set(TRT_AVAIL OFF)
endif()

# set flags for CUDNN availability
option(CUDNN_AVAIL "CUDNN available" OFF)
# try to find the CUDNN module
find_library(CUDNN_LIBRARY
NAMES libcudnn.so${__cudnn_ver_suffix} libcudnn${__cudnn_ver_suffix}.dylib ${__cudnn_lib_win_name}
PATHS $ENV{LD_LIBRARY_PATH} ${__libpath_cudart} ${CUDNN_ROOT_DIR} ${PC_CUDNN_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}
PATH_SUFFIXES lib lib64 bin
DOC "CUDNN library." )
if(CUDNN_LIBRARY)
if (CUDA_VERBOSE)
message(STATUS "CUDNN is available!")
message(STATUS "CUDNN_LIBRARY: ${CUDNN_LIBRARY}")
endif ()
set(CUDNN_AVAIL ON)

else()
message(STATUS "CUDNN is NOT Available")
set(CUDNN_AVAIL OFF)
endif()

# Download caffemodel and prototxt
set(PRETRAINED_MODEL_LINK "https://drive.google.com/uc?id=15CQceCn9TZDU6huKJacQvUnDiLHionb3")
set(PRETRAINED_MODEL_HASH 7dc31c696b0400ddfc2cc5521586fa51)
set(LAMP_LABEL_LINK "https://drive.google.com/uc?id=1D7n3oGSWLkWgxET6PcWqEzOhmmPcqM52")
set(LAMP_LABEL_HASH 20167c8e9a1f9d2ec7b0b0088c4100f0)

find_program(GDOWN_AVAIL "gdown")
if (NOT GDOWN_AVAIL)
message(STATUS "gdown: command not found. External files could not be downloaded.")
endif()
set(PATH "${CMAKE_CURRENT_SOURCE_DIR}/data")
if (NOT EXISTS "${PATH}")
execute_process(COMMAND mkdir -p ${PATH})
endif()
set(FILE "${PATH}/traffic_light_classifier_mobilenetv2.onnx")
message(STATUS "Checking and downloading traffic_light_classifier_mobilenetv2.onnx")
if (EXISTS "${FILE}")
file(MD5 "${FILE}" EXISTING_FILE_HASH)
if (NOT "${PRETRAINED_MODEL_HASH}" EQUAL "${EXISTING_FILE_HASH}")
message(STATUS "... file hash changed. Downloading now ...")
execute_process(COMMAND gdown --quiet "${PRETRAINED_MODEL_LINK}" -O ${PATH}/traffic_light_classifier_mobilenetv2.onnx)
endif()
else()
message(STATUS "... file does not exist. Downloading now ...")
execute_process(COMMAND gdown --quiet "${PRETRAINED_MODEL_LINK}" -O ${PATH}/traffic_light_classifier_mobilenetv2.onnx)
endif()

set(FILE "${PATH}/lamp_labels.txt")
message(STATUS "Checking and downloading lamp_labels.txt")
if (EXISTS "${FILE}")
file(MD5 "${FILE}" EXISTING_FILE_HASH)
if (NOT "${LAMP_LABEL_HASH}" EQUAL "${EXISTING_FILE_HASH}")
message(STATUS "... file does not exist. Downloading now ...")
execute_process(COMMAND gdown --quiet "${LAMP_LABEL_LINK}" -O ${PATH}/lamp_labels.txt)
endif()
else()
message(STATUS "... file does not exist. Downloading now ...")
execute_process(COMMAND gdown --quiet "${LAMP_LABEL_LINK}" -O ${PATH}/lamp_labels.txt)
endif()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)

if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
add_definitions(-DENABLE_GPU)

include_directories(
utils
${OpenCV_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)

ament_auto_add_library(libutils SHARED
utils/trt_common.cpp
)
target_link_libraries(libutils
${OpenCV_LIBRARIES}
${NVINFER}
${NVONNXPARSER}
${NVINFER_PLUGIN}
${CUDA_LIBRARIES}
${CUBLAS_LIBRARIES}
${CUDA_curand_LIBRARY}
${CUDNN_LIBRARY}
${Boost_LIBRARIES}
)

ament_auto_add_library(traffic_light_classifier_nodelet SHARED
src/color_classifier.cpp
src/cnn_classifier.cpp
src/nodelet.cpp
)
target_link_libraries(traffic_light_classifier_nodelet
libutils
${OpenCV_LIBRARIES}
)
rclcpp_components_register_node(traffic_light_classifier_nodelet
PLUGIN "traffic_light::TrafficLightClassifierNodelet"
EXECUTABLE traffic_light_classifier_node
)

ament_auto_package(INSTALL_TO_SHARE
data
launch
)

else()
message(STATUS "CUDA and/or TensorRT were not found. build only color classifier")

include_directories(
${OpenCV_INCLUDE_DIRS}
)

ament_auto_add_library(traffic_light_classifier_nodelet SHARED
src/color_classifier.cpp
src/nodelet.cpp
)
target_link_libraries(traffic_light_classifier_nodelet
${OpenCV_LIBRARIES}
)

rclcpp_components_register_node(traffic_light_classifier_nodelet
PLUGIN "traffic_light::TrafficLightClassifierNodelet"
EXECUTABLE traffic_light_classifier_node
)

ament_auto_package(INSTALL_TO_SHARE
data
launch
)

endif()
131 changes: 131 additions & 0 deletions perception/traffic_light_classifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# traffic_light_classifier

## Purpose

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`.

## Inner-workings / Algorithms

### cnn_classifier

Traffic light labels are classified by MobileNetV2.

### hsv_classifier

Traffic light colors (green, yellow and red) are classified in HSV model.

### About Label

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).

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` .

For example, the simple red and red cross traffic light label must be expressed as "red-circle, red-cross".

These colors and shapes are assigned to the message as follows:
![TrafficLightDataStructure.jpg](./image/TrafficLightDataStructure.jpg)

## Inputs / Outputs

### Input

| Name | Type | Description |
| --------------- | ---------------------------------------------------------- | ---------------------- |
| `~/input/image` | `sensor_msgs::msg::Image` | input image |
| `~/input/rois` | `autoware_auto_perception_msgs::msg::TrafficLightRoiArray` | rois of traffic lights |

### Output

| Name | Type | Description |
| -------------------------- | -------------------------------------------------------- | ------------------- |
| `~/output/traffic_signals` | `autoware_auto_perception_msgs::msg::TrafficSignalArray` | classified signals |
| `~/output/debug/image` | `sensor_msgs::msg::Image` | image for debugging |

## Parameters

### Node Parameters

| Name | Type | Description |
| ----------------- | ---- | ------------------------------------------- |
| `classifier_type` | int | if the value is `1`, cnn_classifier is used |

### Core Parameters

#### cnn_classifier

| Name | Type | Description |
| ----------------- | ---- | ------------------------------------ |
| `model_file_path` | str | path to the model file |
| `label_file_path` | str | path to the label file |
| `precision` | str | TensorRT precision, `fp16` or `int8` |
| `input_c` | str | the channel size of an input image |
| `input_h` | str | the height of an input image |
| `input_w` | str | the width of an input image |

#### hsv_classifier

| Name | Type | Description |
| -------------- | ---- | ---------------------------------------------- |
| `green_min_h` | int | the minimum hue of green color |
| `green_min_s` | int | the minimum saturation of green color |
| `green_min_v` | int | the minimum value (brightness) of green color |
| `green_max_h` | int | the maximum hue of green color |
| `green_max_s` | int | the maximum saturation of green color |
| `green_max_v` | int | the maximum value (brightness) of green color |
| `yellow_min_h` | int | the minimum hue of yellow color |
| `yellow_min_s` | int | the minimum saturation of yellow color |
| `yellow_min_v` | int | the minimum value (brightness) of yellow color |
| `yellow_max_h` | int | the maximum hue of yellow color |
| `yellow_max_s` | int | the maximum saturation of yellow color |
| `yellow_max_v` | int | the maximum value (brightness) of yellow color |
| `red_min_h` | int | the minimum hue of red color |
| `red_min_s` | int | the minimum saturation of red color |
| `red_min_v` | int | the minimum value (brightness) of red color |
| `red_max_h` | int | the maximum hue of red color |
| `red_max_s` | int | the maximum saturation of red color |
| `red_max_v` | int | the maximum value (brightness) of red color |

## Assumptions / Known limits

<!-- Write assumptions and limitations of your implementation.
Example:
This algorithm assumes obstacles are not moving, so if they rapidly move after the vehicle started to avoid them, it might collide with them.
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.
-->

## (Optional) Error detection and handling

<!-- Write how to detect errors and how to recover from them.
Example:
This package can handle up to 20 obstacles. If more obstacles found, this node will give up and raise diagnostic errors.
-->

## (Optional) Performance characterization

<!-- Write performance information like complexity. If it wouldn't be the bottleneck, not necessary.
Example:
### Complexity
This algorithm is O(N).
### Processing time
...
-->

## References/External links

[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.

## (Optional) Future extensions / Unimplemented parts

<!-- Write future extensions of this package.
Example:
Currently, this package can't handle the chattering obstacles well. We plan to add some probabilistic filters in the perception layer to improve it.
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.
-->
29 changes: 29 additions & 0 deletions perception/traffic_light_classifier/cfg/HSVFilter.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /usr/bin/env python

# set up parameters that we care about
PACKAGE = 'traffic_light_classifier'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator ()
# def add (self, name, paramtype, level, description, default = None, min = None, max = None, edit_method = ""):
gen.add ("green_min_h", int_t, 0, "min h green", 50, 0, 180)
gen.add ("green_max_h", int_t, 0, "max h green", 120, 0, 180)
gen.add ("green_min_s", int_t, 0, "min s green", 100, 0, 255)
gen.add ("green_max_s", int_t, 0, "max s green", 200, 0, 255)
gen.add ("green_min_v", int_t, 0, "min v green", 150, 0, 255)
gen.add ("green_max_v", int_t, 0, "max v green", 255, 0, 255)
gen.add ("yellow_min_h", int_t, 0, "min h yellow", 0, 0, 180)
gen.add ("yellow_max_h", int_t, 0, "max h yellow", 50, 0, 180)
gen.add ("yellow_min_s", int_t, 0, "min s yellow", 80, 0, 255)
gen.add ("yellow_max_s", int_t, 0, "max s yellow", 200, 0, 255)
gen.add ("yellow_min_v", int_t, 0, "min v yellow", 150, 0, 255)
gen.add ("yellow_max_v", int_t, 0, "max v yellow", 255, 0, 255)
gen.add ("red_min_h", int_t, 0, "min h red", 160, 0, 180)
gen.add ("red_max_h", int_t, 0, "max h red", 180, 0, 180)
gen.add ("red_min_s", int_t, 0, "min s red", 100, 0, 255)
gen.add ("red_max_s", int_t, 0, "max s red", 255, 0, 255)
gen.add ("red_min_v", int_t, 0, "min v red", 150, 0, 255)
gen.add ("red_max_v", int_t, 0, "max v red", 255, 0, 255)

exit (gen.generate (PACKAGE, "traffic_light_classifier", "HSVFilter"))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2020 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.

#ifndef TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_
#define TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

#include <autoware_auto_perception_msgs/msg/traffic_signal.hpp>

#include <vector>

namespace traffic_light
{
class ClassifierInterface
{
public:
virtual bool getTrafficSignal(
const cv::Mat & input_image,
autoware_auto_perception_msgs::msg::TrafficSignal & traffic_signal) = 0;
};
} // namespace traffic_light

#endif // TRAFFIC_LIGHT_CLASSIFIER__CLASSIFIER_INTERFACE_HPP_
Loading

0 comments on commit 7da1565

Please sign in to comment.