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

Missing transformations in Rviz

asked 2019-09-05 07:43:20 -0600

Marseiliais gravatar image

updated 2019-09-05 11:49:00 -0600

link text

And i dont know how to connect other links to chassis

urdf file is properly formed, gazebo file is not, says:

Error: No name given for the robot. at line 89 in /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed

gazebo code:

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


  <gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
      <legacyMode>false</legacyMode>
      <alwaysOn>true</alwaysOn>
      <updateRate>20</updateRate>
      <leftJoint>left_wheel_hinge</leftJoint>
      <rightJoint>right_wheel_hinge</rightJoint>
      <wheelSeparation>0.4</wheelSeparation>
      <wheelDiameter>0.1</wheelDiameter>
      <torque>20</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <robotBaseFrame>chassis</robotBaseFrame>
    </plugin>
  </gazebo>

  <gazebo reference="chassis">
      <material>Gazebo/Orange</material>
    </gazebo>
  <gazebo reference="left_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="right_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>

  <gazebo reference="camera_link">
  <sensor name="kinect_camera" type="depth">
    <!--update_rate>40</update_rate-->
    <visualize>true</visualize>
    <camera>
      <horizontal_fov>1.047198</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.1</near>
        <far>100</far>
      </clip>
    </camera>
    <plugin name="kinect_controller" filename="libgazebo_ros_openni_kinect.so">
      <baseline>0.2</baseline>
      <alwaysOn>true</alwaysOn>
      <updateRate>0.0</updateRate>
      <cameraName>kinect_camera_ir</cameraName>
      <imageTopicName>/kinect_camera/image_raw</imageTopicName>
      <cameraInfoTopicName>/kinect_camera/depth/camera_info</cameraInfoTopicName>
      <depthImageTopicName>/kinect_camera/depth/image_raw</depthImageTopicName>
      <depthImageInfoTopicName>/kinect_camera/depth/camera_info</depthImageInfoTopicName>
      <pointCloudTopicName>/kinect_camera/depth/points</pointCloudTopicName>
      <frameName>kinect_frame</frameName>
      <pointCloudCutoff>0.5</pointCloudCutoff>
      <pointCloudCutoffMax>3.0</pointCloudCutoffMax>
      <distortionK1>0</distortionK1>
      <distortionK2>0</distortionK2>
      <distortionK3>0</distortionK3>
      <distortionT1>0</distortionT1>
      <distortionT2>0</distortionT2>
      <CxPrime>0</CxPrime>
      <Cx>0</Cx>
      <Cy>0</Cy>
      <focalLength>0</focalLength>
      <hackBaseline>0</hackBaseline>
    </plugin>
  </sensor>
</gazebo>
</robot>

xacro file:

<?xml version='1.0'?>

<robot name="myrobot" 

    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
    xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
    xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
    xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
    xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
    xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
    xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
    xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
    xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
    xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
    xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics"
    xmlns:xacro="http://ros.org/wiki/xacro">



  <xacro:include filename="$(find mybot_description)/urdf/mybot.gazebo" />
  <xacro:include filename="$(find mybot_description)/urdf/materials.xacro" />
  <xacro:include filename="$(find mybot_description)/urdf/macros.xacro" />


  <link name='chassis'>
    <pose>0 0 0.1 0 0 0</pose>

    <inertial>
      <mass value="10.0"/>
      <origin xyz="0.0 0 0.1" rpy=" 0 0 0"/>
      <inertia
          ixx="0.5" ixy="0" ixz="0"
          iyy="1.0" iyz="0"
          izz="0.1" />

    </inertial>

    <collision name='collision'>
      <geometry>
        <cylinder radius=".3" length="0.1"/>
      </geometry>
    </collision>

    <visual name='chassis_visual'>
      <origin xyz="0 0 0" rpy=" 0 0 0"/>
      <geometry>
        <cylinder radius=".3" length ="0.1"/>
      </geometry>
    </visual>


    <collision name='caster_collision'>
      <origin xyz="-0.2 0 -0.05" rpy=" 0 0 0"/>
      <geometry>
        <sphere ...
(more)
edit retag flag offensive close merge delete

Comments

We can't really help only with a screenshot from rviz, can you detail what you have launched to get this result ? Also have you checked that your urdf is properly formed ? You can try this :

check_urdf /PATH/TO/YOUR/URDF/FILE
Delb gravatar image Delb  ( 2019-09-05 08:32:41 -0600 )edit

Yes is its, says robot name is: myrobot ---------- Successfully Parsed XML --------------- root Link: chassis has 3 child(ren) child(1): camera_link child(1): camera_depth_frame child(1): camera_depth_optical_frame child(2): camera_rgb_frame child(1): camera_rgb_optical_frame child(2): left_wheel child(3): right_wheel I added code to the question

Marseiliais gravatar image Marseiliais  ( 2019-09-05 11:45:41 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-06 02:16:11 -0600

Delb gravatar image

You should include your launch file too so that we can reproduce your error.

I manage to get the same error as in your image by omitting to launch the node robot_state_publisher you seem to be launching just the joint_state_publisher node but you need both.

So a basic launch file without gazebo should be like this and wouldn't give you the same error :

<launch>

  <arg name="model" default="$(find myrobot)/urdf/myrobot.urdf.xacro"/>

  <!--  ******************** Robot Model ********************  -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />

  <!--  ******************** Joint State Publisher ********************  -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

  <!--  ******************** Robot State Publisher ********************  -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

  <!--  ******************** Rviz ********************  -->
  <node name="rviz" pkg="rviz" type="rviz" required="true" />

</launch>
edit flag offensive delete link more

Comments

Your right! Thanks a lot!

Marseiliais gravatar image Marseiliais  ( 2019-09-06 03:19:05 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-09-05 07:43:20 -0600

Seen: 401 times

Last updated: Sep 06 '19