I am attempting to simulate applying external force to the end-effector of UR3 robot. For this task, I've employed the sim.addForceAndTorque function, and applied the torque specifically to the z-axis of the robot's last link, all the while keeping the robot in the position dynamic mode.
However, I've encountered an intriguing phenomenon for which I can't figure out the cause. When I set the torque value to 10, the robot begins to revolve at a consistent angular speed. However, if the value is less than 10, the robot remains stationary, whereas, when the value is greater than 10, the robot's speed of revolution increases progressively. I am wondering about the physics settings underlying this behaviour. And does this phenomenon mirror the real-world scenarios?
I have attached the script I used in the child script. Looking for an explanation. Thank you very much.
Kind regards,
Boyu
Code: Select all
function sysCall_init()
connectionHandle = sim.getObject('/UR3/connection')
link6Handle = sim.getObject('/UR3/link6')
end
function sysCall_cleanup()
end
function sysCall_actuation()
local force = {0, 0, 0}
local torque = {0, 0, 10}
sim.addForceAndTorque(link6Handle, force, torque)
-- Get the force sensor measurements
local result, forceVector, torqueVector = sim.readForceSensor(connectionHandle)
if result > 0 then
print("Force: ", table.unpack(forceVector))
print("Torque: ", table.unpack(torqueVector))
else
print('No contact force')
end
end