0
$\begingroup$

Rosanswers logo

My System Specifications ##

  1. Oracle VirtualBox
  2. Ubuntu 18.04
  3. ROS Melodic 1.14.3
  4. Host Computer- Windows 10 with Intel i7 and Nvidia 1660 graphics

I have been following the tutorials in the book "Mastering ROS for Robotics Programming" by Lentin Joseph. In chapter 2, for URDF tutorial, I did exactly follow the steps mentioned.

STEPS

  1. I created my pan & tilt model package inside the 'src' folder in my catkin workspace.
    ~/catkin_ws/src $ catkin_create_pkg pan_tilt_model roscpp rospy tf geometry_msgs urdf rviz xacro 2. Inside the pan_tilt_model package, I created three new folders, namely 'launch', 'meshes' and 'urdf'.<BR> ~/catkin_ws/src/pan_tilt_model $ mkdir meshes launch urdf
  2. Inside the 'urdf' folder, I created my URDF file named 'pan_tilt.urdf'
    ~/catkin_ws/src/pan_tilt_model/urdf $ gedit pan_tilt.urdf 4. Inside the 'launch' folder, I create my launch file named 'pan_tilt.launch'<BR> ~/catkin_ws/src/pan_tilt_model/launch $ gedit pan_tilt.launch
  3. I tried to run the 'roslaunch' command to run the launch file for the pan & tilt model
    ~/catkin_ws $ roslaunch pan_tilt_model pan_tilt.launch

Expected Outcome

Rviz should display my pan & tilt model in its display area along with a joint_state_publisher GUI.


Outcome I got

Rviz didn't display my model in its canvas. It just displayed a blank grid. Also, rviz was showing errors as

  • Global Status: Error
  • Fixed Frame- Fixed Frame [map] does not exist.

I have attached the screenshot the rviz window I am getting in the below link. rviz_window


Launch File 'pan_tilt.urdf'

<launch>
<arg name="model" />
<!-- Parsing xacro and setting robot_description parameter -->
<param name="robot_description" textfile="$(find pan_tilt_model)/urdf/pan_tilt.urdf" />

<!-- Setting gui parameter to true for display joint slider -->

<!-- Starting Joint state publisher node which will publish the joint values -->

<!-- Starting robot state publish which will publish tf -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<!-- Launch visualization in rviz -->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find pan_tilt_model)/urdf.rviz" required="true" />
    <node name="jsp_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
</launch>

URDF File 'pan_tilt.urdf'

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

  <link name="dummy">
   </link>

  <joint name="dummy_joint" type="fixed">
     <parent link="dummy"/>
     <child link="base_link"/>
   </joint>

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

Originally posted by nilutpolkashyap on ROS Answers with karma: 3 on 2020-05-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Please read: 7. Coordinate Frames and watch the video there. http://wiki.ros.org/rviz/UserGuide


Originally posted by Dragonslayer with karma: 574 on 2020-05-24

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by nilutpolkashyap on 2020-05-24:
Thanks a lot. It solved my problem.

Comment by Dragonslayer on 2020-05-28:
You are welcome. Please mark the answer as correct to keep answers.ros organized. thanks.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.