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
remote_command.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <cstdint>
10#include <string_view>
11
12namespace remote
13{
15enum class CommandKind : uint8_t { Poll, Move, Stop, Mode, Fire, Calibrate, Aim, Speed };
16
18enum class RemoteMode : uint8_t { Ai, User };
19
21enum class CalAction : uint8_t {
22 Start,
23 Point,
24 Cancel,
25};
26
28enum class JogSpeed : uint8_t { Slow, Normal, Fast };
29
31struct Command {
32 CommandKind kind = CommandKind::Poll;
33 int8_t pan = 0;
34 int8_t tilt = 0;
35 RemoteMode mode = RemoteMode::Ai;
36 bool fire_on = false;
37 CalAction cal = CalAction::Start;
38 int16_t aim_x = 0;
39 int16_t aim_y = 0;
40 JogSpeed speed = JogSpeed::Normal;
41};
42
50Command parse(std::string_view message);
51
54{
55public:
56 virtual ~BaseRemoteSink() = default;
58 virtual void submit(const Command& cmd) = 0;
59};
60} // namespace remote
Receives parsed commands; implemented by the controller (device) and fakes (tests).
Definition remote_command.h:54
virtual void submit(const Command &cmd)=0
Delivers one parsed command (called from the httpd task).
CommandKind
What a /commands message asks for. Poll is the keepalive and anything unrecognised.
Definition remote_command.h:15
RemoteMode
Operating mode requested by the HUD.
Definition remote_command.h:18
JogSpeed
HUD jog magnitude setting.
Definition remote_command.h:28
CalAction
Calibration action requested by the HUD; same semantics as the physical button.
Definition remote_command.h:21
@ Point
like a short press while calibrating
@ Start
like a long press when not calibrating
@ Cancel
like a long press while calibrating
Command parse(std::string_view message)
Parses one message.
Definition remote_command.cpp:108
One parsed message. Only the fields matching kind are meaningful.
Definition remote_command.h:31
JogSpeed speed
Speed only.
Definition remote_command.h:40
int16_t aim_x
Aim only: image pixel, 0..319.
Definition remote_command.h:38
CalAction cal
Calibrate only.
Definition remote_command.h:37
int16_t aim_y
Aim only: image pixel, 0..239.
Definition remote_command.h:39
bool fire_on
Fire only.
Definition remote_command.h:36
RemoteMode mode
Mode only.
Definition remote_command.h:35
int8_t tilt
Move only: -1 down, 0, +1 up (up = larger tilt angle)
Definition remote_command.h:34
int8_t pan
Move only: -1 left, 0, +1 right.
Definition remote_command.h:33