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)
 
boost::optional< FActorAttributeGetAttribute (const FString Name)
 
const UCarlaEpisodeGetEpisode () const
 
URandomEngineGetRandomEngine ()
 
int32 GetSeed () const
 
auto GetToken () const
 Return the token that allows subscribing to this sensor's stream. More...
 
bool IsStreamReady ()
 
FDataStream MoveDataStream ()
 
virtual void OnFirstClientConnected ()
 
virtual void OnLastClientDisconnected ()
 
void PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds)
 
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...
 
void PostActorCreated () override
 
- Protected Attributes inherited from ASensor
bool bIsActive = false
 
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 25 of file InertialMeasurementUnit.cpp.

References PrevDeltaTime, PrevLocation, and ASensor::RandomEngine.

Member Function Documentation

◆ BeginPlay()

void AInertialMeasurementUnit::BeginPlay ( )
overrideprivatevirtual

Reimplemented from ASensor.

Definition at line 249 of file InertialMeasurementUnit.cpp.

◆ ComputeAccelerometer()

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

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

Definition at line 102 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 73 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 167 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 147 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 87 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 234 of file InertialMeasurementUnit.cpp.

References StdDevAccel.

◆ GetGyroscopeBias()

const FVector & AInertialMeasurementUnit::GetGyroscopeBias ( ) const

Definition at line 244 of file InertialMeasurementUnit.cpp.

References BiasGyro.

◆ GetGyroscopeStandardDeviation()

const FVector & AInertialMeasurementUnit::GetGyroscopeStandardDeviation ( ) const

Definition at line 239 of file InertialMeasurementUnit.cpp.

References StdDevGyro.

◆ GetSensorDefinition()

FActorDefinition AInertialMeasurementUnit::GetSensorDefinition ( )
static

Definition at line 38 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 185 of file InertialMeasurementUnit.cpp.

References ComputeAccelerometer(), ComputeCompass(), ComputeGyroscope(), carla::streaming::detail::token_type::get_stream_id(), ASensor::GetDataStream(), carla::ros2::ROS2::GetInstance(), FDataStreamTmpl< T >::GetSensorType(), ASensor::GetToken(), 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 43 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 219 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 229 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 224 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 49 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: