Can force/torque control of joint achieve positive and negative motion during one control loop?
-
- Posts: 38
- Joined: 23 Jan 2018, 16:16
Can force/torque control of joint achieve positive and negative motion during one control loop?
In this tutorial, I set a sin function to define a joint force control. But it only move in one direction, so if I do not change target velocity, do you have method to move joint in two direction during one control loop? https://github.com/feig122/force_test
Re: Can force/torque control of joint achieve positive and negative motion during one control loop?
Hello,
you can only set the amplitude of the force/torque. The sign is set via the joint target velocity. So set following:
Cheers
you can only set the amplitude of the force/torque. The sign is set via the joint target velocity. So set following:
Code: Select all
sim.setJointForce(handle,math.abs(f))
if f~=0 then
sim.setJointTargetVelocity(handle,math.abs(vel)*f/math.abs(f))
end
-
- Posts: 38
- Joined: 23 Jan 2018, 16:16
Re: Can force/torque control of joint achieve positive and negative motion during one control loop?
Thanks for your brilliant tutorial, which helps me a big deal!coppelia wrote: ↑07 Nov 2018, 08:02 Hello,
you can only set the amplitude of the force/torque. The sign is set via the joint target velocity. So set following:
CheersCode: Select all
sim.setJointForce(handle,math.abs(f)) if f~=0 then sim.setJointTargetVelocity(handle,math.abs(vel)*f/math.abs(f)) end