-
Notifications
You must be signed in to change notification settings - Fork 1
/
CommandMessage.proto
183 lines (147 loc) · 6.49 KB
/
CommandMessage.proto
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/**
* 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;
PbbCommand pbb_command = 5;
RcuCommand rcu_command = 6;
SobCommand sob_command = 7;
}
}
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_VENT = 2; // Open the vent valve
RSC_CLOSE_VENT = 3; // Close the vent valve
RSC_OPEN_DRAIN = 4; // Open the drain valve
RSC_CLOSE_DRAIN = 5; // Close the drain valve
RSC_MEV_CLOSE = 6; // Forces MEV to close - ONLY supported in states where it is safe to close the MEV
//-- PRELAUNCH --
RSC_GOTO_FILL = 7; // Transition to the FILL state
//-- FILL --
RSC_ARM_CONFIRM_1 = 8; // Enable first ARM confirmation flag
RSC_ARM_CONFIRM_2 = 9; // Enable second ARM confirmation flag
RSC_GOTO_ARM = 10; // Transition to the ARM state (not allowed without the confirm flags set)
RSC_GOTO_PRELAUNCH = 11; // Transition to the PRELAUNCH state from FILL
//-- ARM/IGNITION/LAUNCH/BURN --
//-- ARM --
RSC_POWER_TRANSITION_ONBOARD = 12; // Change power source to onboard
RSC_POWER_TRANSITION_EXTERNAL = 13; // Change power source to external power
//RSC_GOTO_FILL, // Transition back
RSC_GOTO_IGNITION = 14; // Ready for ignition sequence - Transition to IGNITION state
//-- IGNITION --
RSC_IGNITION_TO_LAUNCH = 15; // 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 = 16; // Internal command, should not be triggered externally
//-- BURN --
RSC_BURN_TO_COAST = 17; // Internal command, should not be triggered externally
//-- COAST --
RSC_COAST_TO_DESCENT = 18; // Internal command, should not be triggered externally
//-- DESCENT --
RSC_DESCENT_TO_RECOVERY = 19; // Internal command, should not be triggered externally
//-- ABORT --
//RSC_GOTO_PRELAUNCH, // Confirm transition back into prelaunch state
//-- GENERAL --
//-- TEST --
RSC_GOTO_TEST = 20;
RSC_TEST_MEV_OPEN = 21;
//RSC_MEV_CLOSE
RSC_TEST_MEV_ENABLE = 22;
RSC_TEST_MEV_DISABLE = 23;
//-- TECHNICAL --
RSC_NONE = 24; // Invalid command, must be last
}
Command command_enum = 1;
}
message PbbCommand {
enum Command {
PBB_NONE = 0;
PBB_OPEN_MEV = 1;
PBB_CLOSE_MEV = 2;
PMB_LAST = 5;
}
Command command_enum = 1;
}
// Not used in GUI V2
message SobCommand {
enum Command {
SOB_NONE = 0;
SOB_SLOW_SAMPLE_IR = 1;
SOB_FAST_SAMPLE_IR = 2;
SOB_TARE_LOAD_CELL = 3;
SOB_CALIBRATE_LOAD_CELL = 4;
SOB_LAST = 5;
}
Command command_enum = 1;
int32 command_param = 2; //for mass calibration
}
message RcuCommand {
enum Command {
RCU_NONE = 0;
RCU_OPEN_AC1 = 3;
RCU_CLOSE_AC1 = 4;
RCU_OPEN_AC2 = 5; // Unused
RCU_CLOSE_AC2 = 6; // Unused
// RCU Valve Controls
RCU_OPEN_PBV1 = 7;
RCU_CLOSE_PBV1 = 8;
RCU_OPEN_PBV2 = 9;
RCU_CLOSE_PBV2 = 10;
RCU_OPEN_PBV3 = 11;
RCU_CLOSE_PBV3 = 12;
RCU_OPEN_PBV4 = 13;
RCU_CLOSE_PBV4 = 14;
// RCU Solenoid Controls
RCU_OPEN_SOL5 = 21;
RCU_CLOSE_SOL5 = 22;
RCU_OPEN_SOL6 = 23;
RCU_CLOSE_SOL6 = 24;
RCU_OPEN_SOL7 = 25;
RCU_CLOSE_SOL7 = 26;
RCU_OPEN_SOL8A = 27;
RCU_CLOSE_SOL8A = 28;
RCU_OPEN_SOL8B = 29;
RCU_CLOSE_SOL8B = 30;
// RCU LOAD CELL Control (Not used in GUI V2)
RCU_TARE_NOS1_LOAD_CELL = 33;
RCU_TARE_NOS2_LOAD_CELL = 34;
RCU_CALIBRATE_NOS1_LOAD_CELL = 35;
RCU_CALIBRATE_NOS2_LOAD_CELL = 36;
// RCU PAD BOX Control
RCU_IGNITE_PAD_BOX1 = 31;
RCU_IGNITE_PAD_BOX2 = 32;
RCU_KILL_PAD_BOX1 = 37;
RCU_KILL_PAD_BOX2 = 38;
RCU_LAST = 39;
}
Command command_enum = 1;
int32 command_param = 2; //for mass calibration
}