Add gravity and thrust force
This commit is contained in:
parent
8f4d61f820
commit
8904c223cb
4 changed files with 67 additions and 3 deletions
20
cixdof/forces.h
Normal file
20
cixdof/forces.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef FORCES_H
|
||||
#define FORCES_H
|
||||
|
||||
#include "../mathprimitives/mathprimitives.h"
|
||||
#include "drone.h"
|
||||
|
||||
static const double G = 9.80665;
|
||||
|
||||
static inline struct Vec3 gravity(double mass) {
|
||||
return (struct Vec3){0, 0, mass * G};
|
||||
}
|
||||
|
||||
struct ThrustAndMoment {
|
||||
struct Vec3 thrust_inertial;
|
||||
struct Vec3 moment_body;
|
||||
};
|
||||
|
||||
struct ThrustAndMoment thrust(struct Quat attitude, struct Propeller *p);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue