|
CARLA
|
A fixed-sweep ray-cast Lidar approximating a Hybrid Solid-State LiDAR (e.g. More...
#include <HSSLidar.h>
Inheritance diagram for AHSSLidar:Public Member Functions | |
| AHSSLidar (const FObjectInitializer &ObjectInitializer) | |
| const TArray< float > & | GetTestPointCloud () const |
| virtual void | SendData (const float DeltaTime) override |
| virtual void | Set (const FActorDescription &Description) override |
| virtual void | Set (const FLidarDescription &LidarDescription) override |
| virtual void | SimulateLidar (const float DeltaTime, bool bLockPhysics=true) override |
Public Member Functions inherited from ARayCastSemanticLidar | |
| ARayCastSemanticLidar (const FObjectInitializer &ObjectInitializer) | |
| void | GetMirrorState (carla::multigpu::SensorState &State) const override |
| Multi-GPU: the runtime state this sensor starts its next tick from (noise generator, sweep angle, history). | |
| void | SetMirrorState (const carla::multigpu::SensorState &State) override |
Public Member Functions inherited from ASensor | |
| bool | AreClientsListening () |
| ASensor (const FObjectInitializer &ObjectInitializer) | |
| void | ClearReadyToTick () |
| std::optional< FActorAttribute > | GetAttribute (const FString Name) |
| const UCarlaEpisode & | GetEpisode () const |
| URandomEngine * | GetRandomEngine () |
| float | GetReadyToTickDeltaSeconds () const |
| int32 | GetSeed () const |
| auto | GetToken () const |
| Return the token that allows subscribing to this sensor's stream. | |
| bool | IsReadyToTick () const |
| bool | IsStreamReady () |
| FDataStream | MoveDataStream () |
| virtual void | OnFirstClientConnected () |
| virtual void | OnLastClientDisconnected () |
| virtual void | PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
| void | PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
| virtual void | PrePhysTick (float DeltaSeconds) |
| void | SetDataStream (FDataStream InStream) |
| Replace the FDataStream associated with this sensor. | |
| void | SetEpisode (const UCarlaEpisode &InEpisode) |
| void | SetPrimaryTick (float DeltaSeconds) |
| Multi-GPU secondary: tick in this engine frame, with the primary's delta. | |
| void | SetSavingDataToDisk (bool bSavingData) |
| void | SetSeed (int32 InSeed) |
| void | Tick (const float DeltaTime) final |
Static Public Member Functions | |
| static FActorDefinition | GetSensorDefinition () |
Static Public Member Functions inherited from ARayCastSemanticLidar | |
| static FActorDefinition | GetSensorDefinition () |
Static Public Member Functions inherited from ASensor | |
| static FSensorCaptureContext | MakeCaptureContext (const ASensor &Sensor) |
| Call on the game thread right after CaptureScene(). | |
Private Types | |
| using | FDetection = carla::sensor::data::LidarDetection |
| using | FLidarData = carla::sensor::data::LidarData |
Private Member Functions | |
| void | ComputeAndSaveDetections (const FTransform &SensorTransform) override |
| Copies the per-channel detections into the LidarData structure. | |
| FDetection | ComputeDetection (const FHitResult &HitInfo, const FTransform &InverseSensorTransform) const |
| bool | PostprocessDetection (FDetection &Detection) const |
| void | PreprocessRays (uint32_t Channels, uint32_t MaxPointsPerChannel) override |
| Method that allow to preprocess if the rays will be traced. | |
| void | ResetDetections (uint32_t Channels, uint32_t MaxPointsPerChannel) override |
| Clear the per-channel detection buffers. | |
| void | WriteDetectionAsync (uint32_t Channel, const FHitResult &HitInfo, const FTransform &InverseSensorTransform, const FVector &SensorLocation) override |
| Computes the detection of a hit inside the raycast ParallelFor. | |
Private Attributes | |
| std::vector< std::vector< FDetection > > | Detections |
| float | DropOffAlpha |
| Slope for the intensity dropoff of lidar points: alpha*Intensity + beta where alpha = dropoff_zero_intensity / dropoff_limit and beta = 1 - dropoff_zero_intensity. | |
| float | DropOffBeta |
| bool | DropOffGenActive |
| Enable/Disable general dropoff of lidar points. | |
| FLidarData | LidarData |
| TArray< float > | PointCloudLidarData |
| WITH_EDITOR-only mirror of the point cloud, used by the debug save path. | |
Additional Inherited Members | |
Protected Types inherited from ARayCastSemanticLidar | |
| using | FSemanticDetection = carla::sensor::data::SemanticLidarDetection |
| using | FSemanticLidarData = carla::sensor::data::SemanticLidarData |
Protected Member Functions inherited from ARayCastSemanticLidar | |
| virtual void | BeginPlay () override |
| void | ComputeRawDetection (const FHitResult &HitInfo, const FTransform &InverseSensorTransform, const FVector &SensorLocation, FSemanticDetection &Detection) const |
| Compute all raw detection information. | |
| void | CreateLasers () |
| Creates a Laser for each channel. | |
| virtual void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
| bool | ShootLaser (const float VerticalAngle, float HorizontalAngle, FHitResult &HitResult, FCollisionQueryParams &TraceParams, const FVector &LidarBodyLocation, const FRotator &LidarBodyRotation) const |
| Shoot a laser ray-trace, return whether the laser hit something. | |
Protected Member Functions inherited from ASensor | |
| void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
| template<typename SensorType > | |
| FAsyncDataStream | GetDataStream (SensorType &&Self) |
| Return the FDataStream associated with this sensor. | |
| void | PostActorCreated () override |
Static Protected Member Functions inherited from ARayCastSemanticLidar | |
| template<typename DetectionT , typename LidarDataT , typename PostprocessT > | |
| static void | CompactAndWriteDetections (std::vector< std::vector< DetectionT > > &Detections, std::vector< uint32_t > &OutPointsPerChannel, uint32_t Channels, LidarDataT &LidarData, PostprocessT &&Postprocess) |
| Post-processes the detections channel by channel, drops the rejected ones and writes the rest to LidarData. | |
| template<typename DetectionT > | |
| static void | CopyDetectionsToPointCloud (const std::vector< std::vector< DetectionT > > &Detections, const std::vector< uint32_t > &InPointsPerChannel, TArray< float > &PointCloud) |
| Copies the kept detections into a flat x, y, z, intensity array (editor debug point cloud). | |
| template<typename DetectionT > | |
| static void | ResetChannelDetections (std::vector< std::vector< DetectionT > > &Detections, uint32_t Channels, uint32_t MaxPointsPerChannel) |
| Clears every channel buffer and reserves room for a full scan. | |
Static Protected Member Functions inherited from ASensor | |
| template<typename SensorType , typename ElementType > | |
| static void | SendDataToClient (SensorType &&Sensor, TArrayView< ElementType > SensorData, const FSensorCaptureContext &CaptureContext) |
Protected Attributes inherited from ARayCastSemanticLidar | |
| FLidarDescription | Description |
| TArray< float > | LaserAngles |
| std::vector< uint32_t > | PointsPerChannel |
| std::vector< std::vector< bool > > | RayPreprocessCondition |
Protected Attributes inherited from ASensor | |
| bool | bIsActive = false |
| bool | bSavingDataToDisk = false |
| URandomEngine * | RandomEngine = nullptr |
| Random Engine used to provide noise for sensor output. | |
| int32 | Seed = 123456789 |
| Seed of the pseudo-random engine. | |
A fixed-sweep ray-cast Lidar approximating a Hybrid Solid-State LiDAR (e.g.
Hesai AT128). Unlike ARayCastLidar this sensor does not rotate; each tick it casts a configurable horizontal field of view at a fixed angular resolution centred on the sensor's forward axis.
Definition at line 27 of file HSSLidar.h.
|
private |
Definition at line 32 of file HSSLidar.h.
|
private |
Definition at line 31 of file HSSLidar.h.
| AHSSLidar::AHSSLidar | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 35 of file HSSLidar.cpp.
References ARayCastSemanticLidar::Description, ASensor::RandomEngine, FLidarDescription::RandomSeed, and ASensor::SetSeed().
|
overrideprivatevirtual |
Copies the per-channel detections into the LidarData structure.
Reimplemented from ARayCastSemanticLidar.
Definition at line 166 of file HSSLidar.cpp.
References ASensor::bSavingDataToDisk, FLidarDescription::Channels, ARayCastSemanticLidar::CompactAndWriteDetections(), ARayCastSemanticLidar::CopyDetectionsToPointCloud(), ARayCastSemanticLidar::Description, Detections, LidarData, PointCloudLidarData, and ARayCastSemanticLidar::PointsPerChannel.
Referenced by SimulateLidar().
|
private |
Definition at line 104 of file HSSLidar.cpp.
References FLidarDescription::AtmospAttenRate, ARayCastSemanticLidar::Description, carla::sensor::data::LidarDetection::intensity, carla::geom::Vector3D::Length(), and carla::sensor::data::LidarDetection::point.
Referenced by WriteDetectionAsync().
|
static |
Definition at line 30 of file HSSLidar.cpp.
References UActorBlueprintFunctionLibrary::MakeLidarDefinition().
|
inline |
Definition at line 43 of file HSSLidar.h.
|
private |
Definition at line 140 of file HSSLidar.cpp.
References ARayCastSemanticLidar::Description, DropOffAlpha, DropOffBeta, FLidarDescription::DropOffIntensityLimit, URandomEngine::GetNormalDistribution(), URandomEngine::GetUniformFloat(), carla::sensor::data::LidarDetection::intensity, carla::geom::Vector3D::MakeUnitVector(), FLidarDescription::NoiseStdDev, carla::sensor::data::LidarDetection::point, and ASensor::RandomEngine.
|
overrideprivatevirtual |
Method that allow to preprocess if the rays will be traced.
Reimplemented from ARayCastSemanticLidar.
Definition at line 123 of file HSSLidar.cpp.
References ARayCastSemanticLidar::Description, DropOffGenActive, FLidarDescription::DropOffGenRate, URandomEngine::GetUniformFloat(), ASensor::RandomEngine, and ARayCastSemanticLidar::RayPreprocessCondition.
Referenced by SimulateLidar().
|
overrideprivatevirtual |
Clear the per-channel detection buffers.
Reimplemented from ARayCastSemanticLidar.
Definition at line 155 of file HSSLidar.cpp.
References Detections, and ARayCastSemanticLidar::ResetChannelDetections().
Referenced by SimulateLidar().
|
overridevirtual |
Reimplemented from ARayCastSemanticLidar.
Definition at line 73 of file HSSLidar.cpp.
References carla::streaming::detail::token_type::get_stream_id(), ASensor::GetDataStream(), carla::ros2::ROS2::GetInstance(), ASensor::GetToken(), LidarData, and SendData().
Referenced by SendData().
|
overridevirtual |
Reimplemented from ARayCastSemanticLidar.
Definition at line 42 of file HSSLidar.cpp.
References ASensor::Set(), Set(), and UActorBlueprintFunctionLibrary::SetLidar().
Referenced by Set().
|
overridevirtual |
Reimplemented from ARayCastSemanticLidar.
Definition at line 50 of file HSSLidar.cpp.
References FLidarDescription::Channels, ARayCastSemanticLidar::CreateLasers(), ARayCastSemanticLidar::Description, DropOffAlpha, FLidarDescription::DropOffAtZeroIntensity, DropOffBeta, DropOffGenActive, FLidarDescription::DropOffGenRate, FLidarDescription::DropOffIntensityLimit, LidarData, ARayCastSemanticLidar::PointsPerChannel, FLidarDescription::RandomSeed, and ASensor::SetSeed().
|
overridevirtual |
Reimplemented from ARayCastSemanticLidar.
Definition at line 191 of file HSSLidar.cpp.
References FLidarDescription::Channels, ComputeAndSaveDetections(), ARayCastSemanticLidar::Description, FLidarDescription::HorizontalFov, FLidarDescription::HorizontalResolution, ARayCastSemanticLidar::LaserAngles, PreprocessRays(), ARayCastSemanticLidar::RayPreprocessCondition, ResetDetections(), ARayCastSemanticLidar::ShootLaser(), SimulateLidar(), SnapToStep(), and WriteDetectionAsync().
Referenced by SimulateLidar().
|
overrideprivatevirtual |
Computes the detection of a hit inside the raycast ParallelFor.
Reimplemented from ARayCastSemanticLidar.
Definition at line 160 of file HSSLidar.cpp.
References ComputeDetection(), DEBUG_ASSERT, and Detections.
Referenced by SimulateLidar().
|
private |
Definition at line 59 of file HSSLidar.h.
Referenced by ComputeAndSaveDetections(), ResetDetections(), and WriteDetectionAsync().
|
private |
Slope for the intensity dropoff of lidar points: alpha*Intensity + beta where alpha = dropoff_zero_intensity / dropoff_limit and beta = 1 - dropoff_zero_intensity.
Definition at line 67 of file HSSLidar.h.
Referenced by PostprocessDetection(), and Set().
|
private |
Definition at line 68 of file HSSLidar.h.
Referenced by PostprocessDetection(), and Set().
|
private |
Enable/Disable general dropoff of lidar points.
Definition at line 62 of file HSSLidar.h.
Referenced by PreprocessRays(), and Set().
|
private |
Definition at line 57 of file HSSLidar.h.
Referenced by ComputeAndSaveDetections(), SendData(), and Set().
|
private |
WITH_EDITOR-only mirror of the point cloud, used by the debug save path.
Definition at line 71 of file HSSLidar.h.
Referenced by ComputeAndSaveDetections().