Hello,
It would be good to add a function that applies the desired amount of torque directly to a joint, even negative or positive torque.
Torque Control
Re: Torque Control
Hello,
from CoppeliaSim V4.3.0.rev4 on, you will be able to use sim.setJointTargetForce, which accepts a signed value
Cheers
from CoppeliaSim V4.3.0.rev4 on, you will be able to use sim.setJointTargetForce, which accepts a signed value
Cheers
Re: Torque Control
When will V4.3.0.rev4 be released?
Re: Torque Control
Not sure...
But you can use the following function as a workaround in the mean time:
Cheers
But you can use the following function as a workaround in the mean time:
Code: Select all
function sim.setJointTargetForce(jointHandle,forceOrTorque)
local v=sim.getJointTargetVelocity()
if v*forceOrTorque<0 then
sim.setJointTargetVelocity(-v)
end
sim.setJointMaxForce(jointHandle,math.abs(forceOrTorque))
end