#include <InertialMeasurementUnit.h>
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< FActorAttribute > | GetAttribute (const FString Name) |
const UCarlaEpisode & | GetEpisode () const |
URandomEngine * | GetRandomEngine () |
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 |
URandomEngine * | RandomEngine = nullptr |
Random Engine used to provide noise for sensor output. More... | |
int32 | Seed = 123456789 |
Seed of the pseudo-random engine. More... | |
Definition at line 23 of file InertialMeasurementUnit.h.
AInertialMeasurementUnit::AInertialMeasurementUnit | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 25 of file InertialMeasurementUnit.cpp.
References PrevDeltaTime, PrevLocation, and ASensor::RandomEngine.
|
overrideprivatevirtual |
Reimplemented from ASensor.
Definition at line 249 of file InertialMeasurementUnit.cpp.
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().
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().
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().
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().
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().
const FVector & AInertialMeasurementUnit::GetAccelerationStandardDeviation | ( | ) | const |
Definition at line 234 of file InertialMeasurementUnit.cpp.
References StdDevAccel.
const FVector & AInertialMeasurementUnit::GetGyroscopeBias | ( | ) | const |
Definition at line 244 of file InertialMeasurementUnit.cpp.
References BiasGyro.
const FVector & AInertialMeasurementUnit::GetGyroscopeStandardDeviation | ( | ) | const |
Definition at line 239 of file InertialMeasurementUnit.cpp.
References StdDevGyro.
|
static |
Definition at line 38 of file InertialMeasurementUnit.cpp.
References UActorBlueprintFunctionLibrary::MakeIMUDefinition().
|
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.
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 43 of file InertialMeasurementUnit.cpp.
References UActorBlueprintFunctionLibrary::SetIMU().
void AInertialMeasurementUnit::SetAccelerationStandardDeviation | ( | const FVector & | Vec | ) |
Definition at line 219 of file InertialMeasurementUnit.cpp.
References StdDevAccel.
Referenced by UActorBlueprintFunctionLibrary::SetIMU().
void AInertialMeasurementUnit::SetGyroscopeBias | ( | const FVector & | Vec | ) |
Definition at line 229 of file InertialMeasurementUnit.cpp.
References BiasGyro.
Referenced by UActorBlueprintFunctionLibrary::SetIMU().
void AInertialMeasurementUnit::SetGyroscopeStandardDeviation | ( | const FVector & | Vec | ) |
Definition at line 224 of file InertialMeasurementUnit.cpp.
References StdDevGyro.
Referenced by UActorBlueprintFunctionLibrary::SetIMU().
|
override |
Definition at line 49 of file InertialMeasurementUnit.cpp.
|
private |
Bias for gyroscope settings.
Definition at line 80 of file InertialMeasurementUnit.h.
Referenced by ComputeGyroscopeNoise(), GetGyroscopeBias(), and SetGyroscopeBias().
|
static |
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().
|
private |
Used to compute the acceleration.
Definition at line 86 of file InertialMeasurementUnit.h.
Referenced by AInertialMeasurementUnit(), and ComputeAccelerometer().
|
private |
Used to compute the acceleration.
Definition at line 83 of file InertialMeasurementUnit.h.
Referenced by AInertialMeasurementUnit(), and ComputeAccelerometer().
|
private |
Standard deviation for acceleration settings.
Definition at line 74 of file InertialMeasurementUnit.h.
Referenced by ComputeAccelerometerNoise(), GetAccelerationStandardDeviation(), and SetAccelerationStandardDeviation().
|
private |
Standard deviation for gyroscope settings.
Definition at line 77 of file InertialMeasurementUnit.h.
Referenced by ComputeGyroscopeNoise(), GetGyroscopeStandardDeviation(), and SetGyroscopeStandardDeviation().