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

DiffDrive odometry source is missing

asked 2016-06-05 15:10:47 -0500

M_wasiel13 gravatar image

updated 2016-06-07 07:03:57 -0500

Hello, When i launch my simulation I get two warnings:

[ WARN] [1465156368.902100026, 1017.888000000]: DiffDrive(ns = //): missing <odometrySource> default is 1
[ WARN] [1465156368.902473604, 1017.888000000]: GazeboRosDiffDrive Plugin (ns = ) missing <publishTf>, defaults to 1

I try to run gazebo+ ros with pioneer robot. I don't know how to solve this issue.

That's how i use DiffDrive plugin pioneer.gazebo files:

<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
  </gazebo>
  <gazebo>
    <plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">
      <alwaysOn>true</alwaysOn>
      <updateRate>100</updateRate>
      <leftJoint>base_left_wheel_joint</leftJoint>
      <rightJoint>base_right_wheel_joint</rightJoint>
      <torque>5</torque><br />
      <wheelSeparation>0.39</wheelSeparation>
      <wheelDiameter>0.15</wheelDiameter>
      <commandTopic>pioneer/cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <robotBaseFrame>base_link</robotBaseFrame>
      <publishWheelTF>true</publishWheelTF>
      <publishWheelJointState>true</publishWheelJointState>
      <wheelAcceleration>0</wheelAcceleration>
      <wheelTorque>5</wheelTorque>
      <rosDebugLevel>na</rosDebugLevel>
    </plugin>
  </gazebo>

And here i attached my launch files:

<launch>
  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find gazebo_worlds)/worlds/Factory_World.world"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>
  <!-- No namespace here as we will share this description. 
       Access with slash at the beginning -->
  <!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description"
     command="$(find xacro)/xacro.py '$(find pioneer_description)/urdf/pioneer3dx.xacro'" />
  <!-- BEGIN PIONEER 1-->
  <include file="$(find pioneer_description)/launch/one_pioneer.launch" >
      <arg name="init_pose" value="-x 0 -y -55 -z 0" />
  </include>
    <param name="/use_sim_time" value="true"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find gazebo_worlds)/maps/FactoryWorld.yaml" >
    <param name="frame_id" value="/map" />
  </node>
    <param name="robot_description"
    command="$(find xacro)/xacro.py '$(find pioneer_description)/urdf/pioneer3dx.xacro'" />

  <!-- Show in Rviz   -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find pioneer_description)/launch/pioneer.rviz"/>



</launch>

And one_pioneer.launch:

<launch>
  <arg name="init_pose"/>

  <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
    args="$(arg init_pose) -urdf -model -param /robot_description"/>

  <!-- send fake joint values -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" >
    <param name="use_gui" value="FALSE"/>
    <remap from="robot_description" to="/robot_description"/>
  </node>
  <!-- Combine joint values -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
  <!-- The odometry estimator, throttling, fake laser etc. go here -->
  <!-- All the stuff as from usual robot launch file -->  
</launch>

I think this is a really simple problem but i have no knowledge how to solve that issue.


Below I alsso attached all logs from gazebo etc. starting:

 [ INFO] [1465156365.861468958, 1017.888000000]: Camera Plugin (robotNamespace = /), Info: Using the 'robotNamespace' param: '/'
    [ INFO] [1465156366 ...
(more)
edit retag flag offensive close merge delete

Comments

I don't see the warnings. A little update ? :)

F.Brosseau gravatar image F.Brosseau  ( 2016-06-06 02:06:39 -0500 )edit

Please format xml (launch files, urdf) and error messages with the Preformatted text button (the one with 101010 on it). Just select the text you want to format, then press the button (or ctrl+k). Otherwise your question is rather hard to read. Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2016-06-06 02:12:31 -0500 )edit

Hi, The description has been updated. I hope now it is more clear. Waiting for your response because I think this warning causes my problems with work of base_local_planner

M_wasiel13 gravatar image M_wasiel13  ( 2016-06-07 07:05:58 -0500 )edit

Do you have an error ? These two warnings just tell you that you don't use the odometrySource and publishTf tags so it will use default values. Values for odometrySource are WORLD or ENCODER. You can set it by adding <odometrysource>WORLD</odometrysource> for example.

F.Brosseau gravatar image F.Brosseau  ( 2016-06-07 07:13:02 -0500 )edit

If you have a problem with a ros node and simulation, maybe you can use rqt_graph tool to see if all topics are correctly mapped.

F.Brosseau gravatar image F.Brosseau  ( 2016-06-07 07:20:21 -0500 )edit

No i don't have an error. In rqt_graph everything seems ok. According to your description I can conclude that such warning are not a problem. Am I right?

M_wasiel13 gravatar image M_wasiel13  ( 2016-06-07 17:09:21 -0500 )edit

Also I add description "<odometrysource>WORLD</odometrysource>" to my pioneer.gazebo file and warnings are still the same.

M_wasiel13 gravatar image M_wasiel13  ( 2016-06-07 17:15:20 -0500 )edit

These warnings are not a problem.

Sorry my bad, I made a mistake. It's odometrySource.

You can check what are the parameters of the plugins by checking the source code : git_gazebo

F.Brosseau gravatar image F.Brosseau  ( 2016-06-08 02:01:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
9

answered 2017-09-23 07:48:48 -0500

you are missing tags in your libgazebo_ros_diff_drive plugin:

<odometrySource>world</odometrySource> <!-- 'encoder' instead of 'world' is also possible -->
<publishTf>1</publishTf>

here is a full example of a correct definition:

  <!-- differential drive -->
<gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>40</updateRate>
        <legacyMode>false</legacyMode>
        <leftJoint>base_right_wheel_joint</leftJoint>
        <rightJoint>base_left_wheel_joint</rightJoint>
        <wheelSeparation>0.39</wheelSeparation>
        <wheelDiameter>0.15</wheelDiameter>
        <torque>5</torque>
        <commandTopic>cmd_vel</commandTopic>
        <odometryTopic>odom</odometryTopic>
        <odometryFrame>odom</odometryFrame>
        <robotBaseFrame>base_link</robotBaseFrame>
        <publishWheelTF>false</publishWheelTF>
        <publishWheelJointState>false</publishWheelJointState>
        <rosDebugLevel>na</rosDebugLevel>
        <wheelAcceleration>0</wheelAcceleration>
        <wheelTorque>5</wheelTorque>
        <odometrySource>world</odometrySource>
        <publishTf>1</publishTf>
    </plugin>
</gazebo>
edit flag offensive delete link more

Comments

This indeed fixes the issue but what is the meaning of the value? I cannot find any documentation for it.

Felix Widmaier gravatar image Felix Widmaier  ( 2018-06-13 08:46:30 -0500 )edit
1

Where we can find the documentation of libgazebo_ros_diff_drive plugin? I asking for the documentation where we can find the description of all the available tags for this plugin. Thanks.

Elric gravatar image Elric  ( 2018-12-11 03:06:05 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-05 15:10:47 -0500

Seen: 6,930 times

Last updated: Sep 23 '17