#include <AckermannController.h>
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 |
Definition at line 81 of file AckermannController.h.
|
default |
FAckermannController::~FAckermannController | ( | ) |
Definition at line 14 of file AckermannController.cpp.
void FAckermannController::ApplySettings | ( | const FAckermannControllerSettings & | Settings | ) |
Definition at line 34 of file AckermannController.cpp.
References AccelerationController, FAckermannControllerSettings::AccelKd, FAckermannControllerSettings::AccelKi, FAckermannControllerSettings::AccelKp, PID::Kd, PID::Ki, PID::Kp, SpeedController, FAckermannControllerSettings::SpeedKd, FAckermannControllerSettings::SpeedKi, and FAckermannControllerSettings::SpeedKp.
FAckermannControllerSettings FAckermannController::GetSettings | ( | ) | const |
Definition at line 20 of file AckermannController.cpp.
References AccelerationController, FAckermannControllerSettings::AccelKd, FAckermannControllerSettings::AccelKi, FAckermannControllerSettings::AccelKp, PID::Kd, PID::Ki, PID::Kp, SpeedController, FAckermannControllerSettings::SpeedKd, FAckermannControllerSettings::SpeedKi, and FAckermannControllerSettings::SpeedKp.
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.
|
private |
Definition at line 169 of file AckermannController.cpp.
References AccelControlPedalDelta, AccelControlPedalTarget, AccelerationController, DeltaTime, PID::Run(), PID::SetTargetPoint(), SpeedControlAccelTarget, and VehicleAcceleration.
Referenced by RunLoop().
|
private |
Definition at line 117 of file AckermannController.cpp.
References Brake, FVehicleAckermannControl::Speed, Throttle, UserTargetPoint, and VehicleSpeed.
Referenced by RunLoop().
|
private |
Definition at line 129 of file AckermannController.cpp.
References bReverse, FVehicleAckermannControl::Speed, TargetSpeed, UserTargetPoint, and VehicleSpeed.
Referenced by RunLoop().
|
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().
|
private |
Definition at line 102 of file AckermannController.cpp.
References DeltaTime, Steer, TargetSteer, TargetSteerSpeed, and VehicleSteer.
Referenced by 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().
void FAckermannController::SetTargetPoint | ( | const FVehicleAckermannControl & | AckermannControl | ) |
Definition at line 44 of file AckermannController.cpp.
References FVehicleAckermannControl::Acceleration, FVehicleAckermannControl::Jerk, FVehicleAckermannControl::Speed, FVehicleAckermannControl::Steer, FVehicleAckermannControl::SteerSpeed, TargetAcceleration, TargetJerk, TargetSpeed, TargetSteer, TargetSteerSpeed, UserTargetPoint, and VehicleMaxSteering.
|
private |
Definition at line 179 of file AckermannController.cpp.
References AccelControlPedalTarget, Brake, bReverse, and Throttle.
Referenced by RunLoop().
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().
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().
|
private |
Definition at line 141 of file AckermannController.h.
Referenced by Reset(), and RunControlAcceleration().
|
private |
Definition at line 142 of file AckermannController.h.
Referenced by Reset(), RunControlAcceleration(), and UpdateVehicleControlCommand().
Definition at line 116 of file AckermannController.h.
Referenced by ApplySettings(), GetSettings(), Reset(), and RunControlAcceleration().
|
private |
Definition at line 134 of file AckermannController.h.
Referenced by Reset(), RunControlFullStop(), RunLoop(), and UpdateVehicleControlCommand().
|
private |
Definition at line 135 of file AckermannController.h.
Referenced by Reset(), RunControlReverse(), RunLoop(), and UpdateVehicleControlCommand().
|
private |
Definition at line 145 of file AckermannController.h.
Referenced by RunControlAcceleration(), RunControlSpeed(), RunControlSteering(), and UpdateVehicleState().
|
private |
Definition at line 155 of file AckermannController.h.
Referenced by Reset(), and UpdateVehicleState().
|
private |
Definition at line 154 of file AckermannController.h.
Referenced by Reset(), and UpdateVehicleState().
|
private |
Definition at line 128 of file AckermannController.h.
Referenced by RunControlSpeed().
|
private |
Definition at line 129 of file AckermannController.h.
Referenced by RunControlSpeed().
|
private |
Definition at line 138 of file AckermannController.h.
Referenced by Reset(), and RunControlSpeed().
|
private |
Definition at line 139 of file AckermannController.h.
Referenced by Reset(), RunControlAcceleration(), and RunControlSpeed().
Definition at line 115 of file AckermannController.h.
Referenced by ApplySettings(), GetSettings(), Reset(), and RunControlSpeed().
|
private |
Definition at line 132 of file AckermannController.h.
Referenced by Reset(), RunControlSteering(), and RunLoop().
|
private |
Definition at line 124 of file AckermannController.h.
Referenced by RunControlSpeed(), and SetTargetPoint().
|
private |
Definition at line 125 of file AckermannController.h.
Referenced by SetTargetPoint().
|
private |
Definition at line 123 of file AckermannController.h.
Referenced by RunControlReverse(), RunControlSpeed(), and SetTargetPoint().
|
private |
Definition at line 121 of file AckermannController.h.
Referenced by RunControlSteering(), and SetTargetPoint().
|
private |
Definition at line 122 of file AckermannController.h.
Referenced by RunControlSteering(), and SetTargetPoint().
|
private |
Definition at line 133 of file AckermannController.h.
Referenced by Reset(), RunControlFullStop(), RunLoop(), and UpdateVehicleControlCommand().
|
private |
Definition at line 118 of file AckermannController.h.
Referenced by RunControlFullStop(), RunControlReverse(), and SetTargetPoint().
|
private |
Definition at line 152 of file AckermannController.h.
Referenced by Reset(), RunControlAcceleration(), and UpdateVehicleState().
|
private |
Definition at line 148 of file AckermannController.h.
Referenced by RunLoop(), SetTargetPoint(), UpdateVehiclePhysics(), and UpdateVehicleState().
|
private |
Definition at line 151 of file AckermannController.h.
Referenced by Reset(), RunControlFullStop(), RunControlReverse(), RunControlSpeed(), and UpdateVehicleState().
|
private |
Definition at line 150 of file AckermannController.h.
Referenced by RunControlSteering(), and UpdateVehicleState().