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>
2
Answers
You should check out the official documentation for converting launch files. The tl;dr version is that the
type
tag has been changed toexec
,ns
tonamespace
. There is also no global params, and thetextfile
param type has been removed(both are relevant to your code). And finally,rviz
is not a ros2 package; it’s nowrviz2
.I’d also suggest working on the formatting of your launch files for future posts, this doesn’t follow the ros formatting standards and is fairly hard to read.
You can write something like this,