bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
quadrotor_lqr Namespace Reference

Classes

struct  Path
struct  Drone
struct  Options
class  QuadrotorFlightController
 The flight controller of a toy quadrotor in angle mode: it turns the sticks of an RCCommand into rotor speeds. More...
struct  RCCommand
 What the sticks of a radio transmitter for a quadrotor say, as a toy drone's transmitter sends them: the throttle and three sticks, and whether the motors are armed. More...
class  QuadrotorDynamics
 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: More...
struct  QuadrotorDynamicsConfig
class  SysState
 SysState utility class describing the state of a system. More...

Typedefs

using index_t
 The type Eigen indexes and sizes matrices and vectors with.
using real_t
 real_t
using RealColVec3d
 3D column vector
using RealMat3d
 3×3 matrix of type double.
using RealVec
 double precision floating point vector
using uint_t
 uint_t
using Matrix
 The matrices of the linear models and the controllers.
using Vector
 The vectors of the linear models and the controllers: states, inputs.

Functions

QuadrotorDynamicsConfig quadrotor_config ()
SysState< 12 > to_state (const Vector &x)
Vector to_vector (const SysState< 12 > &state)
RealVec mix (const QuadrotorDynamicsConfig &config, const Vector &u, real_t max_rotor_speed)
Vector step (const QuadrotorDynamicsConfig &config, const Vector &x, const Vector &u, real_t max_rotor_speed)
bitsim::control::DiscreteLinearModel linearise (const QuadrotorDynamicsConfig &config, const Vector &hover, const Vector &u_hover, real_t max_rotor_speed)
RealMat3d body_to_world (real_t yaw, real_t pitch, real_t roll)
RCCommand position_loop (const Drone &drone, const RealColVec3d &target, const RealColVec3d &target_velocity, const QuadrotorFlightController &controller)
int run (const Options &options)

Variables

const real_t G = bitsim::consts::maths::G
const real_t STEP_SIZE = 0.001
const real_t CONTROL_PERIOD = 0.01
const uint_t SUB_STEPS = 10
const real_t SPEED = 1.0
const real_t START = 2.0
const real_t PUSH_AT = 22.0
const real_t PUSH = 2.0
const real_t DURATION = 28.0
const real_t SEPARATION = 2.5
const real_t PRINT_PERIOD = 2.0
const real_t RENDER_RATE = 30.0
const real_t RECORD_RATE = 10.0
const std::array< const char *, 12 > NAMES

Typedef Documentation

◆ index_t

The type Eigen indexes and sizes matrices and vectors with.

◆ Matrix

The matrices of the linear models and the controllers.

◆ real_t

◆ RealColVec3d

3D column vector

◆ RealMat3d

3×3 matrix of type double.

◆ RealVec

double precision floating point vector

◆ uint_t

◆ Vector

The vectors of the linear models and the controllers: states, inputs.

Function Documentation

◆ body_to_world()

RealMat3d quadrotor_lqr::body_to_world ( real_t yaw,
real_t pitch,
real_t roll )

◆ linearise()

bitsim::control::DiscreteLinearModel quadrotor_lqr::linearise ( const QuadrotorDynamicsConfig & config,
const Vector & hover,
const Vector & u_hover,
real_t max_rotor_speed )

◆ mix()

RealVec quadrotor_lqr::mix ( const QuadrotorDynamicsConfig & config,
const Vector & u,
real_t max_rotor_speed )

◆ position_loop()

RCCommand quadrotor_lqr::position_loop ( const Drone & drone,
const RealColVec3d & target,
const RealColVec3d & target_velocity,
const QuadrotorFlightController & controller )

◆ quadrotor_config()

QuadrotorDynamicsConfig quadrotor_lqr::quadrotor_config ( )

◆ run()

int quadrotor_lqr::run ( const Options & options)

◆ step()

Vector quadrotor_lqr::step ( const QuadrotorDynamicsConfig & config,
const Vector & x,
const Vector & u,
real_t max_rotor_speed )

◆ to_state()

SysState< 12 > quadrotor_lqr::to_state ( const Vector & x)

◆ to_vector()

Vector quadrotor_lqr::to_vector ( const SysState< 12 > & state)

Variable Documentation

◆ CONTROL_PERIOD

const real_t quadrotor_lqr::CONTROL_PERIOD = 0.01

◆ DURATION

const real_t quadrotor_lqr::DURATION = 28.0

◆ G

const real_t quadrotor_lqr::G = bitsim::consts::maths::G

◆ NAMES

const std::array<const char *, 12> quadrotor_lqr::NAMES
Initial value:
{"x", "y", "z", "u", "v", "w",
"p", "q", "r", "phi", "theta", "psi"}

◆ PRINT_PERIOD

const real_t quadrotor_lqr::PRINT_PERIOD = 2.0

◆ PUSH

const real_t quadrotor_lqr::PUSH = 2.0

◆ PUSH_AT

const real_t quadrotor_lqr::PUSH_AT = 22.0

◆ RECORD_RATE

const real_t quadrotor_lqr::RECORD_RATE = 10.0

◆ RENDER_RATE

const real_t quadrotor_lqr::RENDER_RATE = 30.0

◆ SEPARATION

const real_t quadrotor_lqr::SEPARATION = 2.5

◆ SPEED

const real_t quadrotor_lqr::SPEED = 1.0

◆ START

const real_t quadrotor_lqr::START = 2.0

◆ STEP_SIZE

const real_t quadrotor_lqr::STEP_SIZE = 0.001

◆ SUB_STEPS

const uint_t quadrotor_lqr::SUB_STEPS = 10