Hello,
I'm trying to make a drone that I have modelled lift off the ground to a certain altitude. I understand that it can be done by using sim.addForceandTorque. However, it either is stuck to the ground or it is flying off to the sky very fast while flipping off and going all over the place. Can someone explain how simulating lift off works and maybe give a python example if possible? This is my code:
sim.addForceAndTorque(self.drone, [0,0,1], [0,0,0])
Simulating Drone Lift Off
Re: Simulating Drone Lift Off
That approach works fine for me.
Once the gravity force has been balanced, it is sufficient a very tiny force to have an object lift off, considering you are applying that force constantly (i.e. on every step, in e.g. sysCall_actuation)
Once the gravity force has been balanced, it is sufficient a very tiny force to have an object lift off, considering you are applying that force constantly (i.e. on every step, in e.g. sysCall_actuation)
Code: Select all
local self = sim.getObject '.'
local m = sim.getShapeMass(self)
local g = sim.getArrayParam(sim.arrayparam_gravity)
sim.addForceAndTorque(self, {m * -g[1], m * -g[2], m * -g[3] + 0.000001}, {0, 0, 0})