bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
fixed_wing_lqr_mpc.cpp File Reference
#include "bitsim/bitsim_config.h"
#include "bitsim/bitsim_types.h"
#include "bitsim/control/fixed_wing_autopilot.h"
#include "bitsim/control/linear_mpc.h"
#include "bitsim/control/lqr.h"
#include "bitsim/dynamics/fixed_wing_dynamics.h"
#include "bitsim/dynamics/fixed_wing_trim.h"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <array>
#include <cmath>
#include <cstdio>
#include <filesystem>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
Include dependency graph for fixed_wing_lqr_mpc.cpp:

Classes

struct  fixed_wing_lqr_mpc::Track
struct  fixed_wing_lqr_mpc::FixedWingControls
 What the pilot or the autopilot sets. More...
class  fixed_wing_lqr_mpc::FixedWingDynamics
 The 6-DOF flight dynamics of a fixed wing aircraft, with its landing gear on a flat ground at down = 0. More...
struct  fixed_wing_lqr_mpc::FixedWingParameters
 The aircraft: its mass, its geometry, its aerodynamic coefficients, its propeller and motor, and its landing gear. aerosonde() gives the small UAV of Beard and McLain. More...

Namespaces

namespace  fixed_wing_lqr_mpc

Typedefs

using fixed_wing_lqr_mpc::index_t
 The type Eigen indexes and sizes matrices and vectors with.
using fixed_wing_lqr_mpc::real_t
 real_t
using fixed_wing_lqr_mpc::uint_t
 uint_t
using fixed_wing_lqr_mpc::Matrix
 The matrices of the linear models and the controllers.
using fixed_wing_lqr_mpc::Vector
 The vectors of the linear models and the controllers: states, inputs.

Functions

Vector fixed_wing_lqr_mpc::controls_vector (const FixedWingControls &c)
FixedWingControls fixed_wing_lqr_mpc::to_controls (const Vector &u)
Vector fixed_wing_lqr_mpc::deviation (const FixedWingDynamics &aircraft, const bitsim::dynamics::FixedWingTrim &trim, real_t heading_ref, real_t altitude_ref)
void fixed_wing_lqr_mpc::record_track (Track &track, const FixedWingDynamics &a)
cv::Mat fixed_wing_lqr_mpc::draw (const std::vector< Track > &tracks, uint_t k, real_t sample_period)
void fixed_wing_lqr_mpc::record (const std::vector< Track > &tracks, const std::string &directory, real_t sample_period)
int main (int argc, char **argv)

Variables

const real_t fixed_wing_lqr_mpc::PI = 3.14159265358979323846
const real_t fixed_wing_lqr_mpc::DEG = PI / 180.0
const real_t fixed_wing_lqr_mpc::STEP = 0.01
const real_t fixed_wing_lqr_mpc::CONTROL_PERIOD = 0.05
const real_t fixed_wing_lqr_mpc::AIRSPEED = 25.0
const real_t fixed_wing_lqr_mpc::ALTITUDE = 100.0
const real_t fixed_wing_lqr_mpc::TURN_AT = 5.0
const real_t fixed_wing_lqr_mpc::CLIMB_AT = 30.0
const real_t fixed_wing_lqr_mpc::DURATION = 60.0
const uint_t fixed_wing_lqr_mpc::HORIZON = 60
const real_t fixed_wing_lqr_mpc::MAX_BANK = 25.0 * DEG
const real_t fixed_wing_lqr_mpc::MAX_PITCH = 15.0 * DEG
const real_t fixed_wing_lqr_mpc::PENALTY = 2.0e4
const real_t fixed_wing_lqr_mpc::RECORD_RATE = 10.0
const std::array< int, 10 > fixed_wing_lqr_mpc::STATES
const std::array< cv::Scalar, 3 > fixed_wing_lqr_mpc::COLOURS

Function Documentation

◆ main()

int main ( int argc,
char ** argv )