-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandMessage.proto
More file actions
120 lines (96 loc) · 4.54 KB
/
CommandMessage.proto
File metadata and controls
120 lines (96 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/**
* FILE: CommandMessage.proto
* BRIEF: Command messages are used to send commands to any boards. These messages are sent from the ground to the rocket.
* AUTHOR: Christopher Chan (cjchanx)
*/
syntax = "proto3";
package Proto;
import "CoreProto.proto";
/* Command Message ------------------------------------------------------------------*/
/* This acts as the command wrapper message for all SOAR Command Messages. This message is used to send commands to any board.
*
* The message path is defined by the source and target fields. The source field is the node that sent the message, the target field is the node that the message is intended for.
* If the target field is set to NODE_ANY, then the message is a broadcast message and should be sent to all nodes.
*
* Note that all Command Messages should be ACKed by the target node. If the target node does not ACK the message, the source node should resend the message.
*/
message CommandMessage {
// Message Path
Node source = 1; // This is the source of the message (the node that sent the message)
Node target = 2; // This is the destination of the message, if this is a broadcast message, this should be set to NODE_ANY
/* There are much more robust RDT implementations, but for simplicity, we will use a sequence number simply to verify
* ACKs are for the correct respective message. Each SOURCE node maintains a counting UINT32_T that is incremented for EVERY
* message send to ANY source (if we want to make this more robust, we can use a unique sequence number per message path but that
* would require an N_NODES array of sequence numbers which is not necessary for our purposes).
*/
uint32 source_sequence_num = 3; // This is the sequence number of the message, should start at (1), if its 0 it does not need to be ACKed (ie. Non-essential Telemetry)
// Message Data
oneof message {
// Command Messages
DmbCommand dmb_command = 4;
LPbbCommand l_pbb_command = 5;
UPbbCommand u_pbb_command = 6;
}
}
message DmbCommand {
enum Command {
RSC_FIRST_INVALID = 0;
RSC_ANY_TO_ABORT = 1; // Transition to ABORT state - available from all states except for IGNITION/LAUNCH/BURN
RSC_OPEN_SOL_10 = 2;
RSC_CLOSE_SOL_10 = 3;
RSC_OPEN_SOL_11 = 4;
RSC_CLOSE_SOL_11 = 5;
RSC_OPEN_SOL_12 = 6;
RSC_CLOSE_SOL_12 = 7;
RSC_OPEN_SOL_13 = 8;
RSC_CLOSE_SOL_13 = 9;
RSC_OPEN_SOL_14 = 10;
RSC_CLOSE_SOL_14 = 11;
//-- PRELAUNCH --
RSC_GOTO_FILL = 12; // Transition to the FILL state
//-- FILL --
RSC_ARM_CONFIRM_1 = 13; // Enable first ARM confirmation flag
RSC_ARM_CONFIRM_2 = 14; // Enable second ARM confirmation flag
RSC_GOTO_ARM = 15; // Transition to the ARM state (not allowed without the confirm flags set)
RSC_GOTO_PRELAUNCH = 16; // Transition to the PRELAUNCH state from FILL
//-- ARM/IGNITION/LAUNCH/BURN --
//-- ARM --
RSC_GOTO_IGNITION = 17; // Ready for ignition sequence - Transition to IGNITION state
//-- IGNITION --
RSC_IGNITION_TO_LAUNCH = 18; // Confirm igniter actuation - Transition to LAUNCH state (MEV OPEN)
//RSC_GOTO_ARM // Non-confirm igniter actuation - Transition back to ARM state
//-- LAUNCH --
// * These flight sequence commands can be replaced with direct calls to transition state IF possible
RSC_LAUNCH_TO_BURN = 19; // Internal command, should not be triggered externally
//-- BURN --
RSC_BURN_TO_COAST = 20; // Internal command, should not be triggered externally
//-- COAST --
RSC_COAST_TO_DESCENT = 21; // Internal command, should not be triggered externally
//-- DESCENT --
RSC_DESCENT_TO_RECOVERY = 22; // Internal command, should not be triggered externally
//-- GENERAL --
//-- TEST --
RSC_GOTO_TEST = 23;
//-- TECHNICAL --
RSC_NONE = 24; // Invalid command, must be last
}
Command command_enum = 1;
}
message LPbbCommand {
enum Command {
LPBB_NONE = 0;
LPBB_OPEN_MEV = 1;
LPBB_CLOSE_MEV = 2;
LPBB_LAST = 3;
}
Command command_enum = 1;
}
message UPbbCommand {
enum Command {
UPBB_NONE = 0;
UPBB_OPEN_MEV = 1;
UPBB_CLOSE_MEV = 2;
UPBB_LAST = 3;
}
Command command_enum = 1;
}