Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add traffic_light_recognition packages #94

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ed1f838
release v0.4.0
mitsudome-r Sep 18, 2020
d773bdd
check if gdown command exists (#707)
harihitode Jul 21, 2020
4a02612
Add nodelets of tlr nodes (#715)
wep21 Jul 30, 2020
6bd655e
remove libutils dependency when unable gpu (#761)
Aug 13, 2020
7d1fd21
Fix typo cliped -> clipped (#776)
kosuke55 Aug 16, 2020
e900a8b
install launch when disable gpu (#829)
Aug 25, 2020
54ec7a4
change raw pointer to vector and shared_ptr (#817)
Aug 26, 2020
f46c1a4
Fix/cublas dependency (#849)
yukkysaito Aug 28, 2020
26fdb4c
remove ROS1 packages temporarily
mitsudome-r Sep 29, 2020
6adc13b
Revert "remove ROS1 packages temporarily"
mitsudome-r Oct 8, 2020
2ae39ee
add COLCON_IGNORE to ros1 packages
mitsudome-r Oct 8, 2020
eb2348c
Rename launch files to launch.xml (#28)
nnmm Oct 15, 2020
03b3991
Port traffic light classifier (#70)
mitsudome-r Nov 5, 2020
64e0727
[traffic_light_ssd_fine_detector] port to ROS2 (#113)
mitsudome-r Nov 24, 2020
a7516a2
Ros2 port traffic light map (#99)
simon-t4 Nov 26, 2020
f2d7db9
Convert calls of Duration to Duration::from_seconds where appropriate…
nnmm Nov 30, 2020
02c1cf2
Rename h files to hpp (#142)
nnmm Dec 3, 2020
45e736a
Adjust copyright notice on 532 out of 699 source files (#143)
nnmm Dec 3, 2020
04957ea
Use quotes for includes where appropriate (#144)
nnmm Dec 7, 2020
a35c670
fixing trasient_local in ROS2 packages (#160)
nik-tier4 Dec 11, 2020
c476ca5
adding linters in traffic_light_map_based_detector (#179)
nik-tier4 Dec 15, 2020
bb9aad1
traffic_light_classifier: Fix engine save dir (#250)
wep21 Jan 13, 2021
284bae5
traffic light map based detector: Fix launch (#253)
wep21 Jan 19, 2021
c5df6d4
Ros2 v0.8.0 traffic light map based detector (#262)
wep21 Jan 17, 2021
078470e
Ros2 v0.8.0 traffic light classifier (#261)
wep21 Jan 17, 2021
9078aa7
Ros2 v0.8.0 traffic light ssd fine detector (#260)
wep21 Jan 17, 2021
86b5b03
Rename ROS-related .yaml to .param.yaml (#352)
kenji-miyake Feb 24, 2021
a79bc54
Ros2 v0.8.0 beta rm std msgs ssd traffic light (#395) (#400)
mitsudome-r Mar 4, 2021
20d97bd
add use_sim-time option (#454)
tkimura4 Mar 26, 2021
576a207
Fix rolling build errors (#1225)
kenji-miyake Apr 5, 2021
3855283
Sync public repo (#1228)
mitsudome-r Apr 5, 2021
59c93aa
Unify Apache-2.0 license name (#1242)
kmiya Apr 15, 2021
a7f2e61
Remove use_sim_time for set_parameter (#1260)
wep21 Apr 26, 2021
06f79d5
handle wrong route (#1312)
wep21 May 18, 2021
39a0d60
Dealing with wrong image size (#1320)
wep21 May 18, 2021
7f34e1f
Perception components (#1368)
wep21 May 26, 2021
e4bea3d
Use sensor data qos for traffic light recognition (#1440)
wep21 Jun 9, 2021
5efba2d
Fix/ssd fine detector (#1421) (#1468)
wep21 Jun 15, 2021
9f7a101
Feature/tl map based detector ros2 (#1475)
wep21 Jun 16, 2021
5ae9a38
Add pre-commit (#1560)
KeisukeShima Jul 19, 2021
5729382
Fix build error with TensorRT v8 (#1612)
wep21 Jul 19, 2021
ecd678f
Add markdownlint and prettier (#1661)
kenji-miyake Jul 20, 2021
5e5869e
suppress warnings for declare parameters (#1724)
h-ohta Jul 28, 2021
cafc24b
suppress warnings for traffic light classifier (#1762)
h-ohta Aug 3, 2021
3a0cf42
Fix -Wunused-parameter (#1836)
kenji-miyake Aug 14, 2021
c57e859
Fix compiler warnings (#1837)
kenji-miyake Aug 15, 2021
90eda50
Fix clang warnings (#1859)
kenji-miyake Aug 16, 2021
b25297c
Invoke code formatter at pre-commit (#1935)
IshitaTakeshi Sep 1, 2021
042302d
add sort-package-xml hook in pre-commit (#1881)
KeisukeShima Sep 9, 2021
bd7058e
Fix readme traffic light map based detector (#2282)
kminoda Oct 25, 2021
0b6a506
Change formatter to clang-format and black (#2332)
kenji-miyake Nov 2, 2021
b705ae9
Add COLCON_IGNORE (#500)
kenji-miyake Nov 4, 2021
eba1558
[traffic_light_ssd_fine_detector] support autoware auto msgs (#514)
Nov 8, 2021
de89cb2
[traffic_light_map_based_detector] support autoware auto msgs (#511)
Nov 8, 2021
5f9b554
[traffic_light_classifier] support autoware auto msgs (#504)
Nov 10, 2021
2de4c77
update README of traffic_light_classifier (#649)
yukke42 Nov 16, 2021
0340445
add readme for traffic light ssd fine detector (#637)
Nov 17, 2021
e0ec56b
declare variable before subscriber registration (#705)
Nov 18, 2021
b2ac2b6
update traffic light classifier readme (#726)
Nov 24, 2021
f695283
Update traffic light topic name (#729)
wep21 Nov 25, 2021
9b7a8e3
Merge branch 'tier4/proposal' into 1-add-traffic-light-recognition-pa…
taikitanaka3 Dec 3, 2021
e82bf5a
Merge branch 'tier4/proposal' into 1-add-traffic-light-recognition-pa…
tkimura4 Dec 3, 2021
ff8e0aa
Apply suggestions from code review
tkimura4 Dec 3, 2021
b011ab3
Apply suggestions from code review
tkimura4 Dec 3, 2021
7f4470a
Merge branch 'tier4/proposal' into 1-add-traffic-light-recognition-pa…
tkimura4 Dec 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
simon-t4 authored and 1222-takeshi committed Dec 2, 2021
commit a7516a211ed6bfb47a781963df7cc70d7022f10a
61 changes: 14 additions & 47 deletions perception/traffic_light_map_based_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,69 +1,36 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.5)
project(traffic_light_map_based_detector)

add_compile_options(-std=c++14)
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-unused-parameter)
endif()

find_package(catkin REQUIRED COMPONENTS
autoware_perception_msgs
autoware_planning_msgs
geometry_msgs
lanelet2_extension
roscpp
sensor_msgs
tf2
tf2_ros
)
find_package(Eigen3 REQUIRED)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
autoware_perception_msgs
autoware_planning_msgs
geometry_msgs
lanelet2_extension
roscpp
sensor_msgs
tf2
tf2_ros
)
find_package(Eigen3 REQUIRED)

###########
## Build ##
###########

include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)

add_executable(traffic_light_map_based_detector_node
ament_auto_add_executable(traffic_light_map_based_detector_node
src/node.cpp
src/main.cpp
)

add_dependencies(traffic_light_map_based_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(traffic_light_map_based_detector_node
${catkin_LIBRARIES}
)

#############
## Install ##
#############

install(
TARGETS
traffic_light_map_based_detector_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(
DIRECTORY
launch
config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
ament_auto_package(INSTALL_TO_SHARE
launch
config
)
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
max_vibration_pitch: 0.01745329251 # -0.5 ~ 0.5 deg
max_vibration_yaw: 0.01745329251 # -0.5 ~ 0.5 deg
max_vibration_height: 0.1 # -0.05 ~ 0.05 m
max_vibration_width: 0.1 # -0.05 ~ 0.05 m
max_vibration_depth: 0.1 # -0.05 ~ 0.05 m
/**:
ros__parameters:
max_vibration_pitch: 0.01745329251 # -0.5 ~ 0.5 deg
max_vibration_yaw: 0.01745329251 # -0.5 ~ 0.5 deg
max_vibration_height: 0.1 # -0.05 ~ 0.05 m
max_vibration_width: 0.1 # -0.05 ~ 0.05 m
max_vibration_depth: 0.1 # -0.05 ~ 0.05 m
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@

#pragma once

#include <ros/ros.h>

#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_extension/regulatory_elements/autoware_traffic_light.h>
#include <lanelet2_extension/utility/query.h>
#include <lanelet2_routing/RoutingGraph.h>
#include <lanelet2_traffic_rules/TrafficRulesFactory.h>

#include <autoware_lanelet2_msgs/MapBin.h>
#include <autoware_perception_msgs/TrafficLightRoiArray.h>
#include <autoware_planning_msgs/Route.h>
#include <geometry_msgs/PoseStamped.h>
#include <sensor_msgs/CameraInfo.h>
#include <autoware_lanelet2_msgs/msg/map_bin.hpp>
#include <autoware_perception_msgs/msg/traffic_light_roi_array.hpp>
#include <autoware_planning_msgs/msg/route.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <sensor_msgs/msg/camera_info.hpp>
#include <tf2_ros/transform_listener.h>
#include <visualization_msgs/MarkerArray.h>
#include <visualization_msgs/msg/marker_array.hpp>

#include <rclcpp/rclcpp.hpp>

#include <memory>

namespace traffic_light
{
class MapBasedDetector
class MapBasedDetector: public rclcpp::Node
{
public:
MapBasedDetector();
Expand All @@ -62,20 +62,19 @@ class MapBasedDetector
};

private:
ros::NodeHandle nh_;
ros::NodeHandle pnh_;
ros::Subscriber map_sub_;
ros::Subscriber camera_info_sub_;
ros::Subscriber route_sub_;
ros::Publisher roi_pub_;
ros::Publisher viz_pub_;
rclcpp::Subscription<autoware_lanelet2_msgs::msg::MapBin>::SharedPtr map_sub_;
rclcpp::Subscription<sensor_msgs::msg::CameraInfo>::SharedPtr camera_info_sub_;
rclcpp::Subscription<autoware_planning_msgs::msg::Route>::SharedPtr route_sub_;

rclcpp::Publisher<autoware_perception_msgs::msg::TrafficLightRoiArray>::SharedPtr roi_pub_;
rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr viz_pub_;

tf2_ros::Buffer tf_buffer_;
tf2_ros::TransformListener tf_listener_;

using TrafficLightSet = std::set<lanelet::ConstLineString3d, IdLessThan>;

sensor_msgs::CameraInfo::ConstPtr camera_info_ptr_;
sensor_msgs::msg::CameraInfo::ConstSharedPtr camera_info_ptr_;
std::shared_ptr<TrafficLightSet> all_traffic_lights_ptr_;
std::shared_ptr<TrafficLightSet> route_traffic_lights_ptr_;

Expand All @@ -84,28 +83,33 @@ class MapBasedDetector
lanelet::routing::RoutingGraphPtr routing_graph_ptr_;
Config config_;

void mapCallback(const autoware_lanelet2_msgs::MapBin & input_msg);
void cameraInfoCallback(const sensor_msgs::CameraInfo::ConstPtr & input_msg);
void routeCallback(const autoware_planning_msgs::Route::ConstPtr & input_msg);
void mapCallback(const autoware_lanelet2_msgs::msg::MapBin::ConstSharedPtr input_msg);
void cameraInfoCallback(const sensor_msgs::msg::CameraInfo::ConstSharedPtr input_msg);
void routeCallback(const autoware_planning_msgs::msg::Route::ConstSharedPtr input_msg);
void isInVisibility(
const TrafficLightSet & all_traffic_lights,
const geometry_msgs::Pose & camera_pose, const sensor_msgs::CameraInfo & camera_info,
const geometry_msgs::msg::Pose & camera_pose,
const sensor_msgs::msg::CameraInfo & camera_info,
std::vector<lanelet::ConstLineString3d> & visible_traffic_lights);
bool isInDistanceRange(
const geometry_msgs::Point & tl_point, const geometry_msgs::Point & camera_point,
const geometry_msgs::msg::Point & tl_point,
const geometry_msgs::msg::Point & camera_point,
const double max_distance_range);
bool isInAngleRange(
const double & tl_yaw, const double & camera_yaw, const double max_angele_range);
bool isInImageFrame(
const sensor_msgs::CameraInfo & camera_info, const geometry_msgs::Point & point);
const sensor_msgs::msg::CameraInfo & camera_info,
const geometry_msgs::msg::Point & point);
double normalizeAngle(const double & angle);
bool getTrafficLightRoi(
const geometry_msgs::Pose & camera_pose, const sensor_msgs::CameraInfo & camera_info,
const lanelet::ConstLineString3d traffic_light, const Config & config,
autoware_perception_msgs::TrafficLightRoi & tl_roi);
const geometry_msgs::msg::Pose & camera_pose,
const sensor_msgs::msg::CameraInfo & camera_info,
const lanelet::ConstLineString3d traffic_light,
const Config & config,
autoware_perception_msgs::msg::TrafficLightRoi & tl_roi);
void publishVisibleTrafficLights(
const geometry_msgs::PoseStamped camera_pose_stamped,
const geometry_msgs::msg::PoseStamped camera_pose_stamped,
const std::vector<lanelet::ConstLineString3d> & visible_traffic_lights,
const ros::Publisher & pub);
const rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr pub);
};
} // namespace traffic_light
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
<arg name="input/route" default="/planning/mission_planning/route" />
<arg name="output/rois" default="output/rois" />

<node pkg="traffic_light_map_based_detector" type="traffic_light_map_based_detector_node" name="traffic_light_map_based_detector" output="screen">
<remap from="~input/vector_map" to="$(arg input/vector_map)" />
<remap from="~input/camera_info" to="$(arg input/camera_info)" />
<remap from="~input/route" to="$(arg input/route)" />
<remap from="~output/rois" to="$(arg output/rois)" />
<rosparam command="load" file="$(find traffic_light_map_based_detector)/config/traffic_light_map_based_detector.yaml" />
<node pkg="traffic_light_map_based_detector" exec="traffic_light_map_based_detector_node" name="traffic_light_map_based_detector" output="screen">
<remap from="/input/vector_map" to="$(var input/vector_map)" />
<remap from="/input/camera_info" to="$(var input/camera_info)" />
<remap from="/input/route" to="$(var input/route)" />
<remap from="/output/rois" to="$(var output/rois)" />
</node>
</launch>
</launch>
36 changes: 10 additions & 26 deletions perception/traffic_light_map_based_detector/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,20 @@
<maintainer email="yukihiro.saito@tier4.jp">Yukihiro Saito</maintainer>
<license>Apache2</license>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>autoware_perception_msgs</build_depend>
<build_depend>autoware_planning_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>lanelet2_extension</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>tf2</build_depend>
<build_depend>tf2_ros</build_depend>
<build_export_depend>autoware_perception_msgs</build_export_depend>
<build_export_depend>autoware_planning_msgs</build_export_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<build_export_depend>lanelet2_extension</build_export_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>sensor_msgs</build_export_depend>
<build_export_depend>tf2</build_export_depend>
<build_export_depend>tf2_ros</build_export_depend>
<exec_depend>autoware_perception_msgs</exec_depend>
<exec_depend>autoware_planning_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>lanelet2_extension</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>tf2</exec_depend>
<exec_depend>tf2_ros</exec_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_extension</depend>
<depend>rclcpp</depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>

<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

<build_type>ament_cmake</build_type>
</export>
</package>
14 changes: 8 additions & 6 deletions perception/traffic_light_map_based_detector/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
*
*/

#include <ros/ros.h>
#include <traffic_light_map_based_detector/node.hpp>
#include <rclcpp/rclcpp.hpp>

int main(int argc, char ** argv)
{
ros::init(argc, argv, "traffic_light_map_based_detector");
traffic_light::MapBasedDetector node;

ros::spin();
{
rclcpp::init(argc, argv);

auto node = std::make_shared<traffic_light::MapBasedDetector>();

rclcpp::spin(node);
rclcpp::shutdown();

return 0;
}
Loading