uos / diffdrive_gazebo_plugin

http://www.ros.org/wiki/diffdrive_gazebo_plugin
7 stars 6 forks source link

joint->GetVelocity returns NaN in melodic #14

Open spuetz opened 5 years ago

spuetz commented 5 years ago

Hi @mintar, do you have any idea why the gazebo::physics::ODEHingeJoint returns NaN in the diffdrive gazebo plugin in melodic. I'm a bit stuck there.

mintar commented 5 years ago

Can you post instructions on how to reproduce?

I just spent half a day trying to reproduce this myself, and trying to figure out if it's the diffdrive_gazebo_plugin or something else. Here are the results:

  1. libgazebo_ros_diffdrive_uos.so on kinetic: doesn't work
  2. libgazebo_ros_diffdrive_uos.so on melodic: doesn't work
  3. diff_drive_controller on kinetic: works
  4. diff_drive_controller on melodic: works

"works" means: robot moves around, odom values look good "doesn't work" means: robot moves around, but odom values are incorrect (e.g., keep changing when robot is stopped or vice versa)

(1) and (2) use the volksbot_driver URDF.

For (3) and (4), I used the following commands:

sudo apt install ros-melodic-mir-robot
roslaunch mir_gazebo mir_maze_world.launch
rostopic echo /odom_comb
# move robot around using rqt_steering, observe that /odom_comb position values are correct

diff_drive_controller is from here.

There's also the option of using gazebo_ros_diff_drive with the MiR, but I haven't tested this yet.

Is this the issue you are seeing? I haven't dug down to the code, so I don't know if this bug is caused by some NaN values or not. Based on the results above it's not something that's specific to melodic, but our diffdrive_gazebo_plugin is broken on kinetic too.

mintar commented 5 years ago

I just tested the gazebo_ros_diff_drive (on kinetic), and it doesn't work. Same behavior as our libgazebo_ros_diffdrive_uos.so.

mintar commented 5 years ago

Maybe related? https://github.com/ros-simulation/gazebo_ros_pkgs/issues/908

mintar commented 5 years ago

BTW: The only reason why we need this package is that it supports more than two wheels. Something that would be really nice was if Gazebo supported "mirror joints", i.e., joints that are forced to always have the same joint values as some reference joint. Then we could drop this package altogether. Unfortunately, Gazebo doesn't support mirror joints. :(