## Strange behavior using ODE and lock motor option

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

### Strange behavior using ODE and lock motor option

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
Posts: 8371
Joined: 14 Dec 2012, 00:25

### Re: Strange behavior using ODE and lock motor option

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

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