Declare the namespace launch argument in state publisher launch - #1150
Open
mmporong wants to merge 1 commit into
Open
Declare the namespace launch argument in state publisher launch#1150mmporong wants to merge 1 commit into
mmporong wants to merge 1 commit into
Conversation
turtlebot3_state_publisher.launch.py reads LaunchConfiguration('namespace')
but never declares it and gives it no default, so the file only works when it
is included from robot.launch.py, which passes the argument explicitly.
Launching it directly fails:
$ ros2 launch turtlebot3_bringup turtlebot3_state_publisher.launch.py
[ERROR] [launch]: Caught exception in launch (see debug for traceback):
launch configuration 'namespace' does not exist
This was introduced in d81e95a ("Add namespace argument for multi robot
control in turtlebot3 bringup launch"). That commit added both the
LaunchConfiguration and a matching DeclareLaunchArgument to robot.launch.py,
but only the LaunchConfiguration to turtlebot3_state_publisher.launch.py.
This change applies the same pattern to the latter file.
The multi robot behaviour is unchanged: with no argument the namespace stays
empty, and 'namespace:=tb1' still prefixes the frames as before.
Signed-off-by: mmporong <mmporong@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: Fixes #1149.
turtlebot3_state_publisher.launch.pycannot be launcheddirectly because it reads
LaunchConfiguration('namespace')without declaring it orgiving it a default, so it only works when included from
robot.launch.py.Fix: Give
namespacea default value and declare it, mirroring whatd81e95a already did for
robot.launch.py. The two launch files are now consistent.Verification: tested against
ros-humble-turtlebot3-bringup2.3.6 withTURTLEBOT3_MODEL=burger.ros2 launch turtlebot3_bringup turtlebot3_state_publisher.launch.pylaunch configuration 'namespace' does not existgot segment base_footprintnamespace:=tb1got segment tb1/base_footprintros2 launch turtlebot3_bringup robot.launch.py... --show-argsnamespacenot listednamespacelistedflake8 --max-line-length 99Multi-robot behaviour is unchanged: omitting the argument keeps the namespace empty,
which is what
robot.launch.pypasses today.The file is byte-identical on
main,jazzyandhumble, so the same patch appliesto the other branches if a backport is wanted.