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

Classes

struct  Path
struct  LinearStep
class  Follower
class  World
class  Display
struct  Options
class  LinearMPC
 Model predictive control with a linear model, a quadratic cost and bounds on the inputs and the states. More...
class  CHRONO_DiffDriveRobot
 A differential-drive robot in Chrono: a chassis, two driven wheels and a ball caster. Each driven wheel has an actuators::DCMotor. More...

Typedefs

using real_t
 real_t
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

real_t near (real_t angle, real_t reference)
Vector model_step (const Vector &x, const Vector &u, real_t axle)
LinearStep linearise (const Vector &x, const Vector &u, real_t axle)
real_t distance_to_path (const Path &path, const Vector &x)
int run (const Options &options)

Variables

const real_t PI = bitsim::consts::maths::PI
const std::string ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json"
const real_t STEP_SIZE = 0.005
const real_t CONTROL_PERIOD = 0.05
const uint_t HORIZON = 20
const real_t MAX_WHEEL_SPEED = 0.8
const real_t TAU = 0.4
const real_t LAP_TIME = 11.0
const real_t SETTLE = 4.0
const real_t SEPARATION = 3.6
const real_t PRINT_PERIOD = 2.0
const real_t RENDER_RATE = 30.0
const real_t RECORD_RATE = 10.0

Typedef Documentation

◆ Matrix

The matrices of the linear models and the controllers.

◆ real_t

◆ uint_t

◆ Vector

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

Function Documentation

◆ distance_to_path()

real_t diff_drive_mpc::distance_to_path ( const Path & path,
const Vector & x )

◆ linearise()

LinearStep diff_drive_mpc::linearise ( const Vector & x,
const Vector & u,
real_t axle )

◆ model_step()

Vector diff_drive_mpc::model_step ( const Vector & x,
const Vector & u,
real_t axle )

◆ near()

real_t diff_drive_mpc::near ( real_t angle,
real_t reference )

◆ run()

int diff_drive_mpc::run ( const Options & options)

Variable Documentation

◆ CONTROL_PERIOD

const real_t diff_drive_mpc::CONTROL_PERIOD = 0.05

◆ HORIZON

const uint_t diff_drive_mpc::HORIZON = 20

◆ LAP_TIME

const real_t diff_drive_mpc::LAP_TIME = 11.0

◆ MAX_WHEEL_SPEED

const real_t diff_drive_mpc::MAX_WHEEL_SPEED = 0.8

◆ PI

const real_t diff_drive_mpc::PI = bitsim::consts::maths::PI

◆ PRINT_PERIOD

const real_t diff_drive_mpc::PRINT_PERIOD = 2.0

◆ RECORD_RATE

const real_t diff_drive_mpc::RECORD_RATE = 10.0

◆ RENDER_RATE

const real_t diff_drive_mpc::RENDER_RATE = 30.0

◆ ROBOT_FILE

const std::string diff_drive_mpc::ROBOT_FILE = bitsim::consts::ROBOTS_DIR + "/bitsim_diff_drive_robot.json"

◆ SEPARATION

const real_t diff_drive_mpc::SEPARATION = 3.6

◆ SETTLE

const real_t diff_drive_mpc::SETTLE = 4.0

◆ STEP_SIZE

const real_t diff_drive_mpc::STEP_SIZE = 0.005

◆ TAU

const real_t diff_drive_mpc::TAU = 0.4