uos/diffdrive_gazebo_plugin

joint->GetVelocity returns NaN in melodic

Opened this issue · 4 comments

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.

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.

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

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. :(