1#ifndef BITSIM_DYNAMICS_CART_POLE_DYNAMICS_H
2#define BITSIM_DYNAMICS_CART_POLE_DYNAMICS_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
CartPoleState & state() noexcept
Definition cart_pole_dynamics.h:107
const CartPoleParameters & parameters() const noexcept
Definition cart_pole_dynamics.h:108
bool off_track() const
Definition cart_pole_dynamics.cpp:93
CartPoleDynamics(const CartPoleParameters ¶meters=CartPoleParameters(), const CartPoleState &state=CartPoleState::Zero())
Definition cart_pole_dynamics.cpp:12
CartPoleLinearModel linearise(const CartPoleState &x=CartPoleState::Zero(), real_t force=0.0) const
Definition cart_pole_dynamics.cpp:59
real_t time() const noexcept
Definition cart_pole_dynamics.h:109
real_t energy(const CartPoleState &x) const
Definition cart_pole_dynamics.cpp:75
CartPoleState derivative(const CartPoleState &x, real_t force) const
Definition cart_pole_dynamics.cpp:23
real_t limit(real_t force) const
Definition cart_pole_dynamics.cpp:43
void step(real_t force, real_t dt)
Advance by dt [s], with the force F [N] held over the step.
Definition cart_pole_dynamics.cpp:48
const CartPoleState & state() const noexcept
Definition cart_pole_dynamics.h:106
Where each value is in a CartPoleState.
Definition cart_pole_dynamics.h:33
constexpr int THETA_DOT
Definition cart_pole_dynamics.h:37
constexpr int X_DOT
Definition cart_pole_dynamics.h:35
constexpr int THETA
Definition cart_pole_dynamics.h:36
constexpr int X
Definition cart_pole_dynamics.h:34
Models of how things move: wheeled robots, a bicycle, a quadrotor and a fixed wing aircraft,...
Definition bicycle_vehicle_model_dynamics.cpp:10
RealColVec4d CartPoleState
The state: the position of the cart [m], its velocity [m/s], the angle of the pole from upright [rad]...
Definition cart_pole_dynamics.h:29
Definition dc_motor_backend_base.h:9
Eigen::Vector4d RealColVec4d
4D column vector
Definition bitsim_types.h:142
double real_t
real_t
Definition bitsim_types.h:20
Eigen::Matrix4< real_t > RealMat4d
4×4 matrix of type double.
Definition bitsim_types.h:91
A model linearised about a state and a force: , for the deviations from them.
Definition cart_pole_dynamics.h:45
RealMat4d A
Definition cart_pole_dynamics.h:46
RealColVec4d B
Definition cart_pole_dynamics.h:47
The cart and the pole. The defaults are those of the classic cart-pole of Barto, Sutton and Anderson ...
Definition cart_pole_dynamics.h:18
real_t gravity
[m/s^2]
Definition cart_pole_dynamics.h:22
real_t track_half_length
the cart must stay within this of the centre [m]
Definition cart_pole_dynamics.h:24
real_t cart_mass
[kg]
Definition cart_pole_dynamics.h:19
real_t pole_half_length
from the pivot to the centre of the pole [m]
Definition cart_pole_dynamics.h:21
real_t pole_mass
[kg]
Definition cart_pole_dynamics.h:20
real_t max_force
the largest push on the cart, either way [N]
Definition cart_pole_dynamics.h:23