Mecanum wheels ok in one direction not the other in Gazebo
Hi all,
This looks like a problem of contacts simulation parameters... Let me give more details:
I am currently trying to emulate mecanum wheels using ros indigo and gazebo 2.2 thanks to a trick I found in the VREP implementation of the youbot (see here). They actually use the hierarchy shown below for a single wheel and update the direction of the axis of revolute joint 2 at each frame:
Hierarchy for a wheel:
- mobile platform base link
- continuous / revolute joint 1 (its axis is the axis of the wheel – or motor, this is the joint which is actuated)
- visual representation of the wheel (this is the mesh of the mecanum wheel)
- dummy collision and inertia
- continuous / revolute joint 2 (its axis is oriented at 45°, along the direction of the contacting roller and crosses the COM of the wheel)
- collision geometry (this is a collision sphere)
- continuous / revolute joint 1 (its axis is the axis of the wheel – or motor, this is the joint which is actuated)
I implemented this hierarchy for each wheel (urdf file here) and coded a gazebo plugin which performs the axis alignment computation (plugin code here). The system turns out to work ok when moving in the principal direction of the mobile robot (all mecanum wheels turn in the same direction), but when attempting to move sideways (2 opposite mecanum wheels rotating in one direction the two others in the opposite direction), the mobile robot moves as expected for a few frames but then goes back and forth in a way which is not realistic. It looks like a problem with contacts so I played a bit with the mu, kp and kd values of the link in contact with the floor but that did not help.
I have put some videos illustrating the working case when going frontwards (video here) and the problematic case when going sideways (video here). The simulations are stepped by hand to better show the problem.
On the second video (problematic case), the torque applied to the wheels is constant during the whole course of the simulation, hence the mobile movement should be sideways in the up direction. But we observe the wheels accelerate / slide before the mobile platform changes direction back and forth (up and down on the screen). This is very unintuitive.
If I replace the mecanum wheels with normal wheels, all is as expected. The orientation of wheel axes realigned at each step look fine from the printfs.
I am not sure what to do and feel a bit lost... Anyone has an idea of what I could change to improve things?
Thanks,
Antoine.