CARLA
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FAckermannController Class Reference

#include <AckermannController.h>

+ Collaboration diagram for FAckermannController:

Public Member Functions

void ApplySettings (const FAckermannControllerSettings &Settings)
 
 FAckermannController ()=default
 
FAckermannControllerSettings GetSettings () const
 
void Reset ()
 
void RunLoop (FVehicleControl &Control)
 
void SetTargetPoint (const FVehicleAckermannControl &AckermannControl)
 
void UpdateVehiclePhysics (const ACarlaWheeledVehicle *Vehicle)
 
void UpdateVehicleState (const ACarlaWheeledVehicle *Vehicle)
 
 ~FAckermannController ()
 

Private Member Functions

void RunControlAcceleration ()
 
bool RunControlFullStop ()
 
void RunControlReverse ()
 
void RunControlSpeed ()
 
void RunControlSteering ()
 
void UpdateVehicleControlCommand ()
 

Private Attributes

float AccelControlPedalDelta = 0.0f
 
float AccelControlPedalTarget = 0.0f
 
PID AccelerationController = PID(0.01f, 0.0f, 0.01f)
 
float Brake = 0.0f
 
bool bReverse = false
 
float DeltaTime = 0.0f
 
float LastVehicleAcceleration = 0.0f
 
float LastVehicleSpeed = 0.0f
 
float MaxAccel = 3.0f
 
float MaxDecel = 8.0f
 
float SpeedControlAccelDelta = 0.0f
 
float SpeedControlAccelTarget = 0.0f
 
PID SpeedController = PID(0.15f, 0.0f, 0.25f)
 
float Steer = 0.0f
 
float TargetAcceleration = 0.0
 
float TargetJerk = 0.0
 
float TargetSpeed = 0.0
 
float TargetSteer = 0.0
 
float TargetSteerSpeed = 0.0
 
float Throttle = 0.0f
 
FVehicleAckermannControl UserTargetPoint
 
float VehicleAcceleration = 0.0f
 
float VehicleMaxSteering = 0.0f
 
float VehicleSpeed = 0.0f
 
float VehicleSteer = 0.0f
 

Detailed Description

Definition at line 81 of file AckermannController.h.

Constructor & Destructor Documentation

◆ FAckermannController()

FAckermannController::FAckermannController ( )
default

◆ ~FAckermannController()

FAckermannController::~FAckermannController ( )

Definition at line 14 of file AckermannController.cpp.

Member Function Documentation

◆ ApplySettings()

void FAckermannController::ApplySettings ( const FAckermannControllerSettings Settings)

◆ GetSettings()

FAckermannControllerSettings FAckermannController::GetSettings ( ) const

◆ Reset()

void FAckermannController::Reset ( void  )

Definition at line 55 of file AckermannController.cpp.

References AccelControlPedalDelta, AccelControlPedalTarget, AccelerationController, Brake, bReverse, LastVehicleAcceleration, LastVehicleSpeed, PID::Reset(), SpeedControlAccelDelta, SpeedControlAccelTarget, SpeedController, Steer, Throttle, VehicleAcceleration, and VehicleSpeed.

+ Here is the call graph for this function:

◆ RunControlAcceleration()

void FAckermannController::RunControlAcceleration ( )
private

Definition at line 169 of file AckermannController.cpp.

References AccelControlPedalDelta, AccelControlPedalTarget, AccelerationController, DeltaTime, PID::Run(), PID::SetTargetPoint(), SpeedControlAccelTarget, and VehicleAcceleration.

Referenced by RunLoop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RunControlFullStop()

bool FAckermannController::RunControlFullStop ( )
private

Definition at line 117 of file AckermannController.cpp.

References Brake, FVehicleAckermannControl::Speed, Throttle, UserTargetPoint, and VehicleSpeed.

Referenced by RunLoop().

+ Here is the caller graph for this function:

◆ RunControlReverse()

void FAckermannController::RunControlReverse ( )
private

Definition at line 129 of file AckermannController.cpp.

References bReverse, FVehicleAckermannControl::Speed, TargetSpeed, UserTargetPoint, and VehicleSpeed.

Referenced by RunLoop().

+ Here is the caller graph for this function:

◆ RunControlSpeed()

void FAckermannController::RunControlSpeed ( )
private

Definition at line 152 of file AckermannController.cpp.

References DeltaTime, MaxAccel, MaxDecel, PID::Run(), PID::SetTargetPoint(), SpeedControlAccelDelta, SpeedControlAccelTarget, SpeedController, TargetAcceleration, TargetSpeed, and VehicleSpeed.

Referenced by RunLoop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RunControlSteering()

void FAckermannController::RunControlSteering ( )
private

Definition at line 102 of file AckermannController.cpp.

References DeltaTime, Steer, TargetSteer, TargetSteerSpeed, and VehicleSteer.

Referenced by RunLoop().

+ Here is the caller graph for this function:

◆ RunLoop()

void FAckermannController::RunLoop ( FVehicleControl Control)

Definition at line 80 of file AckermannController.cpp.

References FVehicleControl::Brake, Brake, FVehicleControl::bReverse, bReverse, RunControlAcceleration(), RunControlFullStop(), RunControlReverse(), RunControlSpeed(), RunControlSteering(), FVehicleControl::Steer, Steer, FVehicleControl::Throttle, Throttle, UpdateVehicleControlCommand(), and VehicleMaxSteering.

Referenced by ACarlaWheeledVehicle::FlushVehicleControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTargetPoint()

void FAckermannController::SetTargetPoint ( const FVehicleAckermannControl AckermannControl)

◆ UpdateVehicleControlCommand()

void FAckermannController::UpdateVehicleControlCommand ( )
private

Definition at line 179 of file AckermannController.cpp.

References AccelControlPedalTarget, Brake, bReverse, and Throttle.

Referenced by RunLoop().

+ Here is the caller graph for this function:

◆ UpdateVehiclePhysics()

void FAckermannController::UpdateVehiclePhysics ( const ACarlaWheeledVehicle Vehicle)

Definition at line 217 of file AckermannController.cpp.

References ACarlaWheeledVehicle::GetMaximumSteerAngle(), and VehicleMaxSteering.

Referenced by ACarlaWheeledVehicle::ApplyVehiclePhysicsControl(), and ACarlaWheeledVehicle::BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateVehicleState()

void FAckermannController::UpdateVehicleState ( const ACarlaWheeledVehicle Vehicle)

Definition at line 200 of file AckermannController.cpp.

References DeltaTime, ACarlaWheeledVehicle::GetVehicleControl(), ACarlaWheeledVehicle::GetVehicleForwardSpeed(), LastVehicleAcceleration, LastVehicleSpeed, FVehicleControl::Steer, VehicleAcceleration, VehicleMaxSteering, VehicleSpeed, and VehicleSteer.

Referenced by ACarlaWheeledVehicle::FlushVehicleControl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ AccelControlPedalDelta

float FAckermannController::AccelControlPedalDelta = 0.0f
private

Definition at line 141 of file AckermannController.h.

Referenced by Reset(), and RunControlAcceleration().

◆ AccelControlPedalTarget

float FAckermannController::AccelControlPedalTarget = 0.0f
private

◆ AccelerationController

PID FAckermannController::AccelerationController = PID(0.01f, 0.0f, 0.01f)
private

Definition at line 116 of file AckermannController.h.

Referenced by ApplySettings(), GetSettings(), Reset(), and RunControlAcceleration().

◆ Brake

float FAckermannController::Brake = 0.0f
private

◆ bReverse

bool FAckermannController::bReverse = false
private

◆ DeltaTime

float FAckermannController::DeltaTime = 0.0f
private

◆ LastVehicleAcceleration

float FAckermannController::LastVehicleAcceleration = 0.0f
private

Definition at line 155 of file AckermannController.h.

Referenced by Reset(), and UpdateVehicleState().

◆ LastVehicleSpeed

float FAckermannController::LastVehicleSpeed = 0.0f
private

Definition at line 154 of file AckermannController.h.

Referenced by Reset(), and UpdateVehicleState().

◆ MaxAccel

float FAckermannController::MaxAccel = 3.0f
private

Definition at line 128 of file AckermannController.h.

Referenced by RunControlSpeed().

◆ MaxDecel

float FAckermannController::MaxDecel = 8.0f
private

Definition at line 129 of file AckermannController.h.

Referenced by RunControlSpeed().

◆ SpeedControlAccelDelta

float FAckermannController::SpeedControlAccelDelta = 0.0f
private

Definition at line 138 of file AckermannController.h.

Referenced by Reset(), and RunControlSpeed().

◆ SpeedControlAccelTarget

float FAckermannController::SpeedControlAccelTarget = 0.0f
private

Definition at line 139 of file AckermannController.h.

Referenced by Reset(), RunControlAcceleration(), and RunControlSpeed().

◆ SpeedController

PID FAckermannController::SpeedController = PID(0.15f, 0.0f, 0.25f)
private

Definition at line 115 of file AckermannController.h.

Referenced by ApplySettings(), GetSettings(), Reset(), and RunControlSpeed().

◆ Steer

float FAckermannController::Steer = 0.0f
private

Definition at line 132 of file AckermannController.h.

Referenced by Reset(), RunControlSteering(), and RunLoop().

◆ TargetAcceleration

float FAckermannController::TargetAcceleration = 0.0
private

Definition at line 124 of file AckermannController.h.

Referenced by RunControlSpeed(), and SetTargetPoint().

◆ TargetJerk

float FAckermannController::TargetJerk = 0.0
private

Definition at line 125 of file AckermannController.h.

Referenced by SetTargetPoint().

◆ TargetSpeed

float FAckermannController::TargetSpeed = 0.0
private

Definition at line 123 of file AckermannController.h.

Referenced by RunControlReverse(), RunControlSpeed(), and SetTargetPoint().

◆ TargetSteer

float FAckermannController::TargetSteer = 0.0
private

Definition at line 121 of file AckermannController.h.

Referenced by RunControlSteering(), and SetTargetPoint().

◆ TargetSteerSpeed

float FAckermannController::TargetSteerSpeed = 0.0
private

Definition at line 122 of file AckermannController.h.

Referenced by RunControlSteering(), and SetTargetPoint().

◆ Throttle

float FAckermannController::Throttle = 0.0f
private

◆ UserTargetPoint

FVehicleAckermannControl FAckermannController::UserTargetPoint
private

Definition at line 118 of file AckermannController.h.

Referenced by RunControlFullStop(), RunControlReverse(), and SetTargetPoint().

◆ VehicleAcceleration

float FAckermannController::VehicleAcceleration = 0.0f
private

Definition at line 152 of file AckermannController.h.

Referenced by Reset(), RunControlAcceleration(), and UpdateVehicleState().

◆ VehicleMaxSteering

float FAckermannController::VehicleMaxSteering = 0.0f
private

◆ VehicleSpeed

float FAckermannController::VehicleSpeed = 0.0f
private

◆ VehicleSteer

float FAckermannController::VehicleSteer = 0.0f
private

Definition at line 150 of file AckermannController.h.

Referenced by RunControlSteering(), and UpdateVehicleState().


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