Class jalansim::dynamics::Dynamics
template <typename T, class Model>
ClassList > jalansim > dynamics > Dynamics
Generic dynamics simulation class. More...
#include <dynamics.hpp>
Public Attributes
Type | Name |
---|---|
Model | model Dynamics model instance. |
T | x = {} Current state vector. |
Public Static Attributes
Type | Name |
---|---|
std::size_t | INPUT_DIM = Model::INPUT\_DIM Dimension of input vector. |
std::size_t | STATE_DIM = Model::STATE\_DIM Dimension of state vector. |
Public Functions
Type | Name |
---|---|
JALANSIM_HOST_DEVICE T | get_theta () const Get orientation angle (assumes state[2] is theta). |
JALANSIM_HOST_DEVICE T | get_x () const Get X coordinate (assumes state[0] is X position). |
JALANSIM_HOST_DEVICE T | get_y () const Get Y coordinate (assumes state[1] is Y position). |
JALANSIM_HOST_DEVICE void | reset () Reset the system to its initial state. |
JALANSIM_HOST_DEVICE void | step (const T * u, T dt, Scheme s=Scheme::RK4) Advance the system state by one time step. |
Detailed Description
Manages the state evolution of a dynamical system using configurable integration schemes. Wraps a dynamics model and provides numerical integration methods (Euler, RK4) to advance the system state over time. Assumes the first three state variables are [x, y, theta] for 2D systems.
Template parameters:
T
Numeric type (float, double)Model
Dynamics model class defining state evolution
Public Attributes Documentation
variable model
Dynamics model instance.
Model jalansim::dynamics::Dynamics< T, Model >::model;
variable x
Current state vector.
T jalansim::dynamics::Dynamics< T, Model >::x[STATE_DIM];
Public Static Attributes Documentation
variable INPUT_DIM
Dimension of input vector.
std::size_t jalansim::dynamics::Dynamics< T, Model >::INPUT_DIM;
variable STATE_DIM
Dimension of state vector.
std::size_t jalansim::dynamics::Dynamics< T, Model >::STATE_DIM;
Public Functions Documentation
function get_theta
Get orientation angle (assumes state[2] is theta).
inline JALANSIM_HOST_DEVICE T jalansim::dynamics::Dynamics::get_theta () const
Returns:
Current orientation angle in radians
function get_x
Get X coordinate (assumes state[0] is X position).
inline JALANSIM_HOST_DEVICE T jalansim::dynamics::Dynamics::get_x () const
Returns:
Current X coordinate
function get_y
Get Y coordinate (assumes state[1] is Y position).
inline JALANSIM_HOST_DEVICE T jalansim::dynamics::Dynamics::get_y () const
Returns:
Current Y coordinate
function reset
Reset the system to its initial state.
inline JALANSIM_HOST_DEVICE void jalansim::dynamics::Dynamics::reset ()
Sets all state variables to zero and calls the model's reset method. Used to reinitialize the system for new simulations.
function step
Advance the system state by one time step.
inline JALANSIM_HOST_DEVICE void jalansim::dynamics::Dynamics::step (
const T * u,
T dt,
Scheme s=Scheme::RK4
)
Parameters:
u
Input/control vectordt
Time step sizes
Integration scheme to use (default: RK4)
The documentation for this class was generated from the following file include/jalansim/dynamics/dynamics.hpp