Skip to content

Commit

Permalink
fix(behavior, launch): fix launch error (autowarefoundation#5847)
Browse files Browse the repository at this point in the history
* fix(launch): set null to avoid launch error

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* fix(behavior): check null

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* chore(behavior): add comment

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* fix(launch): set  at the end of list

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* fix(launch): fill empty string at the end of module list

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored and karishma1911 committed May 28, 2024
1 parent d204c18 commit 174a6ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<arg name="launch_out_of_lane_module" default="true"/>
<arg name="launch_no_drivable_lane_module" default="true"/>

<arg name="launch_module_list_end" default="&quot;&quot;]"/>

<!-- assemble launch config for behavior path planner -->
<arg name="behavior_path_planner_launch_modules" default="["/>
<let
Expand Down Expand Up @@ -95,7 +97,7 @@
value="$(eval &quot;'$(var behavior_path_planner_launch_modules)' + 'behavior_path_planner::AvoidanceByLaneChangeModuleManager, '&quot;)"
if="$(var launch_avoidance_by_lane_change_module)"
/>
<let name="behavior_path_planner_launch_modules" value="$(eval &quot;'$(var behavior_path_planner_launch_modules)' + ']'&quot;)"/>
<let name="behavior_path_planner_launch_modules" value="$(eval &quot;'$(var behavior_path_planner_launch_modules)' + '$(var launch_module_list_end)'&quot;)"/>

<!-- assemble launch config for behavior velocity planner -->
<arg name="behavior_velocity_planner_launch_modules" default="["/>
Expand Down Expand Up @@ -174,7 +176,7 @@
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'behavior_velocity_planner::NoDrivableLaneModulePlugin, '&quot;)"
if="$(var launch_no_drivable_lane_module)"
/>
<let name="behavior_velocity_planner_launch_modules" value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + ']'&quot;)"/>
<let name="behavior_velocity_planner_launch_modules" value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + '$(var launch_module_list_end)'&quot;)"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="behavior_planning_container" namespace="" args="" output="screen">
<composable_node pkg="behavior_path_planner" plugin="behavior_path_planner::BehaviorPathPlannerNode" name="behavior_path_planner" namespace="">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ BehaviorPathPlannerNode::BehaviorPathPlannerNode(const rclcpp::NodeOptions & nod
planner_manager_ = std::make_shared<PlannerManager>(*this, p.max_iteration_num, p.verbose);

for (const auto & name : declare_parameter<std::vector<std::string>>("launch_modules")) {
// workaround: Since ROS 2 can't get empty list, launcher set [''] on the parameter.
if (name == "") {
break;
}
planner_manager_->launchScenePlugin(*this, name);
}

Expand Down
4 changes: 4 additions & 0 deletions planning/behavior_velocity_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ BehaviorVelocityPlannerNode::BehaviorVelocityPlannerNode(const rclcpp::NodeOptio

// Initialize PlannerManager
for (const auto & name : declare_parameter<std::vector<std::string>>("launch_modules")) {
// workaround: Since ROS 2 can't get empty list, launcher set [''] on the parameter.
if (name == "") {
break;
}
planner_manager_.launchScenePlugin(*this, name);
}

Expand Down

0 comments on commit 174a6ef

Please sign in to comment.