Skip to content

Commit 16370ca

Browse files
committed
Merge branch 'main' into feat/adapi-door
2 parents def0bb2 + 5d9f3ac commit 16370ca

File tree

48 files changed

+2636
-2230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2636
-2230
lines changed

localization/landmark_based_localizer/ar_tag_based_localizer/src/ar_tag_based_localizer.cpp

+199-152
Large diffs are not rendered by default.

localization/landmark_based_localizer/ar_tag_based_localizer/src/ar_tag_based_localizer.hpp

+12-7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <rclcpp/rclcpp.hpp>
5252

5353
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
54+
#include <geometry_msgs/msg/pose_array.hpp>
5455
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
5556
#include <visualization_msgs/msg/marker.hpp>
5657

@@ -59,6 +60,7 @@
5960
#include <tf2_ros/transform_broadcaster.h>
6061
#include <tf2_ros/transform_listener.h>
6162

63+
#include <deque>
6264
#include <map>
6365
#include <memory>
6466
#include <string>
@@ -72,6 +74,7 @@ class ArTagBasedLocalizer : public rclcpp::Node
7274
using Pose = geometry_msgs::msg::Pose;
7375
using PoseStamped = geometry_msgs::msg::PoseStamped;
7476
using PoseWithCovarianceStamped = geometry_msgs::msg::PoseWithCovarianceStamped;
77+
using PoseArray = geometry_msgs::msg::PoseArray;
7578
using TransformStamped = geometry_msgs::msg::TransformStamped;
7679
using MarkerArray = visualization_msgs::msg::MarkerArray;
7780
using DiagnosticArray = diagnostic_msgs::msg::DiagnosticArray;
@@ -83,23 +86,23 @@ class ArTagBasedLocalizer : public rclcpp::Node
8386
private:
8487
void map_bin_callback(const HADMapBin::ConstSharedPtr & msg);
8588
void image_callback(const Image::ConstSharedPtr & msg);
86-
void cam_info_callback(const CameraInfo & msg);
87-
void ekf_pose_callback(const PoseWithCovarianceStamped & msg);
88-
void publish_pose_as_base_link(const PoseStamped & sensor_to_tag, const std::string & tag_id);
89-
static tf2::Transform aruco_marker_to_tf2(const aruco::Marker & marker);
89+
void cam_info_callback(const CameraInfo::ConstSharedPtr & msg);
90+
void ekf_pose_callback(const PoseWithCovarianceStamped::ConstSharedPtr & msg);
91+
std::vector<landmark_manager::Landmark> detect_landmarks(const Image::ConstSharedPtr & msg);
92+
Pose calculate_new_self_pose(
93+
const std::vector<landmark_manager::Landmark> & detected_landmarks, const Pose & self_pose);
9094

9195
// Parameters
9296
float marker_size_{};
9397
std::vector<std::string> target_tag_ids_;
9498
std::vector<double> base_covariance_;
95-
double distance_threshold_squared_{};
99+
double distance_threshold_{};
96100
double ekf_time_tolerance_{};
97101
double ekf_position_tolerance_{};
98102

99103
// tf
100104
std::unique_ptr<tf2_ros::Buffer> tf_buffer_;
101105
std::unique_ptr<tf2_ros::TransformListener> tf_listener_;
102-
std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
103106

104107
// image transport
105108
std::unique_ptr<image_transport::ImageTransport> it_;
@@ -112,6 +115,7 @@ class ArTagBasedLocalizer : public rclcpp::Node
112115

113116
// Publishers
114117
rclcpp::Publisher<MarkerArray>::SharedPtr marker_pub_;
118+
rclcpp::Publisher<PoseArray>::SharedPtr pose_array_pub_;
115119
image_transport::Publisher image_pub_;
116120
rclcpp::Publisher<PoseWithCovarianceStamped>::SharedPtr pose_pub_;
117121
rclcpp::Publisher<DiagnosticArray>::SharedPtr diag_pub_;
@@ -120,7 +124,8 @@ class ArTagBasedLocalizer : public rclcpp::Node
120124
aruco::MarkerDetector detector_;
121125
aruco::CameraParameters cam_param_;
122126
bool cam_info_received_;
123-
PoseWithCovarianceStamped latest_ekf_pose_{};
127+
std::mutex self_pose_array_mtx_;
128+
std::deque<PoseWithCovarianceStamped::ConstSharedPtr> self_pose_msg_ptr_array_;
124129
std::map<std::string, Pose> landmark_map_;
125130
};
126131

perception/shape_estimation/include/shape_estimation/corrector/truck_corrector.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class TruckCorrector : public VehicleCorrector
2626
{
2727
corrector_utils::CorrectionBBParameters params;
2828
params.min_width = 1.5;
29-
params.max_width = 3.2;
29+
params.max_width = 3.5;
3030
params.default_width = (params.min_width + params.max_width) * 0.5;
3131
params.min_length = 4.0;
32-
params.max_length = 7.9;
33-
params.default_length = (params.min_length + params.max_length) * 0.5;
32+
params.max_length = 18.0;
33+
params.default_length = 7.0; // 7m is the most common length of a truck in Japan
3434
setParams(params);
3535
}
3636

perception/shape_estimation/lib/filter/truck_filter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bool TruckFilter::filter(
1919
[[maybe_unused]] const geometry_msgs::msg::Pose & pose)
2020
{
2121
constexpr float min_width = 1.5;
22-
constexpr float max_width = 3.2;
23-
constexpr float max_length = 7.9; // upto 12m in japanese law
22+
constexpr float max_width = 3.5;
23+
constexpr float max_length = 18.0; // upto 12m in japanese law
2424
return utils::filterVehicleBoundingBox(shape, min_width, max_width, max_length);
2525
}

planning/behavior_path_planner/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ament_auto_add_library(behavior_path_planner_node SHARED
3434
src/utils/path_safety_checker/safety_check.cpp
3535
src/utils/path_safety_checker/objects_filtering.cpp
3636
src/utils/start_goal_planner_common/utils.cpp
37+
src/utils/avoidance/shift_line_generator.cpp
3738
src/utils/avoidance/utils.cpp
3839
src/utils/lane_change/utils.cpp
3940
src/utils/side_shift/util.cpp

planning/behavior_path_planner/config/avoidance/avoidance.param.yaml

+39-27
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
enable_bound_clipping: false
1212
enable_yield_maneuver: true
1313
enable_yield_maneuver_during_shifting: false
14-
enable_cancel_maneuver: false
14+
enable_cancel_maneuver: true
1515
disable_path_update: false
1616

1717
# drivable area setting
1818
use_adjacent_lane: true
1919
use_opposite_lane: true
20-
use_intersection_areas: false
21-
use_hatched_road_markings: false
20+
use_intersection_areas: true
21+
use_hatched_road_markings: true
2222

2323
# for debug
2424
publish_debug_marker: false
@@ -27,7 +27,6 @@
2727
# avoidance is performed for the object type with true
2828
target_object:
2929
car:
30-
is_target: true # [-]
3130
execute_num: 1 # [-]
3231
moving_speed_threshold: 1.0 # [m/s]
3332
moving_time_threshold: 1.0 # [s]
@@ -38,9 +37,8 @@
3837
safety_buffer_longitudinal: 0.0 # [m]
3938
use_conservative_buffer_longitudinal: true # [-] When set to true, the base_link2front is added to the longitudinal buffer before avoidance.
4039
truck:
41-
is_target: true
4240
execute_num: 1
43-
moving_speed_threshold: 1.0
41+
moving_speed_threshold: 1.0 # 3.6km/h
4442
moving_time_threshold: 1.0
4543
max_expand_ratio: 0.0
4644
envelope_buffer_margin: 0.3
@@ -49,9 +47,8 @@
4947
safety_buffer_longitudinal: 0.0
5048
use_conservative_buffer_longitudinal: true
5149
bus:
52-
is_target: true
5350
execute_num: 1
54-
moving_speed_threshold: 1.0
51+
moving_speed_threshold: 1.0 # 3.6km/h
5552
moving_time_threshold: 1.0
5653
max_expand_ratio: 0.0
5754
envelope_buffer_margin: 0.3
@@ -60,9 +57,8 @@
6057
safety_buffer_longitudinal: 0.0
6158
use_conservative_buffer_longitudinal: true
6259
trailer:
63-
is_target: true
6460
execute_num: 1
65-
moving_speed_threshold: 1.0
61+
moving_speed_threshold: 1.0 # 3.6km/h
6662
moving_time_threshold: 1.0
6763
max_expand_ratio: 0.0
6864
envelope_buffer_margin: 0.3
@@ -71,9 +67,8 @@
7167
safety_buffer_longitudinal: 0.0
7268
use_conservative_buffer_longitudinal: true
7369
unknown:
74-
is_target: false
7570
execute_num: 1
76-
moving_speed_threshold: 1.0
71+
moving_speed_threshold: 0.28 # 1.0km/h
7772
moving_time_threshold: 1.0
7873
max_expand_ratio: 0.0
7974
envelope_buffer_margin: 0.3
@@ -82,9 +77,8 @@
8277
safety_buffer_longitudinal: 0.0
8378
use_conservative_buffer_longitudinal: true
8479
bicycle:
85-
is_target: false
8680
execute_num: 1
87-
moving_speed_threshold: 1.0
81+
moving_speed_threshold: 0.28 # 1.0km/h
8882
moving_time_threshold: 1.0
8983
max_expand_ratio: 0.0
9084
envelope_buffer_margin: 0.8
@@ -93,9 +87,8 @@
9387
safety_buffer_longitudinal: 1.0
9488
use_conservative_buffer_longitudinal: true
9589
motorcycle:
96-
is_target: false
9790
execute_num: 1
98-
moving_speed_threshold: 1.0
91+
moving_speed_threshold: 1.0 # 3.6km/h
9992
moving_time_threshold: 1.0
10093
max_expand_ratio: 0.0
10194
envelope_buffer_margin: 0.8
@@ -104,9 +97,8 @@
10497
safety_buffer_longitudinal: 1.0
10598
use_conservative_buffer_longitudinal: true
10699
pedestrian:
107-
is_target: false
108100
execute_num: 1
109-
moving_speed_threshold: 1.0
101+
moving_speed_threshold: 0.28 # 1.0km/h
110102
moving_time_threshold: 1.0
111103
max_expand_ratio: 0.0
112104
envelope_buffer_margin: 0.8
@@ -119,6 +111,16 @@
119111

120112
# For target object filtering
121113
target_filtering:
114+
# avoidance target type
115+
target_type:
116+
car: true # [-]
117+
truck: true # [-]
118+
bus: true # [-]
119+
trailer: true # [-]
120+
unknown: true # [-]
121+
bicycle: true # [-]
122+
motorcycle: true # [-]
123+
pedestrian: true # [-]
122124
# detection range
123125
object_check_goal_distance: 20.0 # [m]
124126
# filtering parking objects
@@ -130,7 +132,7 @@
130132

131133
# detection area generation parameters
132134
detection_area:
133-
static: true # [-]
135+
static: false # [-]
134136
min_forward_distance: 50.0 # [m]
135137
max_forward_distance: 150.0 # [m]
136138
backward_distance: 10.0 # [m]
@@ -148,10 +150,20 @@
148150

149151
# params for filtering objects that are in intersection
150152
intersection:
151-
yaw_deviation: 0.175 # [rad] (default: 10.0deg)
153+
yaw_deviation: 0.349 # [rad] (default 20.0deg)
152154

153155
# For safety check
154156
safety_check:
157+
# safety check target type
158+
target_type:
159+
car: true # [-]
160+
truck: true # [-]
161+
bus: true # [-]
162+
trailer: true # [-]
163+
unknown: false # [-]
164+
bicycle: true # [-]
165+
motorcycle: true # [-]
166+
pedestrian: true # [-]
155167
# safety check configuration
156168
enable: true # [-]
157169
check_current_lane: false # [-]
@@ -162,32 +174,32 @@
162174
# collision check parameters
163175
check_all_predicted_path: false # [-]
164176
safety_check_backward_distance: 100.0 # [m]
165-
hysteresis_factor_expand_rate: 2.0 # [-]
177+
hysteresis_factor_expand_rate: 1.5 # [-]
166178
hysteresis_factor_safe_count: 10 # [-]
167179
# predicted path parameters
168180
min_velocity: 1.38 # [m/s]
169181
max_velocity: 50.0 # [m/s]
170182
time_resolution: 0.5 # [s]
171-
time_horizon_for_front_object: 10.0 # [s]
183+
time_horizon_for_front_object: 3.0 # [s]
172184
time_horizon_for_rear_object: 10.0 # [s]
173185
delay_until_departure: 0.0 # [s]
174186
# rss parameters
175187
expected_front_deceleration: -1.0 # [m/ss]
176188
expected_rear_deceleration: -1.0 # [m/ss]
177189
rear_vehicle_reaction_time: 2.0 # [s]
178190
rear_vehicle_safety_time_margin: 1.0 # [s]
179-
lateral_distance_max_threshold: 2.0 # [m]
191+
lateral_distance_max_threshold: 0.75 # [m]
180192
longitudinal_distance_min_threshold: 3.0 # [m]
181193
longitudinal_velocity_delta_time: 0.8 # [s]
182194

183195
# For avoidance maneuver
184196
avoidance:
185197
# avoidance lateral parameters
186198
lateral:
187-
lateral_execution_threshold: 0.499 # [m]
199+
lateral_execution_threshold: 0.09 # [m]
188200
lateral_small_shift_threshold: 0.101 # [m]
189201
lateral_avoid_check_threshold: 0.1 # [m]
190-
soft_road_shoulder_margin: 0.8 # [m]
202+
soft_road_shoulder_margin: 0.3 # [m]
191203
hard_road_shoulder_margin: 0.3 # [m]
192204
max_right_shift_length: 5.0
193205
max_left_shift_length: 5.0
@@ -246,13 +258,13 @@
246258
longitudinal:
247259
nominal_deceleration: -1.0 # [m/ss]
248260
nominal_jerk: 0.5 # [m/sss]
249-
max_deceleration: -2.0 # [m/ss]
261+
max_deceleration: -1.5 # [m/ss]
250262
max_jerk: 1.0 # [m/sss]
251263
max_acceleration: 1.0 # [m/ss]
252264

253265
shift_line_pipeline:
254266
trim:
255-
quantize_filter_threshold: 0.2
267+
quantize_filter_threshold: 0.1
256268
same_grad_filter_1_threshold: 0.1
257269
same_grad_filter_2_threshold: 0.2
258270
same_grad_filter_3_threshold: 0.5

planning/behavior_path_planner/config/avoidance_by_lc/avoidance_by_lc.param.yaml

+13-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# avoidance is performed for the object type with true
88
target_object:
99
car:
10-
is_target: true # [-]
1110
execute_num: 2 # [-]
1211
moving_speed_threshold: 1.0 # [m/s]
1312
moving_time_threshold: 1.0 # [s]
@@ -16,7 +15,6 @@
1615
avoid_margin_lateral: 1.0 # [m]
1716
safety_buffer_lateral: 0.7 # [m]
1817
truck:
19-
is_target: true
2018
execute_num: 2
2119
moving_speed_threshold: 1.0 # 3.6km/h
2220
moving_time_threshold: 1.0
@@ -25,7 +23,6 @@
2523
avoid_margin_lateral: 1.0
2624
safety_buffer_lateral: 0.7
2725
bus:
28-
is_target: true
2926
execute_num: 2
3027
moving_speed_threshold: 1.0 # 3.6km/h
3128
moving_time_threshold: 1.0
@@ -34,7 +31,6 @@
3431
avoid_margin_lateral: 1.0
3532
safety_buffer_lateral: 0.7
3633
trailer:
37-
is_target: true
3834
execute_num: 2
3935
moving_speed_threshold: 1.0 # 3.6km/h
4036
moving_time_threshold: 1.0
@@ -43,7 +39,6 @@
4339
avoid_margin_lateral: 1.0
4440
safety_buffer_lateral: 0.7
4541
unknown:
46-
is_target: true
4742
execute_num: 1
4843
moving_speed_threshold: 0.28 # 1.0km/h
4944
moving_time_threshold: 1.0
@@ -52,7 +47,6 @@
5247
avoid_margin_lateral: 1.0
5348
safety_buffer_lateral: 0.0
5449
bicycle:
55-
is_target: true
5650
execute_num: 2
5751
moving_speed_threshold: 0.28 # 1.0km/h
5852
moving_time_threshold: 1.0
@@ -61,7 +55,6 @@
6155
avoid_margin_lateral: 1.0
6256
safety_buffer_lateral: 1.0
6357
motorcycle:
64-
is_target: true
6558
execute_num: 2
6659
moving_speed_threshold: 1.0 # 3.6km/h
6760
moving_time_threshold: 1.0
@@ -70,7 +63,6 @@
7063
avoid_margin_lateral: 1.0
7164
safety_buffer_lateral: 1.0
7265
pedestrian:
73-
is_target: true
7466
execute_num: 2
7567
moving_speed_threshold: 0.28 # 1.0km/h
7668
moving_time_threshold: 1.0
@@ -80,3 +72,16 @@
8072
safety_buffer_lateral: 1.0
8173
lower_distance_for_polygon_expansion: 0.0 # [m]
8274
upper_distance_for_polygon_expansion: 1.0 # [m]
75+
76+
# For target object filtering
77+
target_filtering:
78+
# avoidance target type
79+
target_type:
80+
car: true # [-]
81+
truck: true # [-]
82+
bus: true # [-]
83+
trailer: true # [-]
84+
unknown: true # [-]
85+
bicycle: false # [-]
86+
motorcycle: false # [-]
87+
pedestrian: false # [-]

0 commit comments

Comments
 (0)