Skip to content

turtlebot3_state_publisher.launch.py cannot be launched directly: undeclared 'namespace' argument #1149

Description

@mmporong

Operating System

Ubuntu 22.04 (ROS 2 Humble, ros-humble-turtlebot3-bringup 2.3.6)

Description

turtlebot3_bringup/launch/turtlebot3_state_publisher.launch.py reads
LaunchConfiguration('namespace') but never declares it and gives it no default
value. As a result the file can only be used when it is included from
robot.launch.py, which passes the argument explicitly. Launching it directly
fails before any node starts.

To reproduce

export TURTLEBOT3_MODEL=burger
ros2 launch turtlebot3_bringup turtlebot3_state_publisher.launch.py
urdf_file_name : turtlebot3_burger.urdf
[ERROR] [launch]: Caught exception in launch (see debug for traceback):
launch configuration 'namespace' does not exist

Where it comes from

Introduced in d81e95a
("Add namespace argument for multi robot control in turtlebot3 bringup launch",
2025-02-03).

That commit added both LaunchConfiguration('namespace', default='') and a
matching DeclareLaunchArgument('namespace', ...) to robot.launch.py, but added
only the LaunchConfiguration to turtlebot3_state_publisher.launch.py. The two
files are therefore inconsistent, and the child launch file depends on the parent to
supply the argument.

The affected file is byte-identical on main, jazzy and humble, so all three
branches are affected.

Impact

Any package that includes turtlebot3_state_publisher.launch.py without passing
namespace now fails. For example StanfordASL/asl-tb3-driver
(launch/bringup.launch.py) includes it with no launch arguments.

This may also be related to #1104, which reported a launch failure in this area and
was closed without a code change.

Suggested fix

Apply to turtlebot3_state_publisher.launch.py the same pattern already used in
robot.launch.py: give namespace a default and declare it. This keeps the
multi-robot behaviour intact (empty namespace when the argument is omitted,
namespace:=tb1 still prefixing frames) and additionally makes the argument visible
in ros2 launch ... --show-args.

A pull request with this change is attached.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions