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
reply_json.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "calibration_session.h"
13#include "control_status.h"
14#include "track_snapshot.h"
15
16#include <cstddef>
17#include <cstdint>
18
19namespace hud
20{
27constexpr size_t kReplySize = 832;
28
30struct ReplyInput {
31 const TrackSnapshot* track = nullptr;
32 const ControlStatus* status = nullptr;
33 uint32_t viewers = 0;
34};
35
44size_t format_reply(const ReplyInput& in, char* out, size_t size);
45
47const char* cal_state_name(aiming::CalState st);
48
50const char* speed_name(uint8_t speed);
51} // namespace hud
Two-point joystick calibration as a state machine (pure C++20, natively tested).
Read-only view of the controller state for the HUD and stats line.
const char * speed_name(uint8_t speed)
Wire name of ControlStatus::speed: slow (0), normal (1) or fast (2); anything else reads as normal.
Definition reply_json.cpp:126
constexpr size_t kReplySize
Buffer size that always holds a full reply.
Definition reply_json.h:27
const char * cal_state_name(aiming::CalState st)
Wire name of a calibration state: idle, point1, point2, done or failed.
Definition reply_json.cpp:108
size_t format_reply(const ReplyInput &in, char *out, size_t size)
Writes the NUL-terminated JSON reply into out and returns its length (without the NUL).
Definition reply_json.cpp:86
Snapshot of the controller, published once per control pass.
Definition control_status.h:17
Definition track_snapshot.h:14
Inputs of one reply. Null pointers mean that part is not available.
Definition reply_json.h:30
const ControlStatus * status
Controller state; null omits the controller keys and "vw".
Definition reply_json.h:32
uint32_t viewers
/stream viewers connected (0 to 2), sent as "vw" with the status keys.
Definition reply_json.h:33
const TrackSnapshot * track
Tracker output; null sends the fixed no-detection fallback.
Definition reply_json.h:31
Plain copies of the tracker output and detection timings, safe to hand across tasks.