I set the motor to output a positive force of 350 Newtons at the beginning of the simulation, but why the actual output force is opposite ?
the force output code as following:
Code: Select all
function fnTorqOutput(hTargetMotorHandle,dTargetTorq)
if dTargetTorq<0.0 then
vel=-99999
torq=-dTargetTorq
else
vel=99999
torq=dTargetTorq
end
sim.setJointMaxForce(hTargetMotorHandle,torq)
sim.setJointTargetVelocity(hTargetMotorHandle,vel)
Code: Select all
function FsmFlight()
print("fsm:Flight")
-- take the slider to ZERO position in Flight phase
local dTargPos3=-0.1
local targetTorq3=350 --fnSliderTorqueInPosCtrl(dTargPos3)
print(targetTorq3)
fnTorqOutput(hMotorHandle[3],targetTorq3)
-- adjust the attitude of body
--
end