livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
Loading...
Searching...
No Matches
tag.hpp
Go to the documentation of this file.
1
3#pragma once
4
5#include <cstdint>
6#include <string>
7#include <string_view>
8
10
11LIVOX_MID360_API_BEGIN
12namespace livox::mid360
13{
14
16enum class TagConfidence : std::uint8_t
17{
18 kHigh = 0,
19 kMedium = 1,
20 kLow = 2,
21 kReserved = 3,
22};
23
24[[nodiscard]] std::string_view to_string(TagConfidence c) noexcept;
25
34
35[[nodiscard]] std::string to_string(const TagInfo & t);
36
40[[nodiscard]] constexpr TagInfo decode_tag(std::uint8_t tag) noexcept
41{
42 return {
43 static_cast<TagConfidence>(tag & 0x3u), static_cast<TagConfidence>((tag >> 2) & 0x3u),
44 static_cast<TagConfidence>((tag >> 4) & 0x3u), static_cast<TagConfidence>((tag >> 6) & 0x3u)};
45}
46
49[[nodiscard]] constexpr bool is_noise(
50 std::uint8_t tag, TagConfidence worst_accepted = TagConfidence::kHigh) noexcept
51{
52 const TagInfo t = decode_tag(tag);
53 return t.adjacent_glue > worst_accepted || t.particles > worst_accepted;
54}
55
56} // namespace livox::mid360
57LIVOX_MID360_API_END
Symbol visibility helpers.
The livox_mid360_core library: everything declared by the public headers.
Definition bytes.hpp:14
TagConfidence
Confidence that a point is a normal return for one tag category; higher = more likely noise.
Definition tag.hpp:17
constexpr TagInfo decode_tag(std::uint8_t tag) noexcept
Splits a raw tag byte into its four fields.
Definition tag.hpp:40
constexpr bool is_noise(std::uint8_t tag, TagConfidence worst_accepted=TagConfidence::kHigh) noexcept
True when the adjacent-glue or particle confidence is worse than worst_accepted; the other and reserv...
Definition tag.hpp:49
std::string_view to_string(Event::Kind kind) noexcept
Name of an event kind, e.g. "state_changed".
Decoded tag byte: bit 0-1 adjacent glue, 2-3 rain / fog / dust, 4-5 other, 6-7 reserved.
Definition tag.hpp:28
TagConfidence particles
bit 2-3: rain, fog, dust
Definition tag.hpp:30
TagConfidence adjacent_glue
bit 0-1: glue points between adjacent objects
Definition tag.hpp:29
TagConfidence other
bit 4-5: other properties
Definition tag.hpp:31
TagConfidence reserved
bit 6-7
Definition tag.hpp:32