# Mecanum simulation possible using directional friction?

I've been following with interest the evolving story for how to simulate mecanum wheels in Gazebo— planar move, fake casters, etc.

However, it was recently pointed out to me that it may be possible to do a pretty accurate simulation of a mecanum wheel using a single cylinder with directional friction on the circumference. Is this a realistic possibility? Is there a good example of this somewhere to experiment with? The idea of using a pure-SDF solution without needing a custom plugin for this robot is extremely appealing, if it's possible.

Thanks for any pointers or thoughts.

Edit: These are the mecanum wheels in my project: http://www.andymark.com/product-p/am-0137.htm

edit retag close merge delete

Sort by » oldest newest most voted

In my first answer, I didn't understand your proposal exactly. Now I see that you're suggesting to model the entire wheel as a single cylinder and set directional friction properties to simulate the mecanum wheel rollers.

ODE supports two friction coefficients (mu and mu2 in sdformat in this tutorial) with a pyramid friction model. The friction directions corresponding to each coefficient are computed to be orthogonal to each other and the contact normal unit vector. If the fdir1 parameter is not set, then the first friction direction is computed from the component of the global X axis that is orthogonal to the unit normal. The second friction direction is then computed to be mutually orthogonal with a vector cross product. In the case where objects are contacting a ground plane normal to the Z axis, then the X and Y axes are the first and second friction directions respectively.

If the fdir1 parameter is set to a non-zero vector, then that vector is interpreted as the desired first friction direction in the body-fixed Link frame of the object. This makes it challenging to model mecanum wheels, since the link frame will be rotating as the wheel spins. It would be better to define the friction direction relative to the wheel carrier (spindle). This would require a modification to gazebo, but it sounds like it would be useful.

Did that make sense?

more

Yes, and that was my primary concern— that it would be impossible to maintain the orientation of the friction within a moving contact patch. Unfortunately, this platform's simulator needs to work with ROS Jade's Gazebo for sure, and probably Indigo's too, so that pretty much rules out any changes to the core (though such changes could be of benefit to future users).

How possible would it be to get this behaviour from a plugin, in your estimate?

( 2015-05-17 20:53:41 -0500 )edit

It would be much more elegant to simulate the wheels with pure contact, rather than a plugin fakeout, but I suspect it would also be slower. The whole accuracy vs. computational time trade-off.

I have seen the issues posted before, but I've never found the time to really try making mecanum wheels in sdf; sounds like fun, though.

One issue that might come up is that the rollers are a bit tapered, not true cylinders. If gazebo supported ellipsoids, this might be a good application, not sure.

Do you have any data on the angles used and part sizes? I can try to help with hacking on something to see if it works well or not.

more

Certainly the "invisible hand" of planar move would be by far the cheapest computationally. But modelling the wheel as a single large cylinder with high friction in one 45deg and low friction in the other 45deg seems like it should be reasonably inexpensive. I hadn't been really seriously considering having Gazebo simulate the behaviour of the individual rollers, though I suppose that's conceivably possible as well.

( 2015-05-15 14:09:42 -0500 )edit

Oh, now I understand what you meant. This would be much simpler than modelling all the roller elements. I'll post another answer.

( 2015-05-15 14:53:33 -0500 )edit