RapyutaSimulationPlugins
Public Member Functions | Public Attributes | List of all members
URR3DLidarComponent Class Reference

ROS 2 3D lidar components. More...

#include <RR3DLidarComponent.h>

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

Public Member Functions

 URR3DLidarComponent ()
 Construct a new URR3DLidarComponent object. More...
 
virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 async: Update RecordedHits from TraceHandles which is update in SensorUpdate. More...
 
void Run () override
 sync: Initialize #FHitResult More...
 
void SensorUpdate () override
 Get Lidar data, add noise, draw lidar rays. More...
 
bool Visible (AActor *TargetActor) override
 Return true if laser hits the target actor. More...
 
FROSPointCloud2 GetROS2Data ()
 Create ROS 2 Msg structure from RecordedHits. More...
 
virtual void SetROS2Msg (UROS2GenericMsg *InMessage) override
 Set result of GetROS2Data to InMessage. More...
 
uint64 GetTotalScan () const
 Get the Total Scan object. More...
 
- Public Member Functions inherited from URRBaseLidarComponent
 URRBaseLidarComponent ()
 
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 Stop ()
 Stop timer to update and publish sensor data by using ClearTimer. More...
 

Public Attributes

int32 NChannelsPerScan = 32
 
float StartVerticalAngle = -45.f
 [degrees] More...
 
float FOVVertical = 90.f
 [degrees] More...
 
bool bOrganizedCloud = false
 Data is organized or not. More...
 
float DVAngle = 0.f
 [degrees] More...
 
- Public Attributes inherited from URRBaseLidarComponent
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
 

Additional Inherited Members

- Protected Member Functions inherited from URRBaseLidarComponent
virtual void BeginPlay () override
 
FLinearColor InterpolateColor (float InX)
 
- Static Protected Member Functions inherited from URRBaseLidarComponent
static float GetIntensityFromDist (float InBaseIntensity, float InDistance)
 
- Protected Attributes inherited from URRBaseLidarComponent
float Dt = 0.f
 
- Protected Attributes inherited from URRROS2BaseSensorComponent
FTimerHandle TimerHandle
 

Detailed Description

ROS 2 3D lidar components.

This class has 2 types of implementation, async and sync which can be switched by define TRACE_ASYNC.

sync uses LineTraceSingleByChannel and async uses AsyncLineTraceByChannel.

See also
LineTraceSingleByChannel
AsyncLineTraceByChannel

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

Constructor & Destructor Documentation

◆ URR3DLidarComponent()

URR3DLidarComponent::URR3DLidarComponent ( )

Construct a new URR3DLidarComponent object.

Member Function Documentation

◆ GetROS2Data()

FROSPointCloud2 URR3DLidarComponent::GetROS2Data ( )

Create ROS 2 Msg structure from RecordedHits.

This should probably be removed so that the sensor can be decoupled from the message types

Returns
FROSPointCloud2

UFUNCTION(BlueprintCallable)

◆ GetTotalScan()

uint64 URR3DLidarComponent::GetTotalScan ( ) const
inline

Get the Total Scan object.

Returns
uint64 NSamplesPerScan * NChannelsPerScan

◆ Run()

void URR3DLidarComponent::Run ( )
overridevirtual

sync: Initialize #FHitResult

async: Initialize #FTraceHandle

Reimplemented from URRROS2BaseSensorComponent.

◆ SensorUpdate()

void URR3DLidarComponent::SensorUpdate ( )
overridevirtual

Get Lidar data, add noise, draw lidar rays.

sync : Uses LineTraceSingleByChannel to get lidar data.

async : Uses AsyncLineTraceByChannel to get lidar data.

See also
LineTraceSingleByChannel
AsyncLineTraceByChannel

Reimplemented from URRROS2BaseSensorComponent.

◆ SetROS2Msg()

virtual void URR3DLidarComponent::SetROS2Msg ( UROS2GenericMsg *  InMessage)
overridevirtual

Set result of GetROS2Data to InMessage.

Parameters
InMessage

Reimplemented from URRROS2BaseSensorComponent.

◆ TickComponent()

virtual void URR3DLidarComponent::TickComponent ( float  DeltaTime,
enum ELevelTick  TickType,
FActorComponentTickFunction *  ThisTickFunction 
)
overridevirtual

async: Update RecordedHits from TraceHandles which is update in SensorUpdate.

Parameters
DeltaTime
TickType
ThisTickFunction

◆ Visible()

bool URR3DLidarComponent::Visible ( AActor *  TargetActor)
overridevirtual

Return true if laser hits the target actor.

Parameters
TargetActor
Returns
true
false

Reimplemented from URRBaseLidarComponent.

Member Data Documentation

◆ bOrganizedCloud

bool URR3DLidarComponent::bOrganizedCloud = false

Data is organized or not.

false: height=1, width=data size true: height=NChannelsPerScan, width=NSamplesPerScan

UPROPERTY(VisibleAnywhere, BlueprintReadOnly)

◆ DVAngle

float URR3DLidarComponent::DVAngle = 0.f

◆ FOVVertical

float URR3DLidarComponent::FOVVertical = 90.f

◆ NChannelsPerScan

int32 URR3DLidarComponent::NChannelsPerScan = 32

◆ StartVerticalAngle

float URR3DLidarComponent::StartVerticalAngle = -45.f

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