Added large map funcionality for the ackermann controller

This commit is contained in:
Joel Moriana 2022-02-08 10:31:51 +01:00 committed by joel-mb
parent 67e12c34ac
commit a8497162ab
3 changed files with 9 additions and 4 deletions

View File

@ -106,6 +106,7 @@ void FVehicleData::RecordActorData(FCarlaActor* CarlaActor, UCarlaEpisode* Carla
Control = Vehicle->GetVehicleControl();
AckermannControl = Vehicle->GetVehicleAckermannControl();
bAckermannControlActive = Vehicle->IsAckermannControlActive();
AckermannControllerSettings = Vehicle->GetAckermannControllerSettings();
LightState = Vehicle->GetVehicleLightState();
auto Controller = Cast<AWheeledVehicleAIController>(Vehicle->GetController());
if (Controller)
@ -124,6 +125,7 @@ void FVehicleData::RestoreActorData(FCarlaActor* CarlaActor, UCarlaEpisode* Carl
{
Vehicle->ApplyVehiclePhysicsControl(PhysicsControl);
}
Vehicle->ApplyAckermannControllerSettings(AckermannControllerSettings);
if (!bAckermannControlActive)
{
Vehicle->ApplyVehicleControl(Control, EVehicleInputPriority::Client);

View File

@ -7,6 +7,7 @@
#pragma once
#include "Math/DVector.h"
#include "Carla/Vehicle/AckermannControllerSettings.h"
#include "Carla/Vehicle/VehicleAckermannControl.h"
#include "Carla/Vehicle/VehicleControl.h"
#include "Carla/Vehicle/VehicleLightState.h"
@ -62,6 +63,8 @@ public:
bool bAckermannControlActive = false;
FAckermannControllerSettings AckermannControllerSettings;
FVehicleLightState LightState;
float SpeedLimit = 30;

View File

@ -879,8 +879,8 @@ ECarlaServerResponse FVehicleActor::GetAckermannControllerSettings(
{
if (IsDormant())
{
//FVehicleData* ActorData = GetActorData<FVehicleData>();
//PhysicsControl = ActorData->PhysicsControl;
FVehicleData* ActorData = GetActorData<FVehicleData>();
AckermannSettings = ActorData->AckermannControllerSettings;
}
else
{
@ -899,8 +899,8 @@ ECarlaServerResponse FVehicleActor::ApplyAckermannControllerSettings(
{
if (IsDormant())
{
// FVehicleData* ActorData = GetActorData<FVehicleData>();
// ActorData->PhysicsControl = PhysicsControl;
FVehicleData* ActorData = GetActorData<FVehicleData>();
ActorData->AckermannControllerSettings = AckermannSettings;
}
else
{