I'm working on a project to, land quadcopter correctly when it is facing to disturbances at landing time. I choose CoppeliaSim to simulate my project. I want to know that how do I reconstruct the quadcopter lua code in CoppeliaSim.
I mean, I want to program quadcopter,
using my own controller (PID, H Infinity, Sliding mode controller etc.)
use basic equations of quadcopter dynamics in research papers.
best is to use a simple model of a rigid quadcopter. The simplest would be to use a 4 cylinders (inside of a compound shape) representing your 4 propellers.
Then, there are a few API functions that you will have to use:
sim.addForceAndTorque (applying a force and/or torque about the center of mass). To emulate lift, drag, etc.
sim.addForce (applying a force at a specific position on a shape). To emulate drag, etc.
sim.getObjectVelocity (needed if you want to emulate drag)
Keep in mind that when adding a force/torque, you'll have to do that in each simulation step.