Struct jalansim::dynamics::models::DiffDriveTorque
template <typename T>
ClassList > jalansim > dynamics > models > DiffDriveTorque
Differential drive robot with torque-based control. More...
#include <diff_drive_torque.hpp>
Public Attributes
Type | Name |
---|---|
T | torque_max = T(50.0) Maximum wheel torque (N⋅m) |
T | torque_min = T(-50.0) Minimum wheel torque (N⋅m) |
T | w_max = T(20.4082) Maximum wheel angular velocity (rad/s) |
T | w_min = T(-20.4082) Minimum wheel angular velocity (rad/s) |
T | wheel_J = T(0.0024) Wheel moment of inertia (kg⋅m²) |
T | wheel_b = T(0.262) Wheelbase/track width (m) |
T | wheel_r = T(0.098) Wheel radius (m) |
Public Static Attributes
Type | Name |
---|---|
std::size_t | INPUT_DIM = 2 Input dimension: [torque_r, torque_l]. |
std::size_t | STATE_DIM = 5 State dimension: [x, y, theta, wr, wl]. |
Public Functions
Type | Name |
---|---|
JALANSIM_HOST_DEVICE void | reset () Reset the model to initial state. |
JALANSIM_HOST_DEVICE void | rhs (const T * x, const T * u, T * dx, T dt=T(0)) const Compute state derivatives with torque dynamics. |
Public Static Functions
Type | Name |
---|---|
JALANSIM_HOST_DEVICE T | clamp (T v, T lo, T hi) Clamp a value between lower and upper bounds. |
Detailed Description
Implements a more detailed differential drive model with wheel angular velocities as part of the state and torque inputs. Models wheel inertia and includes constraints on wheel angular velocities and input torques.
State: [x, y, theta, omega_right, omega_left] Input: [torque_right, torque_left]
Template parameters:
T
Numeric type (default: double)
Public Attributes Documentation
variable torque_max
Maximum wheel torque (N⋅m)
T jalansim::dynamics::models::DiffDriveTorque< T >::torque_max;
variable torque_min
Minimum wheel torque (N⋅m)
T jalansim::dynamics::models::DiffDriveTorque< T >::torque_min;
variable w_max
Maximum wheel angular velocity (rad/s)
T jalansim::dynamics::models::DiffDriveTorque< T >::w_max;
variable w_min
Minimum wheel angular velocity (rad/s)
T jalansim::dynamics::models::DiffDriveTorque< T >::w_min;
variable wheel_J
Wheel moment of inertia (kg⋅m²)
T jalansim::dynamics::models::DiffDriveTorque< T >::wheel_J;
variable wheel_b
Wheelbase/track width (m)
T jalansim::dynamics::models::DiffDriveTorque< T >::wheel_b;
variable wheel_r
Wheel radius (m)
T jalansim::dynamics::models::DiffDriveTorque< T >::wheel_r;
Public Static Attributes Documentation
variable INPUT_DIM
Input dimension: [torque_r, torque_l].
std::size_t jalansim::dynamics::models::DiffDriveTorque< T >::INPUT_DIM;
variable STATE_DIM
State dimension: [x, y, theta, wr, wl].
std::size_t jalansim::dynamics::models::DiffDriveTorque< T >::STATE_DIM;
Public Functions Documentation
function reset
Reset the model to initial state.
inline JALANSIM_HOST_DEVICE void jalansim::dynamics::models::DiffDriveTorque::reset ()
function rhs
Compute state derivatives with torque dynamics.
inline JALANSIM_HOST_DEVICE void jalansim::dynamics::models::DiffDriveTorque::rhs (
const T * x,
const T * u,
T * dx,
T dt=T(0)
) const
Parameters:
x
State vector [x, y, theta, omega_r, omega_l]u
Input vector [torque_r, torque_l]dx
Output state derivativesdt
Time step for constraint enforcement
Public Static Functions Documentation
function clamp
Clamp a value between lower and upper bounds.
static inline JALANSIM_HOST_DEVICE T jalansim::dynamics::models::DiffDriveTorque::clamp (
T v,
T lo,
T hi
)
Parameters:
v
Value to clamplo
Lower boundhi
Upper bound
Returns:
Clamped value
The documentation for this class was generated from the following file include/jalansim/dynamics/models/diff_drive_torque.hpp