RapyutaSimulationPlugins
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
URRBaseLidarComponent Class Reference

Base ROS 2 LIDAR Component class. Other lidar class should inherit from this class. More...

#include <RRBaseLidarComponent.h>

Inheritance diagram for URRBaseLidarComponent:
Inheritance graph
[legend]
Collaboration diagram for URRBaseLidarComponent:
Collaboration graph
[legend]

Public Member Functions

 URRBaseLidarComponent ()
 
virtual bool Visible (AActor *TargetActor)
 Return true if laser hits the target actor. This method should be overwritten by child class. More...
 
void GetData (TArray< FHitResult > &OutHits, float &OutTime) const
 Get RecordedHits and TimeOfLastScan. More...
 
FLinearColor InterpColorFromIntensity (const float InIntensity)
 
- Public Member Functions inherited from URRROS2BaseSensorComponent
 URRROS2BaseSensorComponent ()
 Construct a new URRROS2BaseSensorComponent object. More...
 
virtual void InitalizeWithROS2 (UROS2NodeComponent *InROS2Node, const FString &InPublisherName=TEXT(""), const FString &InTopicName=TEXT(""), const UROS2QoS InQoS=UROS2QoS::SensorData)
 Create and initialize publisher and start sensor update by calling. More...
 
virtual void CreatePublisher (const FString &InPublisherName=TEXT(""))
 Create a Publisher with SensorPublisherClass. More...
 
virtual void PreInitializePublisher (UROS2NodeComponent *InROS2Node, const FString &InTopicName=TEXT(""))
 Set publish frequency, topic name and FrameId. More...
 
virtual void InitializePublisher (UROS2NodeComponent *InROS2Node, const UROS2QoS InQoS=UROS2QoS::SensorData)
 Initialize Sensorpublisher by using UROS2Publisher's methods. More...
 
virtual void Run ()
 Start timer to update and publish sensor data by using SetTimer. More...
 
virtual void Stop ()
 Stop timer to update and publish sensor data by using ClearTimer. More...
 
virtual void SensorUpdate ()
 Update Sensor data. This method should be overwritten by child class. More...
 
virtual void SetROS2Msg (UROS2GenericMsg *InMessage)
 Set sensor data to ROS 2 msg. This method should be overwritten by child class. More...
 

Public Attributes

int32 NSamplesPerScan = 360
 
float StartAngle = 0.f
 [degrees] scan goes from StartAngle to StartAngle+FOVHorizontal More...
 
float FOVHorizontal = 360.f
 [degrees] scan goes from StartAngle to StartAngle+FOVHorizontal More...
 
float MinRange = 12.f
 [m] More...
 
float MaxRange = 350.f
 [m] More...
 
TEnumAsByte< ECollisionChannel > TraceCollisionChannel = ECC_Visibility
 
bool bIgnoreSelf = false
 
FLinearColor ColorMiss = FColor(255, 127, 0, 255)
 
FLinearColor ColorMin = FColor(255, 0, 0, 255)
 
FLinearColor ColorMid = FColor(255, 0, 0, 255)
 
FColor ColorMax = FColor(255, 255, 255, 255)
 
float TimeOfLastScan = 0.f
 
float DHAngle = 0.f
 
TObjectPtr< URRGaussianNoisePositionNoise
 
TObjectPtr< URRGaussianNoiseIntensityNoise
 
float PositionalNoiseMean = 0.f
 
float PositionalNoiseVariance = 1.f
 
float IntensityNoiseMean = 0.f
 
float IntensityNoiseVariance = .01f
 
uint8 BWithNoise: 1
 
TArray< FHitResult > RecordedHits
 
TArray< FTraceHandle > TraceHandles
 
bool bShowLidarRays = true
 
bool ShowLidarRayMisses = false
 
uint8 DrawPointDepthIntensity = 0
 DepthIntesity of DrawPoint. More...
 
float IntensityNonReflective = 1000.f
 
float IntensityReflective = 6000.f
 
float IntensityMin = 0.f
 
float IntensityMax = 10000.f
 
- Public Attributes inherited from URRROS2BaseSensorComponent
TSubclassOf< UROS2Publisher > SensorPublisherClass = URRROS2BaseSensorPublisher::StaticClass()
 
URRROS2BaseSensorPublisherSensorPublisher = nullptr
 
TSubclassOf< UROS2GenericMsg > MsgClass = UROS2GenericMsg::StaticClass()
 
FString TopicName = TEXT("sensor_data")
 
FString FrameId = TEXT("sensor_frame")
 
int32 PublicationFrequencyHz = 30
 
bool bAppendNodeNamespace = true
 Append namespace to FrameId or not. More...
 
bool bIsValid = true
 

Protected Member Functions

virtual void BeginPlay () override
 
FLinearColor InterpolateColor (float InX)
 

Static Protected Member Functions

static float GetIntensityFromDist (float InBaseIntensity, float InDistance)
 

Protected Attributes

float Dt = 0.f
 
- Protected Attributes inherited from URRROS2BaseSensorComponent
FTimerHandle TimerHandle
 

Detailed Description

Base ROS 2 LIDAR Component class. Other lidar class should inherit from this class.

UCLASS(ClassGroup = (Custom), Blueprintable, meta = (BlueprintSpawnableComponent))

Constructor & Destructor Documentation

◆ URRBaseLidarComponent()

URRBaseLidarComponent::URRBaseLidarComponent ( )

Member Function Documentation

◆ BeginPlay()

virtual void URRBaseLidarComponent::BeginPlay ( )
overrideprotectedvirtual

◆ GetData()

void URRBaseLidarComponent::GetData ( TArray< FHitResult > &  OutHits,
float &  OutTime 
) const

Get RecordedHits and TimeOfLastScan.

adding the rest of the necessary information might be tedious

eventually split into multiple getters

Parameters
OutHits
OutTime

UFUNCTION(BlueprintCallable)

◆ GetIntensityFromDist()

static float URRBaseLidarComponent::GetIntensityFromDist ( float  InBaseIntensity,
float  InDistance 
)
staticprotected

◆ InterpColorFromIntensity()

FLinearColor URRBaseLidarComponent::InterpColorFromIntensity ( const float  InIntensity)

◆ InterpolateColor()

FLinearColor URRBaseLidarComponent::InterpolateColor ( float  InX)
protected

◆ Visible()

virtual bool URRBaseLidarComponent::Visible ( AActor *  TargetActor)
inlinevirtual

Return true if laser hits the target actor. This method should be overwritten by child class.

Parameters
TargetActor
Returns
true
false

UFUNCTION(BlueprintCallable)

Reimplemented in URR2DLidarComponent, and URR3DLidarComponent.

Member Data Documentation

◆ bIgnoreSelf

bool URRBaseLidarComponent::bIgnoreSelf = false

◆ bShowLidarRays

bool URRBaseLidarComponent::bShowLidarRays = true

◆ BWithNoise

uint8 URRBaseLidarComponent::BWithNoise

◆ ColorMax

FColor URRBaseLidarComponent::ColorMax = FColor(255, 255, 255, 255)

◆ ColorMid

FLinearColor URRBaseLidarComponent::ColorMid = FColor(255, 0, 0, 255)

◆ ColorMin

FLinearColor URRBaseLidarComponent::ColorMin = FColor(255, 0, 0, 255)

◆ ColorMiss

FLinearColor URRBaseLidarComponent::ColorMiss = FColor(255, 127, 0, 255)

◆ DHAngle

float URRBaseLidarComponent::DHAngle = 0.f

◆ DrawPointDepthIntensity

uint8 URRBaseLidarComponent::DrawPointDepthIntensity = 0

◆ Dt

float URRBaseLidarComponent::Dt = 0.f
protected

◆ FOVHorizontal

float URRBaseLidarComponent::FOVHorizontal = 360.f

[degrees] scan goes from StartAngle to StartAngle+FOVHorizontal

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ IntensityMax

float URRBaseLidarComponent::IntensityMax = 10000.f

◆ IntensityMin

float URRBaseLidarComponent::IntensityMin = 0.f

◆ IntensityNoise

TObjectPtr<URRGaussianNoise> URRBaseLidarComponent::IntensityNoise

◆ IntensityNoiseMean

float URRBaseLidarComponent::IntensityNoiseMean = 0.f

◆ IntensityNoiseVariance

float URRBaseLidarComponent::IntensityNoiseVariance = .01f

◆ IntensityNonReflective

float URRBaseLidarComponent::IntensityNonReflective = 1000.f

◆ IntensityReflective

float URRBaseLidarComponent::IntensityReflective = 6000.f

◆ MaxRange

float URRBaseLidarComponent::MaxRange = 350.f

◆ MinRange

float URRBaseLidarComponent::MinRange = 12.f

◆ NSamplesPerScan

int32 URRBaseLidarComponent::NSamplesPerScan = 360

◆ PositionalNoiseMean

float URRBaseLidarComponent::PositionalNoiseMean = 0.f

◆ PositionalNoiseVariance

float URRBaseLidarComponent::PositionalNoiseVariance = 1.f

◆ PositionNoise

TObjectPtr<URRGaussianNoise> URRBaseLidarComponent::PositionNoise

◆ RecordedHits

TArray<FHitResult> URRBaseLidarComponent::RecordedHits

◆ ShowLidarRayMisses

bool URRBaseLidarComponent::ShowLidarRayMisses = false

◆ StartAngle

float URRBaseLidarComponent::StartAngle = 0.f

[degrees] scan goes from StartAngle to StartAngle+FOVHorizontal

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ TimeOfLastScan

float URRBaseLidarComponent::TimeOfLastScan = 0.f

◆ TraceCollisionChannel

TEnumAsByte<ECollisionChannel> URRBaseLidarComponent::TraceCollisionChannel = ECC_Visibility

◆ TraceHandles

TArray<FTraceHandle> URRBaseLidarComponent::TraceHandles

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