From d2f6d4a4f57d7234b1db3a7837b8956f6b2b8f64 Mon Sep 17 00:00:00 2001 From: Tong Fu Date: Tue, 5 Mar 2024 18:02:40 +0100 Subject: [PATCH] [refact] Add laser id for mid 360 --- LivoxPacketInterpreters/vtkLivoxPacketInterpreter.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LivoxPacketInterpreters/vtkLivoxPacketInterpreter.cxx b/LivoxPacketInterpreters/vtkLivoxPacketInterpreter.cxx index 116869e..55f48be 100644 --- a/LivoxPacketInterpreters/vtkLivoxPacketInterpreter.cxx +++ b/LivoxPacketInterpreters/vtkLivoxPacketInterpreter.cxx @@ -75,7 +75,7 @@ public: //----------------------------------------------------------------------------- template - void FillPoints(double* pos, const T& point, double timestamp, int laserId) + void FillPoints(double* pos, const T& point, double timestamp, uint8_t laserId) { if (std::isnan(pos[0]) || std::isnan(pos[1]) || std::isnan(pos[2])) { @@ -117,7 +117,7 @@ public: static_cast(points[i].y) / 1000, static_cast(points[i].z) / 1000 }; uint64_t ptsTimestamp = GetEthPacketTimestamp(pkt->timestamp, 8) + i * pkt->time_interval; - auto laserId = i % 4; + uint8_t laserId = i % 4; this->FillPoints(pos, points[i], ptsTimestamp, laserId); } } @@ -135,7 +135,7 @@ public: static_cast(points[i].y) / 100, static_cast(points[i].z) / 100 }; uint64_t ptsTimestamp = GetEthPacketTimestamp(pkt->timestamp, 8) + i * pkt->time_interval; - auto laserId = i % 4; + uint8_t laserId = i % 4; this->FillPoints(pos, points[i], ptsTimestamp, laserId); } } @@ -156,7 +156,7 @@ public: pos[1] = rho * std::sin(phi) * std::sin(theta); pos[2] = rho * std::cos(phi); uint64_t ptsTimestamp = GetEthPacketTimestamp(pkt->timestamp, 8) + i * pkt->time_interval; - auto laserId = i % 4; + uint8_t laserId = i % 4; this->FillPoints(pos, points[i], ptsTimestamp, laserId); } } @@ -242,7 +242,7 @@ vtkSmartPointer vtkLivoxPacketInterpreter::CreateNewEmptyFrame(vtkI InitArrayForPolyData(true, internals->PointsZ, "Z", nbrOfPoints, prereservedNbrOfPoints, polyData, this->EnableAdvancedArrays); InitArrayForPolyData(false, internals->Intensity, "intensity", nbrOfPoints, prereservedNbrOfPoints, polyData); InitArrayForPolyData(false, internals->Timestamp, "timestamp", nbrOfPoints, prereservedNbrOfPoints, polyData); - InitArrayForPolyData(false, internals->LaserId, "laser_id", nbrOfPoints, prereservedNbrOfPoints, polyData); + InitArrayForPolyData(false, internals->LaserId, "laser_id", nbrOfPoints, prereservedNbrOfPoints, polyData); InitArrayForPolyData(false, internals->Distance, "distance_m", nbrOfPoints, prereservedNbrOfPoints, polyData); InitArrayForPolyData(true, internals->TagGlue, "tag_glue", nbrOfPoints, prereservedNbrOfPoints, polyData, this->EnableAdvancedArrays); InitArrayForPolyData(true, internals->TagParticles, "tag_particles", nbrOfPoints, prereservedNbrOfPoints, polyData, this->EnableAdvancedArrays); -- GitLab