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

How do I display my own URDF in rviz?

asked 2014-07-25 05:01:42 -0500

MaxR gravatar image

updated 2014-07-25 05:02:28 -0500

Hello!

This might be a dumb question, but how do I view my own URDF File in rviz?

My approach so far:

  1. Create a new catkin package named "myrobot_description" with dependencies on the urdf package
  2. Create a folder urdf in the folder myrobot_description/urdf
  3. Create a valid URDF-File (as far as check_urdf is concerned)
  4. Build the package with catkin_make install
  5. Source the package by invoking source setup.bash in the install folder
  6. Copy the launch files and folder from the urdf_tutorial folder to the install/share/myrobot_description folder (this doesn't feel right.)
  7. Copy the URDF folder from the src/myrobot_description/ folder to the install/share/myrobot_description folder (wtf, this doesn't feel right AT ALL)

  8. Edit the display.launch file like this:

    <launch>
    <arg name="gui" default="False" />
    <param name="robot_description" textfile="/home/viki/catkin_ws/install/share/myrobot_description/urdf/myrobot.urdf" />
    <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="/home/viki/catkin_ws/install/share/myrobot_description/myrobot.rviz" required="true" />
    

    </launch>

  9. Launch rviz via roslaunch myrobot_description display.launch

  10. End up with a white block in rviz and Errors concerning a missing base frame

Now, as you can see, I just play around helpless and do not understand the whole process - but I do not find any ressources on how to craft a correct launch file or on "registering" my package or using rviz or which directory I should use for building URDF models etc.

I appreciate any help and pointers in any direction.

Thanks. :)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2014-07-25 06:11:31 -0500

bvbdort gravatar image

You are right 6,7 steps not required.

After launching rviz, add robot model to rviz display and edit fixed frame in Global options to "base_link" (this is the link name which you gave in .urdf )

edit flag offensive delete link more

Comments

So, how do I craft a launch file then? Just create a new folder "launch" in the install folder and create a file "display.launch" with the same content as the one from my original Post? Or is there an easier, more streamlined way? By the way, changing the fixed frame got rid of my white-box Problem

MaxR gravatar image MaxR  ( 2014-07-25 06:43:14 -0500 )edit
2

keep launch folder parllel to your src folder inside your package. Check this https://github.com/ros/urdf_tutorial hope will make things clear about folder structure and others

bvbdort gravatar image bvbdort  ( 2014-07-25 07:00:03 -0500 )edit

I created a video showing the process. You can check it here: https://youtu.be/yhcdc-8dStQ

R. Tellez gravatar image R. Tellez  ( 2017-12-03 13:48:04 -0500 )edit

@R. Tellez that's a 9 minutes long video for something that simple!

andrestoga gravatar image andrestoga  ( 2022-06-03 19:25:43 -0500 )edit
0

answered 2017-12-05 02:23:21 -0500

Use this example https://gist.github.com/RobinCPC/edb4...

I'm generated urdf from SolidWorks, just copy urdf and meshes directory into workspace

Enjoy)

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2014-07-25 05:01:42 -0500

Seen: 30,468 times

Last updated: Jul 25 '14