Commit 2a38077 1 parent c5a5436 commit 2a38077 Copy full SHA for 2a38077
File tree 8 files changed +24
-13
lines changed
launch/tier4_planning_launch/launch
lane_driving/behavior_planning
behavior_velocity_planner
behavior_velocity_planner_common/include/behavior_velocity_planner_common
behavior_velocity_traffic_light_module/src
8 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 9
9
<arg name =" planning_validator_param_path" />
10
10
<!-- Auto mode setting-->
11
11
<arg name =" enable_all_modules_auto_mode" />
12
+ <arg name =" is_simulation" />
12
13
13
14
<group >
14
15
<push-ros-namespace namespace =" planning" />
25
26
<push-ros-namespace namespace =" scenario_planning" />
26
27
<include file =" $(find-pkg-share tier4_planning_launch)/launch/scenario_planning/scenario_planning.launch.xml" >
27
28
<arg name =" enable_all_modules_auto_mode" value =" $(var enable_all_modules_auto_mode)" />
29
+ <arg name =" is_simulation" value =" $(var is_simulation)" />
28
30
</include >
29
31
</group >
30
32
Original file line number Diff line number Diff line change 1
1
<launch >
2
2
<arg name =" enable_all_modules_auto_mode" />
3
+ <arg name =" is_simulation" />
3
4
4
5
<!-- lane_driving scenario -->
5
6
<group >
11
12
<include file =" $(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving/behavior_planning/behavior_planning.launch.xml" >
12
13
<arg name =" container_type" value =" component_container_mt" />
13
14
<arg name =" enable_all_modules_auto_mode" value =" $(var enable_all_modules_auto_mode)" />
15
+ <arg name =" is_simulation" value =" $(var is_simulation)" />
14
16
<!-- This condition should be true if run_out module is enabled and its detection method is Points -->
15
17
<arg name =" launch_compare_map_pipeline" value =" false" />
16
18
</include >
Original file line number Diff line number Diff line change 5
5
<arg name =" input_vector_map_topic_name" default =" /map/vector_map" />
6
6
<arg name =" input_pointcloud_map_topic_name" default =" /map/pointcloud_map" />
7
7
<arg name =" enable_all_modules_auto_mode" />
8
+ <arg name =" is_simulation" />
8
9
9
10
<arg name =" launch_avoidance_module" default =" true" />
10
11
<arg name =" launch_avoidance_by_lane_change_module" default =" true" />
202
203
<param from =" $(var nearest_search_param_path)" />
203
204
<param name =" launch_modules" value =" $(var behavior_path_planner_launch_modules)" />
204
205
<param name =" enable_all_modules_auto_mode" value =" $(var enable_all_modules_auto_mode)" />
206
+ <param name =" is_simulation" value =" $(var is_simulation)" />
205
207
<param from =" $(var behavior_path_planner_side_shift_module_param_path)" />
206
208
<param from =" $(var behavior_path_planner_avoidance_module_param_path)" />
207
209
<param from =" $(var behavior_path_planner_avoidance_by_lc_module_param_path)" />
243
245
<param from =" $(var behavior_velocity_smoother_type_param_path)" />
244
246
<param from =" $(var behavior_velocity_planner_common_param_path)" />
245
247
<param name =" launch_modules" value =" $(var behavior_velocity_planner_launch_modules)" />
248
+ <param name =" is_simulation" value =" $(var is_simulation)" />
246
249
<!-- <param from="$(var template_param_path)"/> -->
247
250
<param from =" $(var behavior_velocity_planner_blind_spot_module_param_path)" />
248
251
<param from =" $(var behavior_velocity_planner_crosswalk_module_param_path)" />
Original file line number Diff line number Diff line change 1
1
<launch >
2
2
<arg name =" enable_all_modules_auto_mode" />
3
+ <arg name =" is_simulation" />
3
4
<!-- scenario selector -->
4
5
<group >
5
6
<include file =" $(find-pkg-share scenario_selector)/launch/scenario_selector.launch.xml" >
53
54
<group >
54
55
<include file =" $(find-pkg-share tier4_planning_launch)/launch/scenario_planning/lane_driving.launch.xml" >
55
56
<arg name =" enable_all_modules_auto_mode" value =" $(var enable_all_modules_auto_mode)" />
57
+ <arg name =" is_simulation" value =" $(var is_simulation)" />
56
58
</include >
57
59
</group >
58
60
<!-- parking -->
Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ BehaviorVelocityPlannerNode::BehaviorVelocityPlannerNode(const rclcpp::NodeOptio
150
150
declare_parameter<double >(" ego_nearest_dist_threshold" );
151
151
planner_data_.ego_nearest_yaw_threshold = declare_parameter<double >(" ego_nearest_yaw_threshold" );
152
152
153
+ // is simulation or not
154
+ planner_data_.is_simulation = declare_parameter<bool >(" is_simulation" );
155
+
153
156
// Initialize PlannerManager
154
157
for (const auto & name : declare_parameter<std::vector<std::string>>(" launch_modules" )) {
155
158
// workaround: Since ROS 2 can't get empty list, launcher set [''] on the parameter.
@@ -327,8 +330,6 @@ void BehaviorVelocityPlannerNode::onTrafficSignals(
327
330
{
328
331
std::lock_guard<std::mutex> lock (mutex_);
329
332
330
- planner_data_.has_received_signal_ = true ;
331
-
332
333
for (const auto & signal : msg->signals ) {
333
334
TrafficSignalStamped traffic_signal;
334
335
traffic_signal.stamp = msg->stamp ;
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
78
78
79
79
std::vector<rclcpp::Parameter> params;
80
80
params.emplace_back (" launch_modules" , module_names);
81
+ params.emplace_back (" is_simulation" , false );
81
82
node_options.parameter_overrides (params);
82
83
83
84
test_utils::updateNodeOptions (
Original file line number Diff line number Diff line change @@ -82,8 +82,9 @@ struct PlannerData
82
82
std::map<int , TrafficSignalTimeToRedStamped> traffic_light_time_to_red_id_map;
83
83
tier4_v2x_msgs::msg::VirtualTrafficLightStateArray::ConstSharedPtr virtual_traffic_light_states;
84
84
85
- // this value becomes true once the signal message is received
86
- bool has_received_signal_ = false ;
85
+ // This variable is used when the Autoware's behavior has to depend on whether it's simulation or
86
+ // not.
87
+ bool is_simulation = false ;
87
88
88
89
// velocity smoother
89
90
std::shared_ptr<motion_velocity_smoother::SmootherBase> velocity_smoother_;
Original file line number Diff line number Diff line change @@ -303,16 +303,15 @@ bool TrafficLightModule::isStopSignal()
303
303
{
304
304
updateTrafficSignal ();
305
305
306
- // Pass through if no traffic signal information has been received yet
307
- // This is to prevent stopping on the planning simulator
308
- if (!planner_data_->has_received_signal_ ) {
309
- return false ;
310
- }
311
-
312
- // Stop if there is no upcoming traffic signal information
313
- // This is to safely stop in cases such that traffic light recognition is not working properly or
314
- // the map is incorrect
306
+ // If there is no upcoming traffic signal information,
307
+ // SIMULATION: it will PASS to prevent stopping on the planning simulator
308
+ // or scenario simulator.
309
+ // REAL ENVIRONMENT: it will STOP for safety in cases such that traffic light
310
+ // recognition is not working properly or the map is incorrect.
315
311
if (!traffic_signal_stamp_) {
312
+ if (planner_data_->is_simulation ) {
313
+ return false ;
314
+ }
316
315
return true ;
317
316
}
318
317
You can’t perform that action at this time.
0 commit comments