Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem using Gazebo with ROS

I'm developing a node which controls the navigation of a p3dx equipped with a laser rangefinder.
I'm simulating the navigation in Gazebo and also in rviz, to see the ranges detected by the laser.
But what the p3dx does in gazebo is different from what it does in rviz. The navigation displayed in rviz is correct, instead the one in gazebo isn't.
How is it possible?
I'm using pioneer3dx.gazebo.launch:

<launch>

  <include file="$(find gazebo_worlds)/launch/empty_world.launch"/>

  <include file="$(find p2os_urdf_mod)/launch/upload_pioneer3dx.xml"/>

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="spawn_pioneer" pkg="gazebo" type="spawn_model" 
    args="-z 0.051 
          -urdf 
          -param robot_description  
          -model robot_description" 
    respawn="false" output="screen" />

  <!-- Controller Manager -->
  <include file="$(find pr2_controller_manager)/controller_manager.launch" />

  <!-- load controllers -->
  <node name="diffdrive" pkg="gazebo_plugins" type="gazebo_ros_diffdrive" respawn="true" output="screen"/>


</launch>

The node that I developed reads some parameters about the desired trajectory and publishes the correct linear and angular speed on the topic /cmd_vel.
I checked the odometry published by "gazebo_ros_diffdrive" controller on the topic /base_pose_ground_truth and it is coherent with what i see in rviz.
Any suggestion? Is it possible that the reason for this is that in Gazebo are taken into account some effects as friction, or gravity which aren't considered in rviz?