rviz does not display the urdf model after running the launch file
My System Specifications ##
- Oracle VirtualBox
- Ubuntu 18.04
- ROS Melodic 1.14.3
- 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
- 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 - Inside the pan_tilt_model package, I created three new folders, namely 'launch', 'meshes' and 'urdf'.
~/catkin_ws/src/pan_tilt_model $ mkdir meshes launch urdf - Inside the 'urdf' folder, I created my URDF file named 'pan_tilt.urdf'
~/catkin_ws/src/pan_tilt_model/urdf $ gedit pan_tilt.urdf - Inside the 'launch' folder, I create my launch file named 'pan_tilt.launch'
~/catkin_ws/src/pan_tilt_model/launch $ gedit pan_tilt.launch - 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 ...