Page 1 of 1

Strange behavior using ODE and lock motor option

Posted: 17 Nov 2020, 13:07
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?

Re: Strange behavior using ODE and lock motor option

Posted: 17 Nov 2020, 14:08
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

Re: Strange behavior using ODE and lock motor option

Posted: 19 Nov 2020, 01:25
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.

Re: Strange behavior using ODE and lock motor option

Posted: 20 Nov 2020, 15:37
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