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

I want to create my own model urdf file and run it in rviz

asked 2017-04-16 08:15:59 -0500

shbhmsin gravatar image

I'm a beginner and trying to learn ROS. I know how to create a urdf file, catkin workspace and package. But not sure on how to run that urdf file in rviz. Basically I'd like to know how to create launch files without using any tutorial package launch folder.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-04-17 09:12:38 -0500

Airuno2L gravatar image

updated 2017-04-17 09:13:22 -0500

Have you looked through the urdf tutorials?

They show you how to launch a urdf in rviz:

$ roslaunch urdf_tutorial display.launch model:='$(find urdf_tutorial)/urdf/01-myfirst.urdf'

If you don't want to use the urdf_tutorial package (I think that's what you're saying) simply copy the display.launch file from the urdf_tutorial package and paste it in your own package, then you're free to edit it if you like. You'll see there's not much in there:

<launch>

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

  <param name="robot_description" command="$(find xacro)/xacro.py $(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>

It's just starting all the nodes you'll need to show the robot in Rviz (and move the joints)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-04-16 08:15:59 -0500

Seen: 704 times

Last updated: Apr 17 '17