1- Manually compute the capsulate's center, its mass, and express them plus the gravity vector in the sensor's frame.
2- adding an anti-gravity force using sim.addForce.
As the robot moves, it appears the first solution is not suitable. How can I use the second option? Are there other solutions considering I'm controlling the robot using kinematic control schemes?
For the second option, I did
Code: Select all
function sysCall_sensing()
local cap = sim.getObjectPosition(capsuleHandle,sim.handle_world)
sim.addForce(CapsuleHandle,cap,{0,0,0.06*9.81})
end
I'm using CoppeliaSim 4.5.1 Ubuntu 18.04.