-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Bug Report: robot_spawn.launch.py fails with generate:=false in Jazzy
Issue
The robot does not spawn in Gazebo when using generate:=false parameter in ROS 2 Jazzy, breaking a workflow that worked correctly in Humble.
Environment
- ROS Distribution: Jazzy
- Package: clearpath_gz (clearpath_simulator)
- Branch: jazzy
- File:
clearpath_gz/launch/robot_spawn.launch.py - Line: 208
Expected Behavior
When running:
ros2 launch clearpath_gz simulation.launch.py generate:=falseThe robot should spawn in Gazebo without regenerating URDF/SRDF/config files (same behavior as Humble).
Actual Behavior
The robot does not spawn. Only gazebo and parameter_bridge processes start. The spawn action is never added to the launch actions list.
Root Cause
Line 208 in robot_spawn.launch.py:
if not bool(generate.perform(context)):
actions.append(group_action_spawn_robot)The Problem: When generate:=false is passed, generate.perform(context) returns the string 'false'. In Python, bool('false') evaluates to True because any non-empty string is truthy. Therefore:
bool('false')→Truenot bool('false')→False- The spawn action is never appended
Comparison with Humble (Working Code)
The Humble version correctly uses launch conditions:
do_not_generate = GroupAction(actions=[group_action_spawn_robot],
condition=UnlessCondition(LaunchConfiguration('generate')))UnlessCondition properly handles string-based launch configuration values ('true'/'false').
Fix
Replace lines 208-209:
# BROKEN
if not bool(generate.perform(context)):
actions.append(group_action_spawn_robot)With:
# FIX 1: Use proper condition (like Humble)
do_not_generate = GroupAction(actions=[group_action_spawn_robot],
condition=UnlessCondition(LaunchConfiguration('generate')))
actions.append(do_not_generate)
# OR FIX 2: Properly check string value
generate_str = generate.perform(context).lower()
if generate_str in ['false', '0', 'no', 'off']:
actions.append(group_action_spawn_robot)Impact
This breaks the workflow for users who manually edit robot configuration files in ~/clearpath/ and don't want them overwritten by the generator. The generate:=false parameter is essential for development and customization.
Reproduction Steps
- Set up a Clearpath robot configuration in
~/clearpath/ - Run:
ros2 launch clearpath_gz simulation.launch.py generate:=false - Observe that only Gazebo world loads, no robot spawns
- Check
ros2 node list- only/clock_bridgeexists (no robot nodes)
Verified Locations
- GitHub repo (jazzy branch): https://github.com/clearpathrobotics/clearpath_simulator/blob/jazzy/clearpath_gz/launch/robot_spawn.launch.py#L208
- Installed package:
/opt/ros/jazzy/share/clearpath_gz/launch/robot_spawn.launch.py:208
Suggested Priority
High - This is a regression from Humble that breaks documented functionality and workflows.