Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
S2VModel Class Referenceabstract

Interface for models that convert data from sensor reference frame to vehicle reference frame and vice versa. More...

#include <s2v_model.hpp>

Inheritance diagram for S2VModel:
Inheritance graph
Collaboration diagram for S2VModel:
Collaboration graph

Public Member Functions

virtual std::pair< double, double > wheels_velocities_to_cg (double rl_rpm, double fl_rpm, double rr_rpm, double fr_rpm, double steering_angle)=0
 Calculates the translational and rotational velocities of the vehicle from wheel rotations and steering angle.
 
virtual common_lib::structures::Position rear_axis_position (const common_lib::structures::Position &cg, double orientation, double dist_cg_2_rear_axis)=0
 Calculate rear axis coordinates.
 
virtual Eigen::VectorXd cg_velocity_to_wheels (const Eigen::Vector3d &cg_velocities)=0
 Estimate wheel and motor velocities, as well as steering angle from the velocities of the center of gravity.
 
virtual Eigen::MatrixXd jacobian_cg_velocity_to_wheels (const Eigen::Vector3d &cg_velocities)=0
 jacobian of the function cg_velocity_to_wheels with respect to the velocities of the center of gravity
 

Detailed Description

Interface for models that convert data from sensor reference frame to vehicle reference frame and vice versa.

Definition at line 12 of file s2v_model.hpp.

Member Function Documentation

◆ cg_velocity_to_wheels()

virtual Eigen::VectorXd S2VModel::cg_velocity_to_wheels ( const Eigen::Vector3d &  cg_velocities)
pure virtual

Estimate wheel and motor velocities, as well as steering angle from the velocities of the center of gravity.

Parameters
cg_velocitiesvector of velocities on the Center of Gravity {velocity_x, velocity_y, rotational_velocity} in m/s and rad/s respectively
Returns
Eigen::VectorXd vector of wheel speeds, steering angle and motor speed {fl_rpm, fr_rpm, rl_rpm, rr_rpm, steering_angle, motor_rpm}

Implemented in BicycleModel, NoRearWSSBicycleModel, and NoWSSBicycleModel.

◆ jacobian_cg_velocity_to_wheels()

virtual Eigen::MatrixXd S2VModel::jacobian_cg_velocity_to_wheels ( const Eigen::Vector3d &  cg_velocities)
pure virtual

jacobian of the function cg_velocity_to_wheels with respect to the velocities of the center of gravity

Each entry at row i and column j of the resulting matrix is the partial derivative of the i-th element of the output of function cg_velocity_to_wheels with respect to the j-th element of the vector cg_velocities

Parameters
cg_velocitiesvector of velocities on the Center of Gravity {velocity_x, velocity_y, rotational_velocity} in m/s and rad/s respectively
Returns
Eigen::MatrixXd jacobian matrix of the function cg_velocity_to_wheels (dimensions: 6x3)

Implemented in BicycleModel, NoRearWSSBicycleModel, and NoWSSBicycleModel.

◆ rear_axis_position()

virtual common_lib::structures::Position S2VModel::rear_axis_position ( const common_lib::structures::Position cg,
double  orientation,
double  dist_cg_2_rear_axis 
)
pure virtual

Calculate rear axis coordinates.

Parameters
cgcenter of gravity position
orientationorientation of the vehicle in radians relative to the world frame (ccw)
dist_cg_2_rear_axisdistance between the center of gravity and the rear axis
Returns
Point

Implemented in BicycleModel, NoRearWSSBicycleModel, and NoWSSBicycleModel.

◆ wheels_velocities_to_cg()

virtual std::pair< double, double > S2VModel::wheels_velocities_to_cg ( double  rl_rpm,
double  fl_rpm,
double  rr_rpm,
double  fr_rpm,
double  steering_angle 
)
pure virtual

Calculates the translational and rotational velocities of the vehicle from wheel rotations and steering angle.

Parameters
rl_rpmrear left wheel rpms
fl_rpmfront left wheel rpms
rr_rpmrear right wheel rpms
fr_rpmfront right wheel rpms
steering_anglesteering angle in radians
Returns
std::pair<double, double> translational velocity, rotational velocity

Implemented in BicycleModel, NoRearWSSBicycleModel, and NoWSSBicycleModel.


The documentation for this class was generated from the following file: