How to concatinate LaunchConfiguration's default value with String in ros-humble python launch file?
Hi guys, I need to concatinate default value of LaunchArgument
with string
, not sure how to achieve that. I have the following scenario in the ros2-humble python launch file:
declare_namespace = DeclareLaunchArgument(
name="namespace",
default_value="robot_1",
)
and I want to do the the following operation in the Node
parameters:
{"frame_prefix": LaunchConfiguration("namespace") + "/"}
detailed Node:
robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output='screen',
namespace=LaunchConfiguration('namespace'),
parameters=[
{"robot_description": Command(["xacro ", LaunchConfiguration("xacro_file")])},
{"publish_frequency": 60.0},
{"use_tf_static": False},
{"ignore_timestamp": True},
{'use_sim_time': LaunchConfiguration("use_sim_time")},
# {"frame_prefix": LaunchConfiguration("namespace"). + "/"}
], )
Is there anything to do with perform
member function of LaunchConfiguration
?
Do you mind updating your post to add what you tried and the (error) message the system returned? That allows Google to search. Many people look for info by the error message.