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

How to Load a URDF File to RVIZ

asked 2018-07-16 16:01:16 -0600

huang27c gravatar image

updated 2018-07-16 16:19:35 -0600

Hi everyone,

I have a URDF file of my own robot, but I don't know how to load it to RVIZ. I've googled but still don't get it.

I'm very new to ROS. Any help will be appreciated.

If there is a step-by-step tutorial, that will be even better.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-07-16 16:03:34 -0600

David Lu gravatar image

updated 2018-07-16 16:20:46 -0600

Check out this launch file

You're in luck if you want a step by step tutorial: http://wiki.ros.org/urdf/Tutorials#Le...

edit flag offensive delete link more

Comments

Hi David! Do I create a package and put URDF in src? Where do I place the launch file?

huang27c gravatar image huang27c  ( 2018-07-16 16:06:07 -0600 )edit

Yes, both could go in a package called robotname_description.

David Lu gravatar image David Lu  ( 2018-07-16 16:08:15 -0600 )edit

@David Lu looks like you beat me to it :)

jayess gravatar image jayess  ( 2018-07-16 16:11:15 -0600 )edit

Thank you so much!

huang27c gravatar image huang27c  ( 2018-07-16 16:22:33 -0600 )edit
0

answered 2018-07-16 16:07:05 -0600

jayess gravatar image

The following launch file is from the urdf_tutorial pacakge

<launch>

  <arg name="model" default="$(find urdf_tutorial)/urdf/01-myfirst.urdf"/>
  <arg name="gui" default="true" />
  <arg name="rvizconfig" default="$(find urdf_tutorial)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
  <param name="use_gui" value="$(arg gui)"/>

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />

</launch>

You can create your own package or download this package and use this launch file.

To use this launch file run

roslaunch urdf_tutorial display.launch model:='$(find <package-name>)/urdf/myurdf.urdf'

where <package-name> is the package that contains the URDF file and myurdf.urdf is your URDF file.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-07-16 16:01:16 -0600

Seen: 18,423 times

Last updated: Jul 16 '18