get force/torque sensor values
Posted: 28 Jul 2019, 10:00
Hi,
I want to display the f/torque sensor value in the status bar message.
However, when I run the program, I always get the result value "res" = 1 which means that the sensor is broken ( the breaking settings is not selected)
I verified the conditions mentioned here http://www.coppeliarobotics.com/helpFil ... ations.htm , and I even tried the second solution ( Dummy-dummy link) but res still = 1
Any help would be appreciated.
project link : https://drive.google.com/file/d/175D8E8 ... sp=sharing
I want to display the f/torque sensor value in the status bar message.
Code: Select all
force={-1,-1,-1}
torque={-1,-1,-1}
HEX_Force_sensor = sim.getObjectHandle('HEX_Force_sensor')
Cube = sim.getObjectHandle('Cube')
--the cube must be non-static shape
sim.setObjectInt32Parameter(Cube,3003,0)
while true do
res,force,torque=sim.readForceSensor(HEX_Force_sensor)
sim.wait (1)
sim.addStatusbarMessage(res)
if res== -1 then
sim.addStatusbarMessage('force/torque sensor error')
elseif res == 1 then
sim.addStatusbarMessage('force sensor is broken')
else
sim.addStatusbarMessage('Fx = '..force[1]..' Fy = '..force[2].. ' Fz = '..force[3]..' Tx = '..torque[1]..' Ty = '..torque[2]..' Tz = '..torque[3])
end
end
I verified the conditions mentioned here http://www.coppeliarobotics.com/helpFil ... ations.htm , and I even tried the second solution ( Dummy-dummy link) but res still = 1
Any help would be appreciated.
project link : https://drive.google.com/file/d/175D8E8 ... sp=sharing