Small optimization
This commit is contained in:
parent
64183b025a
commit
c8ee455b05
|
@ -46,6 +46,7 @@ void ARayCastLidar::Set(const FLidarDescription &LidarDescription)
|
|||
Description = LidarDescription;
|
||||
LidarData = FLidarData(Description.Channels);
|
||||
CreateLasers();
|
||||
PointsPerChannel.resize(Description.Channels);
|
||||
|
||||
// Compute drop off model parameters
|
||||
DropOffBeta = 1.0f - Description.DropOffAtZeroIntensity;
|
||||
|
@ -117,8 +118,6 @@ ARayCastLidar::FDetection ARayCastLidar::ComputeDetection(const FHitResult& HitI
|
|||
}
|
||||
|
||||
void ARayCastLidar::ComputeAndSaveDetections(const FTransform& SensorTransform) {
|
||||
std::vector<uint32_t> PointsPerChannel(Description.Channels);
|
||||
|
||||
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel)
|
||||
PointsPerChannel[idxChannel] = RecordedHits[idxChannel].size();
|
||||
LidarData.ResetSerPoints(PointsPerChannel);
|
||||
|
|
|
@ -43,6 +43,7 @@ void ARayCastRawLidar::Set(const FLidarDescription &LidarDescription)
|
|||
Description = LidarDescription;
|
||||
LidarRawData = FLidarRawData(Description.Channels);
|
||||
CreateLasers();
|
||||
PointsPerChannel.resize(Description.Channels);
|
||||
}
|
||||
|
||||
void ARayCastRawLidar::CreateLasers()
|
||||
|
@ -138,8 +139,6 @@ void ARayCastRawLidar::SimulateLidar(const float DeltaTime)
|
|||
}
|
||||
|
||||
void ARayCastRawLidar::ComputeAndSaveDetections(const FTransform& SensorTransform) {
|
||||
std::vector<uint32_t> PointsPerChannel(Description.Channels);
|
||||
|
||||
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel)
|
||||
PointsPerChannel[idxChannel] = RecordedHits[idxChannel].size();
|
||||
LidarRawData.ResetSerPoints(PointsPerChannel);
|
||||
|
|
|
@ -77,6 +77,7 @@ protected:
|
|||
TArray<float> LaserAngles;
|
||||
|
||||
std::vector<std::vector<FHitResult>> RecordedHits;
|
||||
std::vector<uint32_t> PointsPerChannel;
|
||||
|
||||
private:
|
||||
FLidarRawData LidarRawData;
|
||||
|
|
Loading…
Reference in New Issue