ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error in rviz displaying urdf model

asked 2016-07-13 09:39:18 -0500

patrchri gravatar image

updated 2016-07-13 09:42:17 -0500

Hello,

I am trying to create a simple 4 wheel robot with a camera and I have written this code for the urdf model:

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

As you can read I haven't put yet the camera or the trasmission blocks. I just have written the basic structure of the model with the joints. I have also written this .launch file:

<launch>
  <!-- urdf xml robot description loaded on the Parameter Server-->
  <param name="robot_description" textfile="$(find labrob_description)/urdf/labrob.urdf" />
  <arg name="gui" default="true" />
  <arg name="rvizconfig" default="$(find labrob_description)/rviz/urdf.rviz" />


  <!--param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" -->
  <param name="use_gui" value="$(arg gui)"/>


  <!-- source that publishes the joint positions as a sensor_msgs/JointState -->
  <param name="use_gui" value="true"/>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />


  <!-- publish all the frames to TF -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="rob_st_pub" >
  <param name="publish_frequency" value="50"/> <!-- Hz -->
  </node>


  <!-- robot visualization -->
  <node name="rviz" pkg="rviz" args="-d $(arg rvizconfig)" type="rviz" required="true" />
</launch>

In this launch file I am trying to display my model in the rviz environment. Via the launch file I call a .rviz configuration file which is this one:

Panels ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-13 09:46:36 -0500

patrchri gravatar image

updated 2016-07-13 09:48:29 -0500

I exited roscore, closed the terminal (I didn't change anything during that) and reopened it and it worked and showed my model correctly... I don't know what went wrong...

edit flag offensive delete link more

Comments

yes you are right restarting solved my issue..thanks

suab123 gravatar image suab123  ( 2019-11-07 03:21:59 -0500 )edit

Sir I am facing with same issue .I have placed 8 sonar sensors around the turtlebot.its launching succesfully on gazebo but while launching on rviz it is showing error

[robot_state_publisher-2] process has died [pid 15687, exit code 255, cmd /opt/ros/kinetic/lib/robot_state_publisher/state_publisher __name:=robot_state_publisher __log:=/home/lekhasree/.ros/log/28d6ed84-d9a5-11ea-9c76-37d291b527b9/robot_state_publisher-2.log]. log file: /home/lekhasree/.ros/log/28d6ed84-d9a5-11ea-9c76-37d291b527b9/robot_state_publisher-2*.log

sree gravatar image sree  ( 2020-08-08 13:33:09 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-13 09:39:18 -0500

Seen: 1,319 times

Last updated: Jul 13 '16