Strange behavior using ODE and lock motor option

Report crashes, strange behaviour, or apparent bugs
Post Reply
coruna
Posts: 2
Joined: 16 Nov 2020, 19:42

Strange behavior using ODE and lock motor option

Post by coruna »

To illustrate this I made a very simple robot with two wheels and a slider:
https://udcgal-my.sharepoint.com/:u:/g/ ... w?e=5y55N7

It has ODE engine and the "lock motor when target velocity is zero" checked. the left motor has 20 deg/s target velocity. if you start the simulation, the movement goes well. if you set the target velocity to 0, the motor locks, and then, if you set again any velocity to the joint, the robot goes crazy.
I think its a problem when unlocking because if i uncheck the "lock motor..." option everything is fine, but i need the motors to be immobile when i dont use it.
Is this a bug? or am I doing something wrong?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Strange behavior using ODE and lock motor option

Post by coppelia »

Indeed. There is something funny happening with the ODE engine. Other engines behave normally in that case. But also try to set your motor joints as position cyclic.

Maybe try the workaround to also programmatically reset the motor lock flag, via sim.setObjectInt32Parameter(jointHandle,sim.jointintparam_velocity_lock,lock).

Cheers

coruna
Posts: 2
Joined: 16 Nov 2020, 19:42

Re: Strange behavior using ODE and lock motor option

Post by coruna »

Thank you for the fast response.
Unfortunately, position cyclic don't solve the problem. Set int parameter effectively unlocks the motor, but subsequent motor operation is still strange.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Strange behavior using ODE and lock motor option

Post by coppelia »

This must be a glitch in the ODE engine... another option is to not lock the motor at all. But instead, when setting the target velocity to 0, also set a very large torque: that torque will act as internal friction.

Cheers

Post Reply