|
CARLA
|
Wheeled vehicle controller with optional AI. More...
#include <WheeledVehicleAIController.h>
Inheritance diagram for AWheeledVehicleAIController:Public Member Functions | |
Constructor and destructor | |
| AWheeledVehicleAIController (const FObjectInitializer &ObjectInitializer) | |
| ~AWheeledVehicleAIController () | |
Controller overrides | |
| void | OnPossess (APawn *aPawn) override |
| void | OnUnPossess () override |
| void | Tick (float DeltaTime) override |
Possessed vehicle | |
| bool | IsPossessingAVehicle () const |
| ACarlaWheeledVehicle * | GetPossessedVehicle () |
| const ACarlaWheeledVehicle * | GetPossessedVehicle () const |
Control options | |
| void | SetStickyControl (bool bEnabled) |
Road map | |
| void | SetRoadMap (URoadMap *InRoadMap) |
| URoadMap * | GetRoadMap () |
Random engine | |
| URandomEngine * | GetRandomEngine () |
Traffic | |
| float | GetSpeedLimit () const |
| Get current speed limit in km/h. | |
| void | SetSpeedLimit (float InSpeedLimit) |
| Set vehicle's speed limit in km/h. | |
| ETrafficLightState | GetTrafficLightState () const |
| Get traffic light state currently affecting this vehicle. | |
| void | SetTrafficLightState (ETrafficLightState InTrafficLightState) |
| Set traffic light state currently affecting this vehicle. | |
| ATrafficLightBase * | GetTrafficLight () const |
| Get traffic light currently affecting this vehicle. | |
| void | SetTrafficLight (ATrafficLightBase *InTrafficLight) |
| Set traffic light currently affecting this vehicle. | |
| void | SetFixedRoute (const TArray< FVector > &Locations, bool bOverwriteCurrent=true) |
| Set a fixed route to follow if autopilot is enabled. | |
Private Attributes | |
| bool | bAutopilotEnabled = false |
| bool | bControlIsSticky = true |
| float | MaximumSteerAngle = -1.0f |
| URandomEngine * | RandomEngine = nullptr |
| URoadMap * | RoadMap = nullptr |
| float | SpeedLimit = 30.0f |
| std::queue< FVector > | TargetLocations |
| ATrafficLightBase * | TrafficLight |
| ETrafficLightState | TrafficLightState = ETrafficLightState::Green |
| ACarlaWheeledVehicle * | Vehicle = nullptr |
Autopilot | |
| bool | IsAutopilotEnabled () const |
| void | SetAutopilot (bool Enable, bool KeepState=false) |
| void | ToggleAutopilot () |
| void | ConfigureAutopilot (const bool Enable, const bool KeepState=false) |
Wheeled vehicle controller with optional AI.
Definition at line 26 of file WheeledVehicleAIController.h.
| AWheeledVehicleAIController::AWheeledVehicleAIController | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 86 of file WheeledVehicleAIController.cpp.
References URandomEngine::GenerateRandomSeed(), RandomEngine, and URandomEngine::Seed().
| AWheeledVehicleAIController::~AWheeledVehicleAIController | ( | ) |
Definition at line 97 of file WheeledVehicleAIController.cpp.
|
private |
Definition at line 157 of file WheeledVehicleAIController.cpp.
References bAutopilotEnabled, ClearQueue(), ACarlaWheeledVehicle::SetAIVehicleState(), ACarlaWheeledVehicle::SetBrakeInput(), ACarlaWheeledVehicle::SetHandbrakeInput(), ACarlaWheeledVehicle::SetReverse(), ACarlaWheeledVehicle::SetSteeringInput(), ACarlaWheeledVehicle::SetThrottleInput(), TargetLocations, TrafficLightState, and Vehicle.
Referenced by OnPossess().
|
inline |
Definition at line 70 of file WheeledVehicleAIController.h.
References Vehicle.
|
inline |
Definition at line 75 of file WheeledVehicleAIController.h.
References Vehicle.
|
inline |
Definition at line 120 of file WheeledVehicleAIController.h.
Referenced by ARoutePlanner::AssignRandomRoute().
|
inline |
Definition at line 106 of file WheeledVehicleAIController.h.
|
inline |
Get current speed limit in km/h.
Definition at line 169 of file WheeledVehicleAIController.h.
|
inline |
Get traffic light currently affecting this vehicle.
Definition at line 197 of file WheeledVehicleAIController.h.
References TrafficLight.
|
inline |
Get traffic light state currently affecting this vehicle.
Definition at line 183 of file WheeledVehicleAIController.h.
|
inline |
Definition at line 135 of file WheeledVehicleAIController.h.
|
inline |
Definition at line 64 of file WheeledVehicleAIController.h.
References Vehicle.
Referenced by OnPossess(), and Tick().
|
override |
Definition at line 103 of file WheeledVehicleAIController.cpp.
References bAutopilotEnabled, ConfigureAutopilot(), ACarlaWheeledVehicle::GetMaximumSteerAngle(), IsPossessingAVehicle(), MaximumSteerAngle, RoadMap, and Vehicle.
|
override |
Definition at line 128 of file WheeledVehicleAIController.cpp.
References Vehicle.
|
inline |
Definition at line 141 of file WheeledVehicleAIController.h.
| void AWheeledVehicleAIController::SetFixedRoute | ( | const TArray< FVector > & | Locations, |
| bool | bOverwriteCurrent = true |
||
| ) |
Set a fixed route to follow if autopilot is enabled.
Definition at line 182 of file WheeledVehicleAIController.cpp.
References ClearQueue(), and TargetLocations.
Referenced by ARoutePlanner::AssignRandomRoute().
|
inline |
Definition at line 100 of file WheeledVehicleAIController.h.
|
inline |
Set vehicle's speed limit in km/h.
Definition at line 176 of file WheeledVehicleAIController.h.
|
inline |
Definition at line 87 of file WheeledVehicleAIController.h.
|
inline |
Set traffic light currently affecting this vehicle.
Definition at line 204 of file WheeledVehicleAIController.h.
References TrafficLight.
|
inline |
Set traffic light state currently affecting this vehicle.
Definition at line 190 of file WheeledVehicleAIController.h.
|
override |
Definition at line 135 of file WheeledVehicleAIController.cpp.
References ACarlaWheeledVehicle::ApplyVehicleControl(), bAutopilotEnabled, bControlIsSticky, ACarlaWheeledVehicle::FlushVehicleControl(), IsPossessingAVehicle(), Tick(), and Vehicle.
Referenced by Tick().
|
inline |
Definition at line 150 of file WheeledVehicleAIController.h.
|
private |
Definition at line 227 of file WheeledVehicleAIController.h.
Referenced by ConfigureAutopilot(), OnPossess(), and Tick().
|
private |
Definition at line 230 of file WheeledVehicleAIController.h.
Referenced by Tick().
|
private |
Definition at line 239 of file WheeledVehicleAIController.h.
Referenced by OnPossess().
|
private |
Definition at line 224 of file WheeledVehicleAIController.h.
Referenced by AWheeledVehicleAIController().
|
private |
Definition at line 221 of file WheeledVehicleAIController.h.
Referenced by OnPossess().
|
private |
Definition at line 233 of file WheeledVehicleAIController.h.
|
private |
Definition at line 244 of file WheeledVehicleAIController.h.
Referenced by ConfigureAutopilot(), and SetFixedRoute().
|
private |
Definition at line 242 of file WheeledVehicleAIController.h.
|
private |
Definition at line 236 of file WheeledVehicleAIController.h.
Referenced by ConfigureAutopilot().
|
private |
Definition at line 218 of file WheeledVehicleAIController.h.
Referenced by ConfigureAutopilot(), OnPossess(), OnUnPossess(), and Tick().