Gazebo | Ignition | Community
Ask Your Question

How to loading model XML from ros parameter like robot_description in ROS2

asked 2021-04-12 07:29:14 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi, there. I encountered a problem, I don’t know how to load xacro file into gazebo in ros2

In ROS1, we could load model XML from ros parameter

<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find m_bot_description)/urdf/mbot_gazebo.xacro'"/>

<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -model mrobot -param robot_description"/>

And in ROS2, I've found that the ros2 launch have already supported the command, maybe I guess the launch file could be written as

image description

I hope there is an option something like -param in the code where I type -???, but I only found -file, -topic, -stdin in the to load the xml

How could I modify it to load the xacro file?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-04-19 12:32:31 -0600

Jose Luis Rivero gravatar image

updated 2021-04-20 13:04:12 -0600

That is a good question:

Looking into the examples, all I can say is that seems like the new approach is using a topic named robot_descriptionto load xacro code. See I can not find any other code using parameters.

To complete the information I've updated the gazebo_ros_pkgs migration wiki

Hope it helps.

edit flag offensive delete link more



Thanks very much

Jony gravatar imageJony ( 2021-04-19 21:14:22 -0600 )edit

Question Tools

1 follower


Asked: 2021-04-12 07:29:14 -0600

Seen: 2,008 times

Last updated: Apr 20 '21