Skip to content

Commit e1765d7

Browse files
committed
fixes from 11/2
1 parent 8db245a commit e1765d7

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

MIDAS/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ build_flags =
5050
-DHILSIM=1
5151
-DIS_SUSTAINER
5252
-std=gnu++2a
53-
build_src_filter = +<*> -<silsim/> -<hardware/> +<hardware/pins.h> +<hilsim> -<hilsim/stream>
53+
build_src_filter = +<*> -<silsim/> -<hardware/> +<hardware/pins.h> +<hilsim> -<hilsim/stream> +<hardware/Pyro.cpp> -<hilsim/sensors/Pyro.cpp> +<hardware/Continuity.cpp> -<hilsim/sensors/Continuity.cpp>
5454
build_unflags =
5555
-std=gnu++11
5656

MIDAS/src/hardware/Pyro.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Fire the pyros for this time during PYRO_TEST (ms)
1111
#define PYRO_TEST_FIRE_TIME 100
1212

13-
#define MAXIMUM_TILT_ANGLE (M_PI/5) // 36 degrees
13+
#define MAXIMUM_TILT_ANGLE (M_PI/8) // 22.5 degrees
1414

1515
/**
1616
* @brief Returns true if the error_code signals failure.
@@ -157,23 +157,25 @@ PyroState Pyro::tick(FSMState fsm_state, Orientation orientation, CommandFlags&
157157
// Additionally, check if orientation allows for firing
158158
if (can_fire_igniter(orientation)) {
159159
new_pyro_state.channel_firing[2] = true;
160-
gpioDigitalWrite(PYROC_FIRE_PIN, HIGH);
161160
}
162161
break;
163162
case FSMState::STATE_DROGUE_DEPLOY:
164163
// Fire "Pyro A" to deploy upper stage drogue
165164
new_pyro_state.channel_firing[0] = true;
166-
gpioDigitalWrite(PYROA_FIRE_PIN, HIGH);
167165
break;
168166
case FSMState::STATE_MAIN_DEPLOY:
169167
// Fire "Pyro B" to deploy main.
170168
new_pyro_state.channel_firing[1] = true;
171-
gpioDigitalWrite(PYROB_FIRE_PIN, HIGH);
172169
break;
173170
default:
174171
break;
175172
}
176173

174+
gpioDigitalWrite(PYROA_FIRE_PIN, new_pyro_state.channel_firing[0] ? HIGH : LOW);
175+
gpioDigitalWrite(PYROB_FIRE_PIN, new_pyro_state.channel_firing[1] ? HIGH : LOW);
176+
gpioDigitalWrite(PYROC_FIRE_PIN, new_pyro_state.channel_firing[2] ? HIGH : LOW);
177+
gpioDigitalWrite(PYROD_FIRE_PIN, new_pyro_state.channel_firing[3] ? HIGH : LOW);
178+
177179
return new_pyro_state;
178180
}
179181

MIDAS/src/hilsim/kal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ inline void k_handle_sys_msg(uint8_t* data, uint16_t crc) {
8585
Serial.write("%OK");
8686
}
8787

88-
void k_wait_until(char sig) {
88+
inline void k_wait_until(char sig) {
8989
char a;
9090
do {
9191
a = Serial.read();
9292
} while (a != sig);
9393
}
9494

95-
void k_clear_inbuf() {
95+
inline void k_clear_inbuf() {
9696
while(Serial.available() > 0) {
9797
char tb = Serial.read();
9898
}

MIDAS/src/hilsim/stream/flight_stream.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import random
66

77
UINT32_T = 4
8-
FILENAME = "./lunaboo.launch"
8+
FILENAME = "./lunasus.launch"
99

1010
com = serial.Serial(sys.argv[1], baudrate=115200)
1111

@@ -62,8 +62,11 @@ def read_entry():
6262

6363
return Entry(ts, disc, data, crc)
6464

65-
# ROWS_SKIP = 2087693 - 5000
66-
ROWS_SKIP = 2064768 - 5000
65+
#sus
66+
ROWS_SKIP = 2087693 - 5000
67+
68+
#boo
69+
# ROWS_SKIP = 2064768 - 5000
6770
ROW_END = 100000000
6871

6972
def cur_millis():
@@ -84,6 +87,8 @@ def stream_data():
8487
rows_read += 1
8588
cur_entry = read_entry()
8689

90+
input("Run? Any key works.")
91+
8792
start_ts = cur_entry.ts
8893
next_ts = cur_entry.ts
8994
start_epoch = cur_millis()
@@ -125,7 +130,7 @@ def stream_data():
125130

126131

127132
def main():
128-
input("Run? Any key works.")
133+
print("loading...")
129134
stream_data()
130135

131136

0 commit comments

Comments
 (0)