ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to convert launch file from ros1 to ros2

asked 2022-12-24 04:45:46 -0500

updated 2022-12-24 04:54:18 -0500

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>
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-12-24 16:42:23 -0500

ljaniec gravatar image

updated 2022-12-24 16:43:13 -0500

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.

edit flag offensive delete link more

Comments

I change some of the tags which do not work. Can you kindly convert it. So I will learn

Mubashir alam gravatar image Mubashir alam  ( 2022-12-25 00:13:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-12-24 04:45:46 -0500

Seen: 328 times

Last updated: Dec 24 '22