File model.cuh

Slipless dynamics model for MPPI and state estimation.

For more information, see the overview.

namespace controls
namespace model
namespace slipless

Functions

static __host__ __device__ float kinematic_swangle (const float speed, const float swangle)

Calculate the kinematic swangle (adjusted for understeering), used for determining center/radius of rotation.

Parameters:
  • speed[in] Speed of the car in m/s.

  • swangle[in] Steering angle in radians.

Returns:

Kinematic steering angle in radians.

static __host__ __device__ float angular_speed (const float speed, const float kinematic_swangle_)

Calculates angular speed. Since we assume uniform circular motion, this is the same as yaw rate.

Parameters:
  • speed[in] Speed of the car in m/s.

  • kinematic_swangle_[in] Kinematic steering angle in radians.

Returns:

Angular speed in rad/s.

static __host__ __device__ float centripedal_accel (const float speed, const float swangle)

Calculate centripedal acceleration. This is the acceleration towards the center of the turning circle.

Parameters:
  • speed[in] Speed of the car in m/s.

  • swangle[in] Steering angle in radians.

Returns:

Centripedal acceleration in m/s^2.

static __host__ __device__ float slip_angle (const float kinematic_swangle)

Calculate slip angle. This is the angle between the direction the car is pointing (heading) and the direction the car is moving (trajectory). It does not necessarily imply the car is slipping.

Parameters:

kinematic_swangle[in] Kinematic steering angle in radians.

Returns:

Slip angle in radians.

static __host__ __device__ void dynamics (const float state[], const float action[], float next_state[], float timestep)

Slipless dynamics model. This is the core function that calculates the next state given the current state and action. Can be used in-place (i.e. next_state = state).

Parameters:
  • state[in] Current state of the car.

  • action[in] Action to take.

  • next_state[out] Next state of the car.

  • timestep[in] Model time step in seconds.