|
| | 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 | integrate (const RealVec &motor_w) |
| | Integrate the new state. It also uses error terms.
|
| |
| 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.
|
| |
| 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.
|
| |
| RealColVec3d | get_velocity () const |
| | Returns the current linear velocity (body frame)
|
| |
| RealColVec3d | get_angular_velocity () const |
| | Returns the current angular velocity (body frame)
|
| |
| RealColVec3d | get_euler_angles () const |
| | Returns the Euler angles (0: phi, 1: theta, 2:psi)
|
| |
| real_t | phi () const noexcept |
| | The phi Euler angle in rad.
|
| |
| real_t | theta () const noexcept |
| | The theta Euler angle in rad.
|
| |
| real_t | psi () const noexcept |
| | The psi Euler angle in rad.
|
| |
| virtual | ~MotionModelDynamicsBase ()=default |
| | Destructor.
|
| |
| virtual state_type & | evaluate (const input_type &input)=0 |
| | Updates and returns the value of the state given the input.
|
| |
| const state_type & | get_state () const |
| | Read access to the state.
|
| |
| state_type & | get_state () |
| | Read/write access to the state.
|
| |
| std::vector< std::string_view > | get_state_variables_names () const |
| | get_state_variables_names. Returns the name of the variables in the state
|
| |
| matrix_type & | get_matrix (const std::string &name) |
| |
| const matrix_type & | get_matrix (const std::string &name) const |
| |
| void | set_matrix (const std::string &name, const matrix_type &mat) |
| |
| vector_type & | get_vector (const std::string &name) |
| |
| const vector_type & | get_vector (const std::string &name) const |
| |
| void | set_vector (const std::string &name, const vector_type &vec) |
| |
| void | set_matrix_update_flag (bool f) |
| | set the matrix update flag
|
| |
| bool | allows_matrix_updates () const |
| | Set the flag for updating or not the matrices describing the model.
|
| |
| bool | has_matrix (const std::string &name) const |
| | Returns true if the matrix with the given name already exists.
|
| |
| real_t | get_state_property (const std::string &name) const |
| | Returns the state property with the given name.
|
| |
| void | set_state_property (const std::string &name, real_t value) |
| | Set the name-th value of the state.
|
| |
| void | set_state_name_value (uint_t i, const std::string &name, real_t val) |
| | Set the state names.
|
| |
| void | set_state_name_value (uint_t i, const std::pair< std::string, real_t > &val) |
| | Set the state names.
|
| |
| void | set_time_step (real_t dt) |
| | Set the time step.
|
| |
| real_t | get_time_step () const |
| | get_time_step Returns the sampling time the dynamics model is using
|
| |
| real_t | get_tolerance () const |
| | get_tolerance Returns the general tolerance used in the calculations
|
| |
| void | set_tolerance (real_t tol) |
| | set_tolerance Set the general tolerance used in the calculations. Default is KernelConsts::tolerance()
|
| |
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