gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.2k stars 484 forks source link

Problems migrating plugin from Gazebo 1.5 to Gazebo 1.8.6 #744

Closed osrf-migration closed 11 years ago

osrf-migration commented 11 years ago

Original report (archived issue) by Piyush Khandelwal (Bitbucket: piyushk).


Crossposted from here: https://github.com/osrf/gazebo_ros_pkgs/issues/21

I have a simple differential drive plugin here based on the original differential drive plugin from the erratic_robot package: https://github.com/utexas-bwi/segbot_simulator/blob/master/segbot_gazebo_plugins/src/diff_drive_plugin.cc

This works as expected with simulator_gazebo-1.7.12 (Gazebo 1.5), but GetWorldPose() seems to be returning ~0 for position with gazebo_ros_pkgs (Gazebo 1.8.6). The position does not change even slightly over time, and the orientation changes somewhat arbitrarily. On the other hand the world linear and angular velocities are correct (but incorrectly transform to base_footprint as the orientation is arbitrary)

pose: 
  pose: 
    position: 
      x: 6.91499350184e-310
      y: 6.91499350199e-310
      z: 0.0

On the other hand /gazebo/get_model/state seems to be returning the correct value. Since it uses the getWorldPose under the hood, I am not sure what the difference is.

Please let me know if I should provide additional information to help debug this issue.

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


thanks, can you post some outputs from

rostopic echo [odom topic]

and corresponding /gazebo/get_model/state values?

osrf-migration commented 11 years ago

Original comment by Piyush Khandelwal (Bitbucket: piyushk).


ROS Topic odom:

piyushk@zoidberg:~$ rostopic echo /odom
header: 
  seq: 21243
  stamp: 
    secs: 212
    nsecs: 441000000
  frame_id: /odom
child_frame_id: /base_footprint
pose: 
  pose: 
    position: 
      x: 6.92722248306e-310
      y: 6.92722248321e-310
      z: 0.0
    orientation: 
      x: -0.00100075127625
      y: 0.998628746809
      z: -0.00191169195727
      w: -3.4671868411
  covariance: [1e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001]
twist: 
  twist: 
    linear: 
      x: -0.504752338843
      y: -0.0520209696275
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: -0.0043761209763
  covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

ROS Service /gazebo/get_model_state

piyushk@zoidberg:~$ rosservice call /gazebo/get_model_state "{model_name: segbot}"
pose: 
  position: 
    x: -9.90145649593
    y: -2.21403976305
    z: -0.000820510682311
  orientation: 
    x: 0.00116187674364
    y: 0.000717795165849
    z: 0.0478064553254
    w: 0.998855684091
twist: 
  linear: 
    x: -0.498033337368
    y: -0.0443412969935
    z: -0.0108646809596
  angular: 
    x: 0.14988616863
    y: -0.0502772798217
    z: 0.00370784512397
success: True
status_message: GetModelState: got properties

Additionally, I should mention that I have not removed ros-groovy-simulator-gazebo. As far as I can see, this should not make a difference. Let me know if you think otherwise.

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


Just noting location of the segbot_description.

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


@piyushk,

Probably safer to uninstall ros-groovy-simulator-gazebo and recompile plugins from scratch, then try running simulation again. Though unlikely, it is possible version conflicts between different gazebo versions could lead to strange behaviors such as this issue.

For sanity check, can you confirm if the basic model plugin tutorial works with your install of gazeebo & gazebo_ros_pkg?

osrf-migration commented 11 years ago

Original comment by Piyush Khandelwal (Bitbucket: piyushk).


@hsu You were correct. After removing ros-groovy-simulator-gazebo, I immediately found 2 errors with my configuration (both attributed to user error :():

After fixing both these errors and verifying that the plugin ran correctly with gazebo_ros_pkgs, I reinstalled ros-groovy-simulator-gazebo. Everything continued to work correctly (as expected originally). I guess it is just safer removing ros-groovy-simulator-gazebo to make sure nothing is missed during migration.

I found one issue after successful migration of diff_drive_plugin.cc. Another plugin in the package gazebo_ros_video.cc did not compile:

In file included from /usr/include/gazebo-1.8/gazebo/rendering/GUIOverlay.hh:25:0,
                 from /usr/include/gazebo-1.8/gazebo/rendering/rendering.hh:15,
                 from /nishome/piyushk/navigation_ros/rosbuild_ws/segbot_simulator/segbot_gazebo_plugins/include/segbot_gazebo_plugins/gazebo_ros_video.h:37,
                 from /nishome/piyushk/navigation_ros/rosbuild_ws/segbot_simulator/segbot_gazebo_plugins/src/gazebo_ros_video.cc:28:
/usr/include/gazebo-1.8/gazebo/rendering/cegui.h:26:25: fatal error: CEGUI/CEGUI.h: No such file or directory

I have the following questions (which I guess are still relevant to the original bug report title):

Thanks for spending time on this!

osrf-migration commented 11 years ago

Original comment by Piyush Khandelwal (Bitbucket: piyushk).


@hsu The new Gazebo ROS release ships with a pre-compiled version of CEGUI. This problem no longer exists, and all my plugins compile correctly. I am closing this ticket, please reopen as necessary.

osrf-migration commented 11 years ago

Original comment by Piyush Khandelwal (Bitbucket: piyushk).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).