How to convert launch file from ros1 to ros2
I have the following launch file written in XML format working fine in ros1 noetic I am not able to launch it in ros2.
<launch>
<arg
name="model" />
<param
name="robot_description"
textfile="$(find mobile_robot)/urdf/mobile_robot.urdf" />
<node
name="joint_state_publisher_gui"
pkg="joint_state_publisher_gui"
type="joint_state_publisher_gui" />
<node
name="robot_state_publisher"
pkg="robot_state_publisher"
type="robot_state_publisher" />
<node
name="rviz"
pkg="rviz"
type="rviz"
args="-d $(find mobile_robot)/urdf.rviz" />
</launch>
Asked by Mubashir alam on 2022-12-24 05:45:46 UTC
Answers
Can you try these steps from this documentation page?
It looks like you have to change only small parts of this XML launch file (especially param and rosparam, look below).
There’s no global parameter concept in ROS 2. For that reason, it can only be used nested in a node tag. Some attributes aren’t supported in ROS 2:
type
,textfile
,binfile
,executable
,command
.
This tutorial is also helpful.
Asked by ljaniec on 2022-12-24 17:42:23 UTC
Comments
I change some of the tags which do not work. Can you kindly convert it. So I will learn
Asked by Mubashir alam on 2022-12-25 01:13:45 UTC
Comments