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

#include <InertialMeasurementUnit.h>

+ Inheritance diagram for AInertialMeasurementUnit:
+ Collaboration diagram for AInertialMeasurementUnit:

Public Member Functions

 AInertialMeasurementUnit (const FObjectInitializer &ObjectInitializer)
 
carla::geom::Vector3D ComputeAccelerometer (const float DeltaTime)
 Accelerometer: measures linear acceleration in m/s^2. More...
 
const carla::geom::Vector3D ComputeAccelerometerNoise (const FVector &Accelerometer)
 
float ComputeCompass ()
 Magnetometer: orientation with respect to the North in rad. More...
 
carla::geom::Vector3D ComputeGyroscope ()
 Gyroscope: measures angular velocity in rad/sec. More...
 
const carla::geom::Vector3D ComputeGyroscopeNoise (const FVector &Gyroscope)
 
const FVector & GetAccelerationStandardDeviation () const
 
const FVector & GetGyroscopeBias () const
 
const FVector & GetGyroscopeStandardDeviation () const
 
virtual void PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaTime) override
 
void Set (const FActorDescription &ActorDescription) override
 
void SetAccelerationStandardDeviation (const FVector &Vec)
 
void SetGyroscopeBias (const FVector &Vec)
 
void SetGyroscopeStandardDeviation (const FVector &Vec)
 
void SetOwner (AActor *Owner) override
 
- Public Member Functions inherited from ASensor
 ASensor (const FObjectInitializer &ObjectInitializer)
 
URandomEngineGetRandomEngine ()
 
int32 GetSeed () const
 
auto GetToken () const
 Return the token that allows subscribing to this sensor's stream. More...
 
FDataStream MoveDataStream ()
 
virtual void PrePhysTick (float DeltaSeconds)
 
void SetDataStream (FDataStream InStream)
 Replace the FDataStream associated with this sensor. More...
 
void SetEpisode (const UCarlaEpisode &InEpisode)
 
void SetSeed (int32 InSeed)
 
void Tick (const float DeltaTime) final
 

Static Public Member Functions

static FActorDefinition GetSensorDefinition ()
 

Static Public Attributes

static const FVector CarlaNorthVector
 Based on OpenDRIVE's lon and lat, North is in (0.0f, -1.0f, 0.0f) More...
 

Private Member Functions

void BeginPlay () override
 

Private Attributes

FVector BiasGyro
 Bias for gyroscope settings. More...
 
float PrevDeltaTime
 Used to compute the acceleration. More...
 
std::array< FVector, 2 > PrevLocation
 Used to compute the acceleration. More...
 
FVector StdDevAccel
 Standard deviation for acceleration settings. More...
 
FVector StdDevGyro
 Standard deviation for gyroscope settings. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ASensor
void EndPlay (EEndPlayReason::Type EndPlayReason) override
 
template<typename SensorT >
FAsyncDataStream GetDataStream (const SensorT &Self)
 Return the FDataStream associated with this sensor. More...
 
const UCarlaEpisodeGetEpisode () const
 
void PostActorCreated () override
 
- Protected Attributes inherited from ASensor
URandomEngineRandomEngine = nullptr
 Random Engine used to provide noise for sensor output. More...
 
int32 Seed = 123456789
 Seed of the pseudo-random engine. More...
 

Detailed Description

Definition at line 23 of file InertialMeasurementUnit.h.

Constructor & Destructor Documentation

◆ AInertialMeasurementUnit()

AInertialMeasurementUnit::AInertialMeasurementUnit ( const FObjectInitializer &  ObjectInitializer)

Definition at line 24 of file InertialMeasurementUnit.cpp.

References PrevDeltaTime, PrevLocation, and ASensor::RandomEngine.

Member Function Documentation

◆ BeginPlay()

void AInertialMeasurementUnit::BeginPlay ( )
overrideprivatevirtual

Reimplemented from ASensor.

Definition at line 225 of file InertialMeasurementUnit.cpp.

◆ ComputeAccelerometer()

carla::geom::Vector3D AInertialMeasurementUnit::ComputeAccelerometer ( const float  DeltaTime)

Accelerometer: measures linear acceleration in m/s^2.

Definition at line 101 of file InertialMeasurementUnit.cpp.

References ComputeAccelerometerNoise(), carla::traffic_manager::constants::MotionPlan::GRAVITY, PrevDeltaTime, and PrevLocation.

Referenced by PostPhysTick().

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

◆ ComputeAccelerometerNoise()

const carla::geom::Vector3D AInertialMeasurementUnit::ComputeAccelerometerNoise ( const FVector &  Accelerometer)

Definition at line 72 of file InertialMeasurementUnit.cpp.

References URandomEngine::GetNormalDistribution(), ASensor::RandomEngine, and StdDevAccel.

Referenced by ComputeAccelerometer().

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

◆ ComputeCompass()

float AInertialMeasurementUnit::ComputeCompass ( )

Magnetometer: orientation with respect to the North in rad.

Definition at line 166 of file InertialMeasurementUnit.cpp.

References CarlaNorthVector.

Referenced by PostPhysTick().

+ Here is the caller graph for this function:

◆ ComputeGyroscope()

carla::geom::Vector3D AInertialMeasurementUnit::ComputeGyroscope ( )

Gyroscope: measures angular velocity in rad/sec.

Definition at line 146 of file InertialMeasurementUnit.cpp.

References ComputeGyroscopeNoise(), and FIMU_GetActorAngularVelocityInRadians().

Referenced by PostPhysTick().

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

◆ ComputeGyroscopeNoise()

const carla::geom::Vector3D AInertialMeasurementUnit::ComputeGyroscopeNoise ( const FVector &  Gyroscope)

Definition at line 86 of file InertialMeasurementUnit.cpp.

References BiasGyro, URandomEngine::GetNormalDistribution(), ASensor::RandomEngine, and StdDevGyro.

Referenced by ComputeGyroscope().

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

◆ GetAccelerationStandardDeviation()

const FVector & AInertialMeasurementUnit::GetAccelerationStandardDeviation ( ) const

Definition at line 210 of file InertialMeasurementUnit.cpp.

References StdDevAccel.

◆ GetGyroscopeBias()

const FVector & AInertialMeasurementUnit::GetGyroscopeBias ( ) const

Definition at line 220 of file InertialMeasurementUnit.cpp.

References BiasGyro.

◆ GetGyroscopeStandardDeviation()

const FVector & AInertialMeasurementUnit::GetGyroscopeStandardDeviation ( ) const

Definition at line 215 of file InertialMeasurementUnit.cpp.

References StdDevGyro.

◆ GetSensorDefinition()

FActorDefinition AInertialMeasurementUnit::GetSensorDefinition ( )
static

Definition at line 37 of file InertialMeasurementUnit.cpp.

References UActorBlueprintFunctionLibrary::MakeIMUDefinition().

+ Here is the call graph for this function:

◆ PostPhysTick()

void AInertialMeasurementUnit::PostPhysTick ( UWorld *  World,
ELevelTick  TickType,
float  DeltaTime 
)
overridevirtual

Reimplemented from ASensor.

Definition at line 184 of file InertialMeasurementUnit.cpp.

References ComputeAccelerometer(), ComputeCompass(), ComputeGyroscope(), ASensor::GetDataStream(), and ASensor::Stream.

+ Here is the call graph for this function:

◆ Set()

void AInertialMeasurementUnit::Set ( const FActorDescription ActorDescription)
overridevirtual

Reimplemented from ASensor.

Definition at line 42 of file InertialMeasurementUnit.cpp.

References UActorBlueprintFunctionLibrary::SetIMU().

+ Here is the call graph for this function:

◆ SetAccelerationStandardDeviation()

void AInertialMeasurementUnit::SetAccelerationStandardDeviation ( const FVector &  Vec)

Definition at line 195 of file InertialMeasurementUnit.cpp.

References StdDevAccel.

Referenced by UActorBlueprintFunctionLibrary::SetIMU().

+ Here is the caller graph for this function:

◆ SetGyroscopeBias()

void AInertialMeasurementUnit::SetGyroscopeBias ( const FVector &  Vec)

Definition at line 205 of file InertialMeasurementUnit.cpp.

References BiasGyro.

Referenced by UActorBlueprintFunctionLibrary::SetIMU().

+ Here is the caller graph for this function:

◆ SetGyroscopeStandardDeviation()

void AInertialMeasurementUnit::SetGyroscopeStandardDeviation ( const FVector &  Vec)

Definition at line 200 of file InertialMeasurementUnit.cpp.

References StdDevGyro.

Referenced by UActorBlueprintFunctionLibrary::SetIMU().

+ Here is the caller graph for this function:

◆ SetOwner()

void AInertialMeasurementUnit::SetOwner ( AActor Owner)
override

Definition at line 48 of file InertialMeasurementUnit.cpp.

Member Data Documentation

◆ BiasGyro

FVector AInertialMeasurementUnit::BiasGyro
private

Bias for gyroscope settings.

Definition at line 80 of file InertialMeasurementUnit.h.

Referenced by ComputeGyroscopeNoise(), GetGyroscopeBias(), and SetGyroscopeBias().

◆ CarlaNorthVector

const FVector AInertialMeasurementUnit::CarlaNorthVector
static
Initial value:
=
FVector(0.0f, -1.0f, 0.0f)

Based on OpenDRIVE's lon and lat, North is in (0.0f, -1.0f, 0.0f)

Definition at line 67 of file InertialMeasurementUnit.h.

Referenced by ComputeCompass().

◆ PrevDeltaTime

float AInertialMeasurementUnit::PrevDeltaTime
private

Used to compute the acceleration.

Definition at line 86 of file InertialMeasurementUnit.h.

Referenced by AInertialMeasurementUnit(), and ComputeAccelerometer().

◆ PrevLocation

std::array<FVector, 2> AInertialMeasurementUnit::PrevLocation
private

Used to compute the acceleration.

Definition at line 83 of file InertialMeasurementUnit.h.

Referenced by AInertialMeasurementUnit(), and ComputeAccelerometer().

◆ StdDevAccel

FVector AInertialMeasurementUnit::StdDevAccel
private

Standard deviation for acceleration settings.

Definition at line 74 of file InertialMeasurementUnit.h.

Referenced by ComputeAccelerometerNoise(), GetAccelerationStandardDeviation(), and SetAccelerationStandardDeviation().

◆ StdDevGyro

FVector AInertialMeasurementUnit::StdDevGyro
private

Standard deviation for gyroscope settings.

Definition at line 77 of file InertialMeasurementUnit.h.

Referenced by ComputeGyroscopeNoise(), GetGyroscopeStandardDeviation(), and SetGyroscopeStandardDeviation().


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