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

#include <pid_steering_motor.hpp>

Inheritance diagram for PIDSteeringMotor:
Inheritance graph
Collaboration diagram for PIDSteeringMotor:
Collaboration graph

Public Member Functions

 PIDSteeringMotor (const common_lib::car_parameters::CarParameters &car_parameters)
 
double compute_steering_rate (double current_steering, double steering_goal) override
 Computes the change in steering angle based on PID control.
 
- Public Member Functions inherited from SteeringMotorModel
 SteeringMotorModel (const common_lib::car_parameters::CarParameters &car_parameters)
 

Private Attributes

double integral_ = 0.0
 
double previous_error_ = 0.0
 
rclcpp::Time last_update = rclcpp::Time(0, 0)
 

Additional Inherited Members

- Protected Attributes inherited from SteeringMotorModel
std::shared_ptr< common_lib::car_parameters::CarParameterscar_parameters_
 

Detailed Description

Definition at line 7 of file pid_steering_motor.hpp.

Constructor & Destructor Documentation

◆ PIDSteeringMotor()

PIDSteeringMotor::PIDSteeringMotor ( const common_lib::car_parameters::CarParameters car_parameters)
inline

Definition at line 14 of file pid_steering_motor.hpp.

Member Function Documentation

◆ compute_steering_rate()

double PIDSteeringMotor::compute_steering_rate ( double  current_steering,
double  steering_goal 
)
overridevirtual

Computes the change in steering angle based on PID control.

Parameters
current_steeringcurrent steering angle in radians
steering_goaldesired steering angle in radians
Returns
double change in steering angle in radians

Implements SteeringMotorModel.

Definition at line 3 of file pid_steering_motor.cpp.

Member Data Documentation

◆ integral_

double PIDSteeringMotor::integral_ = 0.0
private

Definition at line 9 of file pid_steering_motor.hpp.

◆ last_update

rclcpp::Time PIDSteeringMotor::last_update = rclcpp::Time(0, 0)
private

Definition at line 11 of file pid_steering_motor.hpp.

◆ previous_error_

double PIDSteeringMotor::previous_error_ = 0.0
private

Definition at line 10 of file pid_steering_motor.hpp.


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