[ROS2] equivalent of "textfile" argument from ROS1 launch file
I am developing a ROS2 version of a package, but I am stuck with the launch file. What I had for ROS1 is this:
<arg name="robot_name"/>
<param name="robot_description" textfile="/path/to/$(arg robot_name).urdf"/>
This permitted to read the urdf and to load its content in the robot_description parameter.
In ROS2 xml launches, textfile
is not supported anymore.
Options are:
- Some tricks to still using xml (with the "command" argument?)
Using the python launchfile. In this case I have trouble because I can not concatenate
LaunchConfiguration
andstr
. From https://docs.ros.org/en/foxy/Tutorial... I tried something like:robot_name = LaunchConfiguration('robot_name')
urdf_path = "/path/to/$(arg robot_name)" urdf = os.path.join("/path/to/", robot_name)
with open(urdf, 'r') as infp: robot_desc = infp.read()
But I can not join
the path with the hand name
Any suggestions? Thanks
Would the turtlebot solution work for you? They use an environment set in Ubuntu and concatenate them as shown in the link.
Thanks, this is a nice workaround: