Open 3D Engine ROS2 Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ROS2::LidarRaycasterRequests Class Referenceabstract

Interface class that allows for communication with a single Lidar instance. More...

#include <LidarRaycasterBus.h>

Public Member Functions

 AZ_RTTI (LidarRaycasterRequests, "{253a02c8-b6cb-493c-b16f-012ccf9db226}")
 
virtual void ConfigureRayOrientations (const AZStd::vector< AZ::Vector3 > &orientations)=0
 
virtual void ConfigureRayRange (float range)=0
 
virtual void ConfigureMinimumRayRange (float range)
 
virtual void ConfigureRaycastResultFlags (RaycastResultFlags flags)
 
virtual RaycastResult PerformRaycast (const AZ::Transform &lidarTransform)=0
 
virtual void ConfigureNoiseParameters (float angularNoiseStdDev, float distanceNoiseStdDevBase, float distanceNoiseStdDevRisePerMeter)
 
virtual void ConfigureIgnoredCollisionLayers (const AZStd::unordered_set< AZ::u32 > &layerIndices)
 
virtual void ExcludeEntities (const AZStd::vector< AZ::EntityId > &excludedEntities)
 
virtual void ConfigureMaxRangePointAddition (bool addMaxRangePoints)
 
virtual void ConfigurePointCloudPublisher (const AZStd::string &topicName, const AZStd::string &frameId, const QoS &qoSPolicy)
 
virtual void UpdatePublisherTimestamp (AZ::u64 timestampNanoseconds)
 
virtual bool CanHandlePublishing ()
 

Static Protected Member Functions

static void ValidateRayRange (float range)
 
static void ValidateRayOrientations (const AZStd::vector< AZ::Vector3 > &orientations)
 

Detailed Description

Interface class that allows for communication with a single Lidar instance.

Member Function Documentation

◆ CanHandlePublishing()

virtual bool ROS2::LidarRaycasterRequests::CanHandlePublishing ( )
inlinevirtual

Can the raycaster handle publishing? This function should be called after the raycaster has been configured. The raycaster may not be able to handle point-cloud publishing in certain configurations (e.g. when the maxPointAddition is selected) in which case publishing must be handled somewhere else (e.g. by the ROS2LidarComponent).

◆ ConfigureIgnoredCollisionLayers()

virtual void ROS2::LidarRaycasterRequests::ConfigureIgnoredCollisionLayers ( const AZStd::unordered_set< AZ::u32 > &  layerIndices)
inlinevirtual

Configures which collision layers should be ignored.

Parameters
layerIndicesIndices of collision layers to be ignored.

◆ ConfigureMaxRangePointAddition()

virtual void ROS2::LidarRaycasterRequests::ConfigureMaxRangePointAddition ( bool  addMaxRangePoints)
inlinevirtual

Configures max range point addition.

Parameters
includeMaxRangeShould the raycaster add points at max range for rays that exceeded their range?

◆ ConfigureMinimumRayRange()

virtual void ROS2::LidarRaycasterRequests::ConfigureMinimumRayRange ( float  range)
inlinevirtual

Configures ray minimum travel distance.

Parameters
rangeRay range in meters.

◆ ConfigureNoiseParameters()

virtual void ROS2::LidarRaycasterRequests::ConfigureNoiseParameters ( float  angularNoiseStdDev,
float  distanceNoiseStdDevBase,
float  distanceNoiseStdDevRisePerMeter 
)
inlinevirtual

Configures ray Gaussian Noise parameters. Each call overrides the previous configuration. This type of noise is especially useful when trying to simulate real-life lidars, since its noise mimics the imperfections arising due to various physical factors e.g. fluctuations in rotary motion of the lidar (angular noise) or distance accuracy (distance noise). For the the details about Gaussian noise, please refer to https://en.wikipedia.org/wiki/Gaussian_noise.

Parameters
angularNoiseStdDevAngular noise standard deviation.
distanceNoiseStdDevBaseBase value for Distance noise standard deviation.
distanceNoiseStdDevRisePerMeterValue by which the distance noise standard deviation increases per meter length from the lidar.

◆ ConfigurePointCloudPublisher()

virtual void ROS2::LidarRaycasterRequests::ConfigurePointCloudPublisher ( const AZStd::string &  topicName,
const AZStd::string &  frameId,
const QoS qoSPolicy 
)
inlinevirtual

Enables and configures raycaster-side Point Cloud Publisher. If not called, no publishing (raycaster-side) is performed. For some implementations it might be beneficial to publish internally (e.g. for the RGL gem, published points can be transformed from global to sensor coordinates on the GPU and published without unnecessary data copying or CPU manipulation) This API enables raycaster implementations that also handle publishing and provides them with necessary publisher configuration.

Parameters
topicNameName of the ROS 2 topic the pointcloud is published on.
frameIdId of the ROS 2 frame of the sensor.
qoSPolicyQoS policy of published pointcloud messages.

◆ ConfigureRaycastResultFlags()

virtual void ROS2::LidarRaycasterRequests::ConfigureRaycastResultFlags ( RaycastResultFlags  flags)
inlinevirtual

Configures result flags.

Parameters
flagsRaycast result flags define set of data types returned by lidar.

◆ ConfigureRayOrientations()

virtual void ROS2::LidarRaycasterRequests::ConfigureRayOrientations ( const AZStd::vector< AZ::Vector3 > &  orientations)
pure virtual

Configures ray orientations.

Parameters
orientationsVector of orientations as Euler angles in radians. Each ray direction is computed by transforming a unit vector in the positive z direction first by the y, next by the z axis. The x axis is currently not included in calculations.

◆ ConfigureRayRange()

virtual void ROS2::LidarRaycasterRequests::ConfigureRayRange ( float  range)
pure virtual

Configures ray maximum travel distance.

Parameters
rangeRay range in meters.

◆ ExcludeEntities()

virtual void ROS2::LidarRaycasterRequests::ExcludeEntities ( const AZStd::vector< AZ::EntityId > &  excludedEntities)
inlinevirtual

Excludes entities with given EntityIds from raycasting.

Parameters
excludedEntitiesList of entities marked for exclusion.

◆ PerformRaycast()

virtual RaycastResult ROS2::LidarRaycasterRequests::PerformRaycast ( const AZ::Transform &  lidarTransform)
pure virtual

Schedules a raycast that originates from the point described by the lidarTransform.

Parameters
lidarTransformCurrent transform from global to lidar reference frame.
flagsUsed to request different kinds of data returned by raycast query
Returns
Results of the raycast in the requested form including 3D space coordinates and/or ranges.

◆ UpdatePublisherTimestamp()

virtual void ROS2::LidarRaycasterRequests::UpdatePublisherTimestamp ( AZ::u64  timestampNanoseconds)
inlinevirtual

Updates the timestamp of the messages published by the raycaster.

Parameters
timestampNanosecondstimestamp in nanoseconds (Time.msg: sec = timestampNanoseconds / 10^9; nanosec = timestampNanoseconds mod 10^9).

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