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

#include <inspection_functions.hpp>

Collaboration diagram for InspectionFunctions:
Collaboration graph

Public Member Functions

double calculate_steering (double time) const
 calculate the steering angle according to time
 
double calculate_throttle (double current_velocity) const
 calculate torque output according to velocity
 
double rpm_to_velocity (double rpm) const
 convert rpm [rotations/minute] to velocity [m/s]
 
void redefine_goal_velocity (double current_velocity)
 used when in oscilation mode to redefine the ideal velocity
 
double throttle_to_adequate_range (double throttle) const
 convert the throttle to a range between -1 and 1
 
 InspectionFunctions ()
 Construct a new Inspection Functions object.
 
 InspectionFunctions (double max_angle, double turning_period, double wheel_radius, double finish_time, bool start_and_stop, double gain=0.0, double ideal_velocity=0.0)
 Construct a new Inspection Mission with constants to be defined by input.
 

Public Attributes

double max_angle_ = MAX_ANGLE
 
double ideal_velocity_ = 2.0
 
double turning_period_ = 4.0
 
double wheel_radius_ = 0.254
 
double gain_ = 0.05
 
double finish_time_ = 26.0
 
double current_goal_velocity_ = 1.0
 
bool start_and_stop_ = false
 
bool stop_oscilating_ = false
 Used to stop the oscilation near zero and avoid violent wheel movements.
 

Detailed Description

Definition at line 15 of file inspection_functions.hpp.

Constructor & Destructor Documentation

◆ InspectionFunctions() [1/2]

InspectionFunctions::InspectionFunctions ( )
default

Construct a new Inspection Functions object.

◆ InspectionFunctions() [2/2]

InspectionFunctions::InspectionFunctions ( double  max_angle,
double  turning_period,
double  wheel_radius,
double  finish_time,
bool  start_and_stop,
double  gain = 0.0,
double  ideal_velocity = 0.0 
)

Construct a new Inspection Mission with constants to be defined by input.

Parameters
max_anglemaximum turning angle for the wheels in the inspection script [rad]
ebs_test_ideal_velocityideal velocity of the wheels for the ebs test [m/s]
inspection_ideal_velocityideal velocity of the wheels for the inspection [m/s]
turning_periodtime it takes for the wheels to turn in inspecion script [s]
wheel_radiusradius of the wheels of the car to estimate velocity [m]
inspection_gainconstant for the controller in the inspection
ebs_test_gainconstant for the controller in the ebs test
finish_timetime until the end of the program [s]
start_and_stopwhether to make the car accelerate and brake multiple times (true) or just once (false)

Definition at line 4 of file inspection_functions.cpp.

Member Function Documentation

◆ calculate_steering()

double InspectionFunctions::calculate_steering ( double  time) const

calculate the steering angle according to time

Parameters
timein seconds
Returns
steering angle in radians

Definition at line 30 of file inspection_functions.cpp.

Here is the caller graph for this function:

◆ calculate_throttle()

double InspectionFunctions::calculate_throttle ( double  current_velocity) const

calculate torque output according to velocity

Parameters
velocity
Returns
double

Definition at line 24 of file inspection_functions.cpp.

Here is the caller graph for this function:

◆ redefine_goal_velocity()

void InspectionFunctions::redefine_goal_velocity ( double  current_velocity)

used when in oscilation mode to redefine the ideal velocity

Parameters
current_velocity[m/s]

Definition at line 41 of file inspection_functions.cpp.

Here is the caller graph for this function:

◆ rpm_to_velocity()

double InspectionFunctions::rpm_to_velocity ( double  rpm) const

convert rpm [rotations/minute] to velocity [m/s]

Parameters
rpmrotations per minute
Returns
velocity [m/s]

Definition at line 19 of file inspection_functions.cpp.

Here is the caller graph for this function:

◆ throttle_to_adequate_range()

double InspectionFunctions::throttle_to_adequate_range ( double  throttle) const

convert the throttle to a range between -1 and 1

Parameters
throttleoriginal throttle value
Returns
double throttle value between -1 and 1

Definition at line 34 of file inspection_functions.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ current_goal_velocity_

double InspectionFunctions::current_goal_velocity_ = 1.0

Definition at line 24 of file inspection_functions.hpp.

◆ finish_time_

double InspectionFunctions::finish_time_ = 26.0

Definition at line 23 of file inspection_functions.hpp.

◆ gain_

double InspectionFunctions::gain_ = 0.05

Definition at line 22 of file inspection_functions.hpp.

◆ ideal_velocity_

double InspectionFunctions::ideal_velocity_ = 2.0

Definition at line 19 of file inspection_functions.hpp.

◆ max_angle_

double InspectionFunctions::max_angle_ = MAX_ANGLE

Definition at line 18 of file inspection_functions.hpp.

◆ start_and_stop_

bool InspectionFunctions::start_and_stop_ = false

Definition at line 25 of file inspection_functions.hpp.

◆ stop_oscilating_

bool InspectionFunctions::stop_oscilating_ = false

Used to stop the oscilation near zero and avoid violent wheel movements.

Definition at line 28 of file inspection_functions.hpp.

◆ turning_period_

double InspectionFunctions::turning_period_ = 4.0

Definition at line 20 of file inspection_functions.hpp.

◆ wheel_radius_

double InspectionFunctions::wheel_radius_ = 0.254

Definition at line 21 of file inspection_functions.hpp.


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