24 class LidarSerializer;
25 class LidarHeaderView;
71 LidarDetection() : point(0.0f, 0.0f, 0.0f), intensity(0.0f) {}
73 LidarDetection(
float x,
float y,
float z,
float intensity) : point(x, y, z), intensity(intensity) {}
75 LidarDetection(geom::Location p,
float intensity) : point(p), intensity(intensity) {}
78 void WritePlyHeaderInfo(std::ostream& out)
const {
79 out <<
"property float32 x\n"
80 <<
"property float32 y\n"
81 <<
"property float32 z\n"
82 <<
"property float32 I";
85 void WriteDetection(std::ostream& out)
const{
87 out << point.x <<
' ' << point.y <<
' ' << point.z <<
' ' << intensity;
92class LidarData :
public SemanticLidarData {
96 explicit LidarData(uint32_t ChannelCount = 0u)
97 : SemanticLidarData(ChannelCount) {
101 LidarData &
operator=(LidarData &&) =
default;
104 ~LidarData() =
default;
108 virtual void ResetMemory(std::vector<uint32_t> points_per_channel) {
110 DEBUG_ASSERT(GetChannelCount() > points_per_channel.size());
114 std::memset(_header.data() + Index::SIZE, 0,
sizeof(uint32_t) * GetChannelCount());
118 uint32_t total_points =
static_cast<uint32_t
>(
119 std::accumulate(points_per_channel.begin(), points_per_channel.end(), 0));
122 _points.reserve(total_points * 4);
126 void WritePointSync(LidarDetection &detection) {
128 _points.emplace_back(detection.point.x);
129 _points.emplace_back(detection.point.y);
130 _points.emplace_back(detection.point.z);
131 _points.emplace_back(detection.intensity);
138 virtual void WritePointSync(SemanticLidarDetection &detection) {
145 std::vector<float> _points;
148 friend class s11n::LidarSerializer;
149 friend class s11n::LidarHeaderView;
ConcurrentQueue & operator=(ConcurrentQueue const &) MOODYCAMEL_DELETE_FUNCTION
#define DEBUG_ASSERT(predicate)