CARLA
Loading...
Searching...
No Matches
HSSLidar.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9
12#include "Carla/Sensor/Sensor.h"
15
19
20#include "HSSLidar.generated.h"
21
22/// A fixed-sweep ray-cast Lidar approximating a Hybrid Solid-State LiDAR
23/// (e.g. Hesai AT128). Unlike ARayCastLidar this sensor does not rotate; each
24/// tick it casts a configurable horizontal field of view at a fixed angular
25/// resolution centred on the sensor's forward axis.
26UCLASS()
27class CARLA_API AHSSLidar : public ARayCastSemanticLidar
28{
29 GENERATED_BODY()
30
31 using FLidarData = carla::sensor::data::LidarData;
32 using FDetection = carla::sensor::data::LidarDetection;
33
34public:
35 static FActorDefinition GetSensorDefinition();
36
37 AHSSLidar(const FObjectInitializer &ObjectInitializer);
38 virtual void Set(const FActorDescription &Description) override;
39 virtual void Set(const FLidarDescription &LidarDescription) override;
40
41 virtual void SendData(const float DeltaTime) override;
42
43 const TArray<float>& GetTestPointCloud() const { return PointCloudLidarData; };
44
45 virtual void SimulateLidar(const float DeltaTime, bool bLockPhysics = true) override;
46
47private:
48 FDetection ComputeDetection(const FHitResult& HitInfo, const FTransform& InverseSensorTransform) const;
49
50 void PreprocessRays(uint32_t Channels, uint32_t MaxPointsPerChannel) override;
51 bool PostprocessDetection(FDetection& Detection) const;
52
53 void WriteDetectionAsync(uint32_t Channel, const FHitResult& HitInfo, const FTransform& InverseSensorTransform, const FVector& SensorLocation) override;
54 void ResetDetections(uint32_t Channels, uint32_t MaxPointsPerChannel) override;
55 void ComputeAndSaveDetections(const FTransform& SensorTransform) override;
56
58
59 std::vector<std::vector<FDetection>> Detections;
60
61 /// Enable/Disable general dropoff of lidar points.
63
64 /// Slope for the intensity dropoff of lidar points: alpha*Intensity + beta
65 /// where alpha = dropoff_zero_intensity / dropoff_limit and
66 /// beta = 1 - dropoff_zero_intensity.
69
70 /// WITH_EDITOR-only mirror of the point cloud, used by the debug save path.
71 TArray<float> PointCloudLidarData;
72};
A fixed-sweep ray-cast Lidar approximating a Hybrid Solid-State LiDAR (e.g.
Definition HSSLidar.h:28
float DropOffAlpha
Slope for the intensity dropoff of lidar points: alpha*Intensity + beta where alpha = dropoff_zero_in...
Definition HSSLidar.h:67
FLidarData LidarData
Definition HSSLidar.h:57
float DropOffBeta
Definition HSSLidar.h:68
std::vector< std::vector< FDetection > > Detections
Definition HSSLidar.h:59
bool DropOffGenActive
Enable/Disable general dropoff of lidar points.
Definition HSSLidar.h:62
TArray< float > PointCloudLidarData
WITH_EDITOR-only mirror of the point cloud, used by the debug save path.
Definition HSSLidar.h:71
A ray-cast based Lidar sensor.
Helper class to store and serialize the data generated by a Lidar.
Definition LidarData.h:54
This file contains definitions of common data structures used in traffic manager.
A definition of a Carla Actor with all the variation and attributes.
A description of a Carla Actor with all its variation.