Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Rviz not displaying anything

I am a beginner. This is the URDF file code <robot name="pan_tilt">

<link name="base_link">

<visual>
  <geometry>
<cylinder length="0.01" radius="0.2"/>
  </geometry>
  <origin rpy="0 0 0" xyz="0 0 0"/>
  <material name="yellow">
    <color rgba="1 1 0 1"/>
  </material>
</visual>

<collision>
  <geometry>
<cylinder length="0.03" radius="0.2"/>
  </geometry>
  <origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
<inertial>
<mass value="1"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>

</link>

<joint name="pan_joint" type="revolute"> <parent link="base_link"/> <child link="pan_link"/> <origin xyz="0 0 0.1"/> <axis xyz="0 0 1"/> <limit effort="300" velocity="0.1" lower="-3.14" upper="3.14"/> <dynamics damping="50" friction="1"/> </joint>

<link name="pan_link"> <visual> <geometry> <cylinder length="0.4" radius="0.04"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.09"/> <material name="red"> <color rgba="0 0 1 1"/> </material> </visual> <collision> <geometry> <cylinder length="0.4" radius="0.06"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.09"/> </collision> <inertial> <mass value="1"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial> </link>

<joint name="tilt_joint" type="revolute"> <parent link="pan_link"/> <child link="tilt_link"/> <origin xyz="0 0 0.2"/> <axis xyz="0 1 0"/> <limit effort="300" velocity="0.1" lower="-4.64" upper="-1.5"/> <dynamics damping="50" friction="1"/> </joint>

<link name="tilt_link"> <visual> <geometry> <cylinder length="0.4" radius="0.04"/> </geometry> <origin rpy="0 1.5 0" xyz="0 0 0"/> <material name="green"> <color rgba="1 0 0 1"/> </material> </visual> <collision> <geometry> <cylinder length="0.4" radius="0.06"/> </geometry> <origin rpy="0 1.5 0" xyz="0 0 0"/> </collision> <inertial> <mass value="1"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial>

</link>

</robot>

Below is the launch file code -- >

<launch>

<arg name="model" />


    <param name="robot_description" command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" />



    <param name="use_gui" value="true"/>


    <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 $(find mastering_ros_robot_description_pkg)/urdf.rviz" required="true" />

</launch>


When I launch the launch file, It launches the Rviz but it doesn't display the model in it. It's basically empty. What could I be doing wrong?

click to hide/show revision 2
None

Rviz not displaying anything

I am a beginner. This is the URDF file code <robot name="pan_tilt">

<link name="base_link">

<?xml version="1.0"?>
<robot name="pan_tilt">

  <link name="base_link">

    <visual>
   <geometry>
 <cylinder length="0.01" radius="0.2"/>
   </geometry>
   <origin rpy="0 0 0" xyz="0 0 0"/>
   <material name="yellow">
     <color rgba="1 1 0 1"/>
   </material>
 </visual>

 <collision>
   <geometry>
 <cylinder length="0.03" radius="0.2"/>
   </geometry>
   <origin rpy="0 0 0" xyz="0 0 0"/>
 </collision>
 <inertial>
 <mass value="1"/>
 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
 </inertial>

</link>

</link> <joint name="pan_joint" type="revolute"> <parent link="base_link"/> <child link="pan_link"/> <origin xyz="0 0 0.1"/> <axis xyz="0 0 1"/> 1" /> <limit effort="300" velocity="0.1" lower="-3.14" upper="3.14"/> <dynamics damping="50" friction="1"/> </joint>

</joint> <link name="pan_link"> <visual> <geometry> <cylinder length="0.4" radius="0.04"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.09"/> <material name="red"> <color rgba="0 0 1 1"/> </material> </visual> <collision> <geometry> <cylinder length="0.4" radius="0.06"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.09"/> </collision> <inertial> <mass value="1"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial> </link>

</link> <joint name="tilt_joint" type="revolute"> <parent link="pan_link"/> <child link="tilt_link"/> <origin xyz="0 0 0.2"/> <axis xyz="0 1 0"/> 0" /> <limit effort="300" velocity="0.1" lower="-4.64" upper="-1.5"/> <dynamics damping="50" friction="1"/> </joint>

</joint> <link name="tilt_link"> <visual> <geometry> <cylinder length="0.4" radius="0.04"/> </geometry> <origin rpy="0 1.5 0" xyz="0 0 0"/> <material name="green"> <color rgba="1 0 0 1"/> </material> </visual> <collision> <geometry> <cylinder length="0.4" radius="0.06"/> </geometry> <origin rpy="0 1.5 0" xyz="0 0 0"/> </collision> <inertial> <mass value="1"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial>

</link>

</robot>

</inertial> </link> </robot>

Below is the launch file code -- >

<launch>code

<launch>

    <arg name="model" />


     <param name="robot_description" command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" />



     <param name="use_gui" value="true"/>


     <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 $(find mastering_ros_robot_description_pkg)/urdf.rviz" required="true" />

</launch>

</launch>


When I launch the launch file, It launches the Rviz but it doesn't display the model in it. It's basically empty. What could I be doing wrong?