It appears to me that simSetJointTargetVelocity is not working correctly..
The first time I use it in a script it works fine, but when a condition changes, I want to change the velocity again, and then it doesn't work..
if(active == 1) then
simSetJointTargetVelocity(simGetObjectAssociatedWithScript(sim_handle_self),-0.4)
else
simSetJointTargetVelocity(simGetObjectAssociatedWithScript(sim_handle_self),0)
end
What mode is your joint in? Probably in force/torque mode, with the motor enabled AND the position control disabled.
In that case, the joint will try to reach the specified velocity, given the max. torque it can exert. If the max. torque is too small, the velocity will never be reached. Also, if you specify a velocity of 0, it will simply disable the motor, and slowly slow down (it slows down much faster if the max. torque specified is high). This is specific to the physics engines.
When the joint is in velocity mode, it is not regulated! (unlike the PID position control)
I notice now that if I set the target velocity through scripting first to zero, then to -8, it ends up at 0.45 (as I can see in the dynamics dialog that I leave open)..