133 #include <string_view>
135 #include "../base/bytes.h"
156 enum CellType : uint8_t {
218 bool operator>>(Bytes& bytes)
const noexcept;
226 [[nodiscard]]
static bool check_valid(
const Bytes& bytes) noexcept;
240 [[nodiscard]]
bool is_valid()
const noexcept;
276 bool create(
size_t size) noexcept;
281 void clear() noexcept;
290 bool shallow_copy(uint8_t* data,
size_t size) noexcept;
299 bool deep_copy(uint8_t* data,
size_t size) noexcept;
308 bool fill_data(uint8_t* data,
size_t size) noexcept;
315 [[nodiscard]] uint64_t update_time_ns()
const noexcept;
322 [[nodiscard]] std::string_view map_id()
const noexcept;
329 [[nodiscard]] uint32_t channel()
const noexcept;
336 [[nodiscard]] uint32_t freq()
const noexcept;
343 [[nodiscard]] uint32_t width()
const noexcept;
350 [[nodiscard]] uint32_t height()
const noexcept;
357 [[nodiscard]] uint32_t valid_cell_count()
const noexcept;
364 [[nodiscard]]
float resolution()
const noexcept;
371 [[nodiscard]]
float origin_x()
const noexcept;
378 [[nodiscard]]
float origin_y()
const noexcept;
385 [[nodiscard]]
float origin_z()
const noexcept;
392 [[nodiscard]]
float origin_yaw()
const noexcept;
399 [[nodiscard]]
float value_min()
const noexcept;
406 [[nodiscard]]
float value_max()
const noexcept;
413 [[nodiscard]] int32_t default_value()
const noexcept;
420 [[nodiscard]]
float occupied_threshold()
const noexcept;
427 [[nodiscard]]
float free_threshold()
const noexcept;
434 [[nodiscard]] CellType cell_type()
const noexcept;
441 [[nodiscard]] uint8_t cell_size()
const noexcept;
448 [[nodiscard]]
const uint8_t* data()
const noexcept;
455 [[nodiscard]]
size_t size()
const noexcept;
462 [[nodiscard]]
bool is_owner()
const noexcept;
469 void set_update_time_ns(uint64_t update_time_ns) noexcept;
476 void set_map_id(std::string_view map_id) noexcept;
483 void set_channel(uint32_t channel) noexcept;
490 void set_freq(uint32_t freq) noexcept;
497 void set_width(uint32_t width) noexcept;
504 void set_height(uint32_t height) noexcept;
511 void set_valid_cell_count(uint32_t valid_cell_count) noexcept;
518 void set_resolution(
float resolution) noexcept;
525 void set_origin_x(
float origin_x) noexcept;
532 void set_origin_y(
float origin_y) noexcept;
539 void set_origin_z(
float origin_z) noexcept;
546 void set_origin_yaw(
float origin_yaw) noexcept;
553 void set_value_min(
float value_min) noexcept;
560 void set_value_max(
float value_max) noexcept;
567 void set_default_value(int32_t default_value) noexcept;
574 void set_occupied_threshold(
float occupied_threshold) noexcept;
581 void set_free_threshold(
float free_threshold) noexcept;
588 void set_cell_type(CellType cell_type) noexcept;
596 [[nodiscard]]
static uint8_t cell_size_of(CellType type) noexcept;
603 uint16_t& get_reserved() noexcept {
return reserved_buf_; }
610 uint32_t& get_reserved2() noexcept {
return reserved_buf2_; }
617 uint32_t& get_reserved3() noexcept {
return reserved_buf3_; }
621 static constexpr
bool kZerocopyTypes{
true};
624 uint8_t* data_{
nullptr};
626 uint64_t update_time_ns_{0};
628 uint32_t channel_{0};
632 uint32_t valid_cell_count_{0};
633 float resolution_{0};
637 float origin_yaw_{0};
640 int32_t default_value_{0};
641 float occupied_threshold_{0};
642 float free_threshold_{0};
643 CellType cell_type_{kCellUnknown};
644 bool is_owner_{
false};
645 uint16_t reserved_buf_{0};
646 uint32_t reserved_buf2_{0};
647 uint32_t reserved_buf3_{0};
649 static constexpr uint32_t kMagicNumberBegin{0x98B7F17A};
650 static constexpr uint32_t kMagicNumberEnd{0x98B7F17F};
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
size_t get_serialized_size(const T &src) noexcept
Returns a serialised-size hint for src with explicit codec tag.
Definition: serializer-inl.h:298
VLINK_EXPORT std::ostream & operator<<(std::ostream &ostream, const BasePtr &status) noexcept
Writes the human-readable description of status to ostream.
struct VLINK_EXPORT_AND_ALIGNED(8) AudioFrame final
Definition: audio_frame.h:140
152-byte POD container holding a typed 2-D occupancy / cost grid plus pose metadata.