Ask Your Question
0

Rviz not displaying anything

asked 2018-03-11 08:40:38 -0600

Prof. xavier gravatar image

updated 2018-03-11 20:57:45 -0600

jayess gravatar image

I am a beginner. This is the URDF file code

<?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>

  <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?

edit retag flag offensive close merge delete

Comments

Did you add an RobotModel-Widget?

NEngelhard gravatar imageNEngelhard ( 2018-03-11 09:35:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-12 04:43:14 -0600

nmssilva gravatar image

check if your fixed frame in rviz is defined

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-03-11 08:40:38 -0600

Seen: 260 times

Last updated: Mar 12 '18