Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
calibration_blob.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "aim_map.h"
13#include "crc32.h"
14
15#include <array>
16#include <cstddef>
17#include <cstdint>
18#include <optional>
19#include <span>
20
21namespace aiming
22{
23constexpr size_t kBlobSize = 28;
24using Blob = std::array<uint8_t, kBlobSize>;
25
27using checksum::crc32;
29Blob serialize(const AimMap& map);
33std::optional<AimMap> deserialize(std::span<const uint8_t> blob);
34} // namespace aiming
Maps a target's image position to turret angles (pure C++20, natively tested).
Blob serialize(const AimMap &map)
Packs a map into the 28-byte versioned layout, with the CRC-32 in the last four bytes.
Definition calibration_blob.cpp:32
std::optional< AimMap > deserialize(std::span< const uint8_t > blob)
Parses a blob; empty if the length, magic, version, CRC or float values are invalid.
Definition calibration_blob.cpp:45
Shared CRC-32 for versioned NVS blobs (pure C++20, natively tested).
uint32_t crc32(std::span< const uint8_t > data)
CRC-32 (IEEE 802.3, reflected, init 0xFFFFFFFF, final xor 0xFFFFFFFF).
Definition crc32.cpp:41