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

Unable to visualize .dae mesh files in RViz

asked 2018-05-09 14:12:34 -0500

updated 2018-05-09 14:14:12 -0500

Hey!

I was trying to visualize a URDF file which includes the UR5 robot with a table and a Kinect sensor in RViz. I have attached an example link description in URDF format. I am using Ubuntu 16.04 and ROS Kinetic. I have used check_urdf for the full .urdf file and it parsed successfully.

<link name="base_link">
    <visual>
      <geometry>
        <mesh filename="file:///home/aadityacr7/ros_trial/src/universal_robot/ur_description/meshes/ur5/visual/base.dae"/>
      </geometry>
      <material name="LightGrey">
        <color rgba="0.7 0.7 0.7 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <mesh filename="file:///home/aadityacr7/ros_trial/src/universal_robot/ur_description/meshes/ur5/collision/base.stl"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="4.0"/>
      <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
      <inertia ixx="0.00443333156" ixy="0.0" ixz="0.0" iyy="0.00443333156" iyz="0.0" izz="0.0072"/>
    </inertial>
  </link>

This is the launch file which I am using in order to display the robot in RViz.

<launch>
  <arg name="gui" default="true"/>
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find myworkcell_support)/urdf/workcell_trial3.urdf'" /> 
    <param name="use_gui" value="$(arg gui)"/>
  <node name="rviz" pkg="rviz" type="rviz" if="$(arg gui)"/>
</launch>

Rviz_white

What could be the reason for the same?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-09 14:43:45 -0500

You need to launch the robot_state_publisher

robot_state_publisher uses the URDF specified by the parameter robot_description and the joint positions from the topic > joint_states to calculate the forward kinematics of the robot and publish the results via tf.

and probably joint_state_publisher (with GUI).


Example .launch file

<launch>
  <arg name="gui" default="true"/>
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find myworkcell_support)/urdf/workcell_trial3.urdf'" /> 
  <param name="use_gui" value="$(arg gui)"/>
  <node name="rviz" pkg="rviz" type="rviz" if="$(arg gui)"/>

  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" />

   <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" >
     <param name="use_gui" value="True"/>
   </node>
</launch>
edit flag offensive delete link more

Comments

Thank you so much! Works perfectly.

aaditya_saraiya gravatar image aaditya_saraiya  ( 2018-05-09 15:12:14 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-09 14:12:34 -0500

Seen: 1,105 times

Last updated: May 09 '18