Simple bicycle model structure.
More...
#include <bicycle_model.hpp>
|
| | BicycleModel (const std::string &config_path) |
| |
| | ~BicycleModel () override=default |
| |
| void | step (double dt) override |
| |
| void | reset () override |
| |
| double | get_position_x () const override |
| |
| double | get_position_y () const override |
| |
| double | get_yaw () const override |
| |
| double | get_velocity_x () const override |
| |
| void | set_position (double x, double y, double yaw) override |
| |
| void | set_velocity (double vx) override |
| |
| void | set_steering (double angle) override |
| |
| void | set_throttle (double throttle) override |
| |
| std::string | get_model_name () const override |
| |
| | BicycleModel (common_lib::car_parameters::CarParameters car_parameters) |
| |
| std::pair< double, double > | wheels_velocities_to_cg (double rl_rpm, double fl_rpm, double rr_rpm, double fr_rpm, double steering_angle) override |
| | assumes a bicycle model and a set of parameters about the vehicle to calculate the velocities of the center of mass given the velocities of the wheels
|
| |
| common_lib::structures::Position | rear_axis_position (const common_lib::structures::Position &cg, double orientation, double dist_cg_2_rear_axis) override |
| | Calculates the position of the rear axis given the position of the center of mass, the the orientation and the distance between the center of mass and the rear axis.
|
| |
| Eigen::VectorXd | cg_velocity_to_wheels (const Eigen::Vector3d &cg_velocities) override |
| | Assumes a bicycle model and a set of parameters about the vehicle to calculate the velocities of the wheels given the velocities of the center of mass.
|
| |
| Eigen::MatrixXd | jacobian_cg_velocity_to_wheels (const Eigen::Vector3d &cg_velocities) override |
| | Calculates the jacobian of the function cg_velocity_to_wheels with respect to the center of mass velocities.
|
| |
| virtual | ~VehicleModel ()=default |
| |
Simple bicycle model structure.
Definition at line 13 of file bicycle_model.hpp.
◆ BicycleModel() [1/2]
| BicycleModel::BicycleModel |
( |
const std::string & |
config_path | ) |
|
|
explicit |
◆ ~BicycleModel()
| BicycleModel::~BicycleModel |
( |
| ) |
|
|
overridedefault |
◆ BicycleModel() [2/2]
◆ cg_velocity_to_wheels()
| Eigen::VectorXd BicycleModel::cg_velocity_to_wheels |
( |
const Eigen::Vector3d & |
cg_velocities | ) |
|
|
overridevirtual |
Assumes a bicycle model and a set of parameters about the vehicle to calculate the velocities of the wheels given the velocities of the center of mass.
- Parameters
-
| cg_velocities | vector of velocities on the Center of Gravity {velocity_x, velocity_y, rotational_velocity} in m/s and rad/s respectively |
- Returns
- Eigen::VectorXd rpms of the wheels, the steering angle, and motor rpms {fl_rpm, fr_rpm, rl_rpm, rr_rpm, steering_angle, motor_rpm}
Implements S2VModel.
◆ get_model_name()
| std::string BicycleModel::get_model_name |
( |
| ) |
const |
|
overridevirtual |
◆ get_position_x()
| double BicycleModel::get_position_x |
( |
| ) |
const |
|
overridevirtual |
◆ get_position_y()
| double BicycleModel::get_position_y |
( |
| ) |
const |
|
overridevirtual |
◆ get_velocity_x()
| double BicycleModel::get_velocity_x |
( |
| ) |
const |
|
overridevirtual |
◆ get_yaw()
| double BicycleModel::get_yaw |
( |
| ) |
const |
|
overridevirtual |
◆ jacobian_cg_velocity_to_wheels()
| Eigen::MatrixXd BicycleModel::jacobian_cg_velocity_to_wheels |
( |
const Eigen::Vector3d & |
cg_velocities | ) |
|
|
overridevirtual |
Calculates the jacobian of the function cg_velocity_to_wheels with respect to the center of mass velocities.
- Parameters
-
| cg_velocities | vector 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 dimension 6x3
Implements S2VModel.
◆ rear_axis_position()
Calculates the position of the rear axis given the position of the center of mass, the the orientation and the distance between the center of mass and the rear axis.
- Parameters
-
| cg | position of the center of mass in meters |
| orientation | orientation of the vehicle relative to the world frame in radians |
| dist_cg_2_rear_axis | disntance between the center of mass and the rear axis in meters |
- Returns
- common_lib::structures::Position
Implements S2VModel.
◆ reset()
| void BicycleModel::reset |
( |
| ) |
|
|
overridevirtual |
◆ set_position()
| void BicycleModel::set_position |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
yaw |
|
) |
| |
|
overridevirtual |
◆ set_steering()
| void BicycleModel::set_steering |
( |
double |
angle | ) |
|
|
overridevirtual |
◆ set_throttle()
| void BicycleModel::set_throttle |
( |
double |
throttle | ) |
|
|
overridevirtual |
◆ set_velocity()
| void BicycleModel::set_velocity |
( |
double |
vx | ) |
|
|
overridevirtual |
◆ step()
| void BicycleModel::step |
( |
double |
dt | ) |
|
|
overridevirtual |
◆ wheels_velocities_to_cg()
| std::pair< double, double > BicycleModel::wheels_velocities_to_cg |
( |
double |
rl_rpm, |
|
|
double |
fl_rpm, |
|
|
double |
rr_rpm, |
|
|
double |
fr_rpm, |
|
|
double |
steering_angle |
|
) |
| |
|
overridevirtual |
assumes a bicycle model and a set of parameters about the vehicle to calculate the velocities of the center of mass given the velocities of the wheels
- Parameters
-
| rl_rpm | rear left wheel velocity in rpm |
| fl_rpm | front left wheel velocity in rpm |
| rr_rpm | rear right wheel velocity in rpm |
| fr_rpm | front right wheel velocity in rpm |
| steering_angle | steering angle in radians |
- Returns
- std::pair<double, double> translational and rotational velocities of the center of mass in m/s and rad/s respectively
Implements S2VModel.
◆ aero_area_
| double BicycleModel::aero_area_ |
|
private |
◆ Blat_
| double BicycleModel::Blat_ |
|
private |
◆ car_parameters_
◆ cda_
| double BicycleModel::cda_ |
|
private |
◆ cla_
| double BicycleModel::cla_ |
|
private |
◆ Clat_
| double BicycleModel::Clat_ |
|
private |
◆ Dlat_
| double BicycleModel::Dlat_ |
|
private |
◆ Elat_
| double BicycleModel::Elat_ |
|
private |
◆ gear_ratio_
| double BicycleModel::gear_ratio_ |
|
private |
◆ h_cg_
| double BicycleModel::h_cg_ |
|
private |
◆ Izz_
| double BicycleModel::Izz_ |
|
private |
◆ lf_
◆ lr_
◆ mass_
| double BicycleModel::mass_ |
|
private |
◆ max_steering_angle_
| double BicycleModel::max_steering_angle_ |
|
private |
◆ sf_
◆ sr_
◆ steering_angle_
| double BicycleModel::steering_angle_ |
|
private |
◆ throttle_
| double BicycleModel::throttle_ |
|
private |
◆ vx_
◆ wheel_radius_
| double BicycleModel::wheel_radius_ |
|
private |
◆ x_
◆ y_
◆ yaw_
| double BicycleModel::yaw_ |
|
private |
The documentation for this class was generated from the following files: