Sync IMU transforms

This commit is contained in:
Marc Garcia Puig 2020-10-15 15:22:13 +02:00
parent d8b36e652a
commit a53c697f69
6 changed files with 19 additions and 6 deletions

View File

@ -255,7 +255,7 @@ namespace road {
// is the exact height that match with most of the RoadRunner sidewalks
dp_r.location.z += 0.1524f;
dp_l.location.z += 0.1524f;
/// TODO: use the OpenDRIVE 5.3.7.2.1.1.9 Lane Height Record
/// @TODO: use the OpenDRIVE 5.3.7.2.1.1.9 Lane Height Record
}
return std::make_pair(dp_r.location, dp_l.location);

View File

@ -32,6 +32,7 @@ AInertialMeasurementUnit::AInertialMeasurementUnit(
// Initialized to something hight to minimize the artifacts
// when the initial values are unknown
PrevDeltaTime = std::numeric_limits<float>::max();
OldTransform = GetActorTransform();
}
FActorDefinition AInertialMeasurementUnit::GetSensorDefinition()
@ -39,6 +40,10 @@ FActorDefinition AInertialMeasurementUnit::GetSensorDefinition()
return UActorBlueprintFunctionLibrary::MakeIMUDefinition();
}
const FTransform &AInertialMeasurementUnit::GetSyncActorTransform() const {
return OldTransform;
}
void AInertialMeasurementUnit::Set(const FActorDescription &ActorDescription)
{
Super::Set(ActorDescription);
@ -187,6 +192,9 @@ void AInertialMeasurementUnit::Tick(float DeltaTime)
ComputeAccelerometer(DeltaTime),
ComputeGyroscope(),
ComputeCompass());
// TODO: delete once the new tick pipeline is done
OldTransform = GetActorTransform();
}
void AInertialMeasurementUnit::SetAccelerationStandardDeviation(const FVector &Vec)
@ -222,6 +230,4 @@ const FVector &AInertialMeasurementUnit::GetGyroscopeBias() const
void AInertialMeasurementUnit::BeginPlay()
{
Super::BeginPlay();
constexpr float TO_METERS = 1e-2;
}

View File

@ -30,6 +30,9 @@ public:
static FActorDefinition GetSensorDefinition();
/// @TODO: delete once the new tick pipeline is done
const FTransform &GetSyncActorTransform() const override;
void Set(const FActorDescription &ActorDescription) override;
void SetOwner(AActor *Owner) override;
@ -68,6 +71,9 @@ public:
private:
/// @TODO: delete once the new tick pipeline is done
FTransform OldTransform;
void BeginPlay() override;
/// Standard deviation for acceleration settings.

View File

@ -511,6 +511,7 @@ void ASceneCaptureSensor::Tick(float DeltaTime)
ReadyToCapture = true;
// TODO: delete once the new tick pipeline is done
OldTransform = GetActorTransform();
}

View File

@ -34,14 +34,14 @@ class CARLA_API ASceneCaptureSensor : public ASensor
private:
/// TODO: delete once the new tick pipeline is done
/// @TODO: delete once the new tick pipeline is done
FTransform OldTransform;
public:
ASceneCaptureSensor(const FObjectInitializer &ObjectInitializer);
/// TODO: delete once the new tick pipeline is done
/// @TODO: delete once the new tick pipeline is done
const FTransform &GetSyncActorTransform() const override;
void Set(const FActorDescription &ActorDescription) override;

View File

@ -39,7 +39,7 @@ public:
bool PendingLightUpdate);
/// Dummy. Required for compatibility with other sensors only.
/// TODO: raname to 'GetActorTransform' once the new tick pipeline is done
/// @TODO: raname to 'GetActorTransform' once the new tick pipeline is done
FTransform GetSyncActorTransform() const
{
return {};