|
bitsim
Model, simulate, estimate and control robots in C++
|
#include "bitsim/bitsim_config.h"#include "bitsim/bitsim_consts.h"#include "bitsim/bitsim_types.h"#include "bitsim/control/lqr.h"#include "bitsim/control/quadrotor_flight_controller.h"#include "bitsim/control/rc_command.h"#include "bitsim/dynamics/quadrotor_dynamics.h"#include "bitsim/dynamics/system_state.h"#include "bitsim/utils/render/quadrotor_view.h"#include <algorithm>#include <array>#include <chrono>#include <cmath>#include <cstdio>#include <iostream>#include <optional>#include <string>#include <thread>#include <vector>
Classes | |
| struct | quadrotor_lqr::Path |
| struct | quadrotor_lqr::Drone |
| struct | quadrotor_lqr::Options |
| class | quadrotor_lqr::QuadrotorFlightController |
| The flight controller of a toy quadrotor in angle mode: it turns the sticks of an RCCommand into rotor speeds. More... | |
| struct | quadrotor_lqr::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 | quadrotor_lqr::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 | quadrotor_lqr::QuadrotorDynamicsConfig |
| class | quadrotor_lqr::SysState< dim > |
| SysState utility class describing the state of a system. More... | |
Namespaces | |
| namespace | quadrotor_lqr |
Typedefs | |
| using | quadrotor_lqr::index_t |
| The type Eigen indexes and sizes matrices and vectors with. | |
| using | quadrotor_lqr::real_t |
| real_t | |
| using | quadrotor_lqr::RealColVec3d |
| 3D column vector | |
| using | quadrotor_lqr::RealMat3d |
| 3×3 matrix of type double. | |
| using | quadrotor_lqr::RealVec |
| double precision floating point vector | |
| using | quadrotor_lqr::uint_t |
| uint_t | |
| using | quadrotor_lqr::Matrix |
| The matrices of the linear models and the controllers. | |
| using | quadrotor_lqr::Vector |
| The vectors of the linear models and the controllers: states, inputs. | |
Functions | |
| QuadrotorDynamicsConfig | quadrotor_lqr::quadrotor_config () |
| SysState< 12 > | quadrotor_lqr::to_state (const Vector &x) |
| Vector | quadrotor_lqr::to_vector (const SysState< 12 > &state) |
| RealVec | quadrotor_lqr::mix (const QuadrotorDynamicsConfig &config, const Vector &u, real_t max_rotor_speed) |
| Vector | quadrotor_lqr::step (const QuadrotorDynamicsConfig &config, const Vector &x, const Vector &u, real_t max_rotor_speed) |
| bitsim::control::DiscreteLinearModel | quadrotor_lqr::linearise (const QuadrotorDynamicsConfig &config, const Vector &hover, const Vector &u_hover, real_t max_rotor_speed) |
| RealMat3d | quadrotor_lqr::body_to_world (real_t yaw, real_t pitch, real_t roll) |
| RCCommand | quadrotor_lqr::position_loop (const Drone &drone, const RealColVec3d &target, const RealColVec3d &target_velocity, const QuadrotorFlightController &controller) |
| int | quadrotor_lqr::run (const Options &options) |
| int | main (int argc, char **argv) |
Variables | |
| const real_t | quadrotor_lqr::G = bitsim::consts::maths::G |
| const real_t | quadrotor_lqr::STEP_SIZE = 0.001 |
| const real_t | quadrotor_lqr::CONTROL_PERIOD = 0.01 |
| const uint_t | quadrotor_lqr::SUB_STEPS = 10 |
| const real_t | quadrotor_lqr::SPEED = 1.0 |
| const real_t | quadrotor_lqr::START = 2.0 |
| const real_t | quadrotor_lqr::PUSH_AT = 22.0 |
| const real_t | quadrotor_lqr::PUSH = 2.0 |
| const real_t | quadrotor_lqr::DURATION = 28.0 |
| const real_t | quadrotor_lqr::SEPARATION = 2.5 |
| const real_t | quadrotor_lqr::PRINT_PERIOD = 2.0 |
| const real_t | quadrotor_lqr::RENDER_RATE = 30.0 |
| const real_t | quadrotor_lqr::RECORD_RATE = 10.0 |
| const std::array< const char *, 12 > | quadrotor_lqr::NAMES |
| int main | ( | int | argc, |
| char ** | argv ) |