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

issue with odom and tf with gazebo simulation

asked 2018-07-29 05:48:01 -0500

Guy Corbaz gravatar image

I'm creatig a four wheel robot. I can simulate it and pilot it with a joystick and everything woks fine until this point. However, I'm facing issues with gmapping. When I start it, I got the following message:

[ WARN] [1532859238.408531484]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

I do launch gmapping with the following command:

rosrun gmapping slam_gmapping scan:=base_scan

my urdf file is:

<?xml version="1.0"?>
<robot name="gribot" xmlns:xacro="http://www.ros.org/wiki/xacro">

   <xacro:include filename="$(find gribot)/urdf/wheel.urdf.xacro" />


   <!-- Defining the colors used in this robot -->

   <material name="Black">
      <color rgba="0.0 0.0 0.0 1.0"/>
   </material>

   <material name="Red">
      <color rgba="0.8 0.0 0.0 1.0"/>
   </material>

   <material name="White">
      <color rgba="1.0 1.0 1.0 1.0"/>
   </material>

   <material name="Blue">
      <color rgba="0.0 0.0 0.8 1.0"/>
   </material>


   <!-- Property list -->
   <!-- All units in m-kg-s-radians unit system -->

   <xacro:property name="M_PI" value="3.1415926535897931" />      
   <xacro:property name="M_PI_2" value="1.570796327" />
   <xacro:property name="DEG_TO_RAD" value="0.017453293" />


   <!-- Main body length height width -->

   <xacro:property name="base_height"   value="0.25" /> <!-- in meter -->
   <xacro:property name="base_width"    value="0.6"  /> <!-- in meter -->
   <xacro:property name="base_lenght"   value="0.8"  /> <!-- in meter -->
   <xacro:property name="base_mass"     value="20.0" /> <!-- in kg -->


   <!-- Macro for calculating inertia of cylinder -->

   <xacro:macro name="cylinder_inertia" params="m r h">
      <inertia ixx="${ m * ( 3 * r*r + h*h ) / 12}" ixy="0" ixz="0"
               iyy="${ m * ( 3 * r*r + h*h ) / 12}" iyz="0"
               izz="${ m * r / 2}" />
   </xacro:macro>


   <!-- Macro for calculating inertia of a box -->

   <xacro:macro name="box_inertia" params="m x y z">
      <inertia ixx="${0.0833333 * m * (y*y + z*z)}" ixy="0.0" ixz="0.0"
               iyy="${0.0833333 * m * (x*x + z*z)}" iyz="0.0"
               izz="${0.0833333 * m * (x*x + y*y)}" />
   </xacro:macro>


   <!-- World link -->
   <!-- world_link is a fictious link(frame) that is on the ground right below base_link origin -->
   <!-- It is necessary as gazebo does not support inertia for the root link -->
   <!-- Do not call it world as it is reserved for robot that must be fixed to the world -->

   <link name="world_link">
   </link>


   <gazebo reference="world_link">
      <turnGravityOff>false</turnGravityOff>
   </gazebo>


   <joint name="glue_robot_to_world" type="fixed">
      <origin xyz="0 0 0.1" rpy="0 0 0" />
      <parent link="world_link" />
      <child link="base_link" />
   </joint>


   <!-- Base link -->
   <!-- Actual body/chassis of the robot -->

   <link name="base_link">
      <inertial>
         <mass value="${base_mass}" />
         <!-- the3x3 rotational inertia matrix -->
         <box_inertia m="${base_mass}" x="${base_lenght}" y="${base_width}" z="${base_height}" />
         <origin xyz="0 0 0" />
      </inertial>
      <visual>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
            <box size="${base_lenght} ${base_width} ${base_height}" />
         </geometry>
         <material name="Blue" />
      </visual>
      <collision>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
            <box size="${base_lenght} ${base_width} ${base_height}" />
         </geometry>
      </collision>
   </link>


   <gazebo reference="base_link">
      <material>Gazebo/White</material>
      <turnGravityOff>false</turnGravityOff ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-01 05:28:06 -0500

Guy Corbaz gravatar image

updated 2018-08-01 06:03:31 -0500

Finally I solved the issue of gmapping: The parameter

<broadcastTF>true</broadcastTF>

of section

<plugin name="drive_controller" filename="libgazebo_ros_skid_steer_drive.so">

must be true.

For those who are interested, complete robot files are in github.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-07-29 05:48:01 -0500

Seen: 1,228 times

Last updated: Aug 01 '18