Minor formatting corrections

This commit is contained in:
Daniel Santos-Olivan 2020-07-31 00:28:43 +02:00 committed by bernat
parent 96d0ae27e6
commit a131e16ddb
1 changed files with 24 additions and 24 deletions

View File

@ -125,32 +125,32 @@ void ARayCastSemanticLidar::SimulateLidar(const float DeltaTime)
SemanticLidarData.SetHorizontalAngle(HorizontalAngle);
}
void ARayCastSemanticLidar::ResetRecordedHits(uint32_t Channels, uint32_t MaxPointsPerChannel) {
RecordedHits.resize(Channels);
for (auto& aux : RecordedHits) {
aux.clear();
aux.reserve(MaxPointsPerChannel);
}
}
void ARayCastSemanticLidar::WritePointAsync(uint32_t channel, FHitResult &detection) {
DEBUG_ASSERT(GetChannelCount() > channel);
RecordedHits[channel].emplace_back(detection);
}
void ARayCastSemanticLidar::ComputeAndSaveDetections(const FTransform& SensorTransform) {
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel)
PointsPerChannel[idxChannel] = RecordedHits[idxChannel].size();
SemanticLidarData.ResetSerPoints(PointsPerChannel);
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel) {
for (auto& hit : RecordedHits[idxChannel]) {
FSemanticDetection detection;
ComputeRawDetection(hit, SensorTransform, detection);
SemanticLidarData.WritePointSync(detection);
}
void ARayCastSemanticLidar::ResetRecordedHits(uint32_t Channels, uint32_t MaxPointsPerChannel) {
RecordedHits.resize(Channels);
for (auto& aux : RecordedHits) {
aux.clear();
aux.reserve(MaxPointsPerChannel);
}
}
void ARayCastSemanticLidar::WritePointAsync(uint32_t channel, FHitResult &detection) {
DEBUG_ASSERT(GetChannelCount() > channel);
RecordedHits[channel].emplace_back(detection);
}
void ARayCastSemanticLidar::ComputeAndSaveDetections(const FTransform& SensorTransform) {
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel)
PointsPerChannel[idxChannel] = RecordedHits[idxChannel].size();
SemanticLidarData.ResetSerPoints(PointsPerChannel);
for (auto idxChannel = 0u; idxChannel < Description.Channels; ++idxChannel) {
for (auto& hit : RecordedHits[idxChannel]) {
FSemanticDetection detection;
ComputeRawDetection(hit, SensorTransform, detection);
SemanticLidarData.WritePointSync(detection);
}
}
}
void ARayCastSemanticLidar::ComputeRawDetection(const FHitResult& HitInfo, const FTransform& SensorTransf, FSemanticDetection& Detection) const
{