Cannot display the urdf model in rviz (launch file)
Hello,
I am new to ROS and today I attempted to write a simple code for a launch file just to display my urdf model in rviz. I wrote this for a start:
<launch>
<param name="robot_description" textfile="$(find labrob_description)/urdf/labrob.urdf" />
<node name="rviz" pkg="rviz" type="rviz" required="true" />
</launch>
What I get is an empty rviz grid. Could you please explain me what I am doing wrong ? I saw some ready codes and they work fine for me when I roslaunch them (they display my model correctly in rviz) and from what I got, these are the lines to display a urdf model. Am I right ?
Thanks for your time and your answer in advance, Chris
I am adding also the urdf model code:
<robot name="labrob">
<!-- Base link -->
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="1 0.5 0.25"/>
</geometry>
<material name="yellow">
<color rgba="0.8 0.8 0 1"/>
</material>
</visual>
</link>
<!-- Front Right Wheel -->
<link name="f_r_wheel">
<visual>
<origin xyz="0 0 0" rpy="1.570795 0 0" />
<geometry>
<cylinder length="0.1" radius="0.2" />
</geometry>
<material name="black">
<color rgba="0.05 0.05 0.05 1"/>
</material>
</visual>
</link>
<joint name="joint_f_r_wheel" type="continuous">
<parent link="base_link"/>
<child link="f_r_wheel"/>
<origin xyz="0.25 -0.30 0" rpy="0 0 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
<!-- Back Right Wheel -->
<link name="b_r_wheel">
<visual>
<origin xyz="0 0 0" rpy="1.570795 0 0" />
<geometry>
<cylinder length="0.1" radius="0.2" />
</geometry>
<material name="black"/>
</visual>
</link>
<joint name="joint_b_r_wheel" type="continuous">
<parent link="base_link"/>
<child link="b_r_wheel"/>
<origin xyz="-0.25 -0.30 0" rpy="0 0 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
<!-- Front Left Wheel -->
<link name="f_l_wheel">
<visual>
<origin xyz="0 0 0" rpy="1.570795 0 0" />
<geometry>
<cylinder length="0.1" radius="0.2" />
</geometry>
<material name="black"/>
</visual>
</link>
<joint name="joint_f_l_wheel" type="continuous">
<parent link="base_link"/>
<child link="f_l_wheel"/>
<origin xyz="0.25 0.30 0" rpy="0 0 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
<!-- Back Left Wheel -->
<link name="b_l_wheel">
<visual>
<origin xyz="0 0 0" rpy="1.570795 0 0" />
<geometry>
<cylinder length="0.1" radius="0.2" />
</geometry>
<material name="black"/>
</visual>
</link>
<joint name="joint_b_l_wheel" type="continuous">
<parent link="base_link"/>
<child link="b_l_wheel"/>
<origin xyz="-0.25 0.30 0" rpy="0 0 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
</robot>