Class QuadrotorDynamics¶
Defined in File quadrotor_dynamics.h
Inheritance Relationships¶
Base Type¶
public bitrl::dynamics::MotionModelDynamicsBase< SysState< 12 >, DynamicsMatrixDescriptor, RealVec >(Template Class MotionModelDynamicsBase)
Class Documentation¶
-
class QuadrotorDynamics : public bitrl::dynamics::MotionModelDynamicsBase<SysState<12>, DynamicsMatrixDescriptor, RealVec>¶
The QuadrotorDynamics class. Implements quadrotor dynamics The implementation of this class follows the System Modeling section at https://wilselby.com/research/arducopter/modeling/ and https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=2324&context=facpub The quadrotor is assumed to have four rotors Each rotor consists of a brushless DC motor and rotor with a fixed pitch. It is assumed that the quadrotor can move in 6 degrees of freedom; 3-translational and 3-rotational, The motion of the quadrotor is controlled via 4 inputs namely the speeds of the 4 motors. The quadrotor model that this class implements assumes the following:
The quadrotor structure is rigid and symmetrical with a center of mass aligned with the center of the body frame of the vehicle.
The thrust and drag of each motor is proportional to the square of the motor velocity.
The propellers are considered to be rigid and therefore blade flapping is negligible (deformation of propeller blades due to high velocities and flexible material).
The Earth is flat and non-rotating (difference of gravity by altitude or the spin of the earth is negligible)
Surrounding fluid velocities (wind) are negligible.
Ground effect is negligible
The class integrates the translational and rotational dynamics equations on the body frame
Public Types
-
typedef MotionModelDynamicsBase<SysState<12>, DynamicsMatrixDescriptor, RealVec> base_type¶
Public Functions
-
QuadrotorDynamics(QuadrotorDynamicsConfig config, SysState<12> &state)¶
QuadrotorDynamics Constructor. Specify the configuration parameters of the simulated quadrotor. It is assumed that the mass of the quadrotor remains fixed and the system state to be tracked.
-
virtual state_type &evaluate(const input_type &input) override¶
Evaluate the new state using the given input it also updates the various matrices if needed.
-
void translational_dynamics(const RealVec &motor_w)¶
Implements the translational dynamics. It accepts the motors angular velocities. Notice that this model will squared and input velocities.
-
void rotational_dynamics(const RealVec &motor_w)¶
Implements the translational dynamics. It accepts the motors angular velocities. Notice that this model will squared and input velocities.
-
inline RealColVec3d get_position() const¶
Returns the current position NED frame. Note that the z-coordinate has to be multiplied with -1 in order to represent an upwards looking z-axis.
-
inline RealColVec3d get_velocity() const¶
Returns the current linear velocity (body frame)
-
inline RealColVec3d get_angular_velocity() const¶
Returns the current angular velocity (body frame)
-
inline RealColVec3d get_euler_angles() const¶
Returns the Euler angles (0: phi, 1: theta, 2:psi)