2 * Copyright © 2010 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 * Track flight state from telemetry or eeprom data stream
23 package org.altusmetrum.altoslib_11;
27 public class AltosState extends AltosDataListener {
29 public static final int set_position = 1;
30 public static final int set_gps = 2;
31 public static final int set_data = 4;
35 static final double filter_len = 2.0;
36 static final double ascent_filter_len = 0.5;
37 static final double descent_filter_len = 5.0;
41 public long received_time;
47 public double prev_time;
48 public double time_change;
53 private double max_value;
54 private double set_time;
55 private double prev_set_time;
57 boolean can_max() { return true; }
59 void set(double new_value, double time) {
60 if (new_value != AltosLib.MISSING) {
62 if (can_max() && (max_value == AltosLib.MISSING || value > max_value))
68 void set_filtered(double new_value, double time) {
69 if (prev_value != AltosLib.MISSING) {
70 double f = 1/Math.exp((time - prev_set_time) / filter_len);
71 new_value = f * new_value + (1-f) * prev_value;
89 if (value != AltosLib.MISSING && prev_value != AltosLib.MISSING)
90 return value - prev_value;
91 return AltosLib.MISSING;
96 double t = set_time - prev_set_time;
98 if (c != AltosLib.MISSING && t != 0)
100 return AltosLib.MISSING;
104 if (value == AltosLib.MISSING)
105 return AltosLib.MISSING;
106 if (prev_value == AltosLib.MISSING)
107 return AltosLib.MISSING;
109 return (value + prev_value) / 2 * (set_time - prev_set_time);
116 void set_derivative(AltosValue in) {
117 double n = in.rate();
119 if (n == AltosLib.MISSING)
122 double p = prev_value;
123 double pt = prev_set_time;
125 if (p == AltosLib.MISSING) {
127 pt = in.time() - 0.01;
130 /* Clip changes to reduce noise */
131 double ddt = in.time() - pt;
132 double ddv = (n - p) / ddt;
134 final double max = 100000;
137 if (Math.abs(ddv) > max) {
147 filter_len = ascent_filter_len;
149 filter_len = descent_filter_len;
151 double f = 1/Math.exp(ddt/ filter_len);
152 n = p * f + n * (1-f);
157 void set_integral(AltosValue in) {
158 double change = in.integrate();
160 if (change != AltosLib.MISSING) {
161 double prev = prev_value;
162 if (prev == AltosLib.MISSING)
164 set(prev + change, in.time());
168 void copy(AltosValue old) {
170 set_time = old.set_time;
171 prev_value = old.value;
172 prev_set_time = old.set_time;
173 max_value = old.max_value;
176 void finish_update() {
178 prev_set_time = set_time;
182 value = AltosLib.MISSING;
183 prev_value = AltosLib.MISSING;
184 max_value = AltosLib.MISSING;
191 class AltosIValue extends AltosValue {
201 public AltosIValue measured;
202 public AltosIValue computed;
204 boolean can_max() { return true; }
206 boolean c_can_max() { return can_max(); }
209 double v = measured.value();
210 if (v != AltosLib.MISSING)
212 return computed.value();
215 boolean is_measured() {
216 return measured.value() != AltosLib.MISSING;
220 double m = measured.max();
222 if (m != AltosLib.MISSING)
224 return computed.max();
227 double prev_value() {
228 if (measured.value != AltosLib.MISSING && measured.prev_value != AltosLib.MISSING)
229 return measured.prev_value;
230 return computed.prev_value;
233 AltosValue altos_value() {
234 if (measured.value() != AltosLib.MISSING)
240 double c = measured.change();
241 if (c == AltosLib.MISSING)
242 c = computed.change();
247 double r = measured.rate();
248 if (r == AltosLib.MISSING)
253 void set_measured(double new_value, double time) {
254 measured.set(new_value, time);
257 void set_computed(double new_value, double time) {
258 computed.set(new_value, time);
261 void set_derivative(AltosValue in) {
262 computed.set_derivative(in);
265 void set_derivative(AltosCValue in) {
266 set_derivative(in.altos_value());
269 void set_integral(AltosValue in) {
270 computed.set_integral(in);
273 void set_integral(AltosCValue in) {
274 set_integral(in.altos_value());
277 void copy(AltosCValue old) {
278 measured.copy(old.measured);
279 computed.copy(old.computed);
282 void finish_update() {
283 measured.finish_update();
284 computed.finish_update();
287 public AltosCValue() {
288 measured = new AltosIValue();
289 computed = new AltosIValue();
294 public int altitude_32;
295 public int receiver_serial;
296 public boolean landed;
297 public boolean ascent; /* going up? */
298 public boolean boost; /* under power */
299 public int config_major;
300 public int config_minor;
301 public int apogee_delay;
302 public int main_deploy;
303 public int flight_log_max;
305 private double pressure_to_altitude(double p) {
306 if (p == AltosLib.MISSING)
307 return AltosLib.MISSING;
308 return AltosConvert.pressure_to_altitude(p);
311 private AltosCValue ground_altitude;
313 public double ground_altitude() {
314 return ground_altitude.value();
317 public void set_ground_altitude(double a) {
318 ground_altitude.set_measured(a, time);
321 class AltosGpsGroundAltitude extends AltosValue {
322 void set(double a, double t) {
325 gps_altitude.set_gps_height();
328 void set_filtered(double a, double t) {
329 super.set_filtered(a, t);
331 gps_altitude.set_gps_height();
334 AltosGpsGroundAltitude() {
339 private AltosGpsGroundAltitude gps_ground_altitude;
341 public double gps_ground_altitude() {
342 return gps_ground_altitude.value();
345 public void set_gps_ground_altitude(double a) {
346 gps_ground_altitude.set(a, time);
349 class AltosGroundPressure extends AltosCValue {
350 void set_filtered(double p, double time) {
351 computed.set_filtered(p, time);
353 ground_altitude.set_computed(pressure_to_altitude(computed.value()), time);
356 void set_measured(double p, double time) {
357 super.set_measured(p, time);
358 ground_altitude.set_computed(pressure_to_altitude(p), time);
361 AltosGroundPressure () {
366 private AltosGroundPressure ground_pressure;
368 public double ground_pressure() {
369 return ground_pressure.value();
372 public void set_ground_pressure (double pressure) {
373 ground_pressure.set_measured(pressure, time);
376 class AltosAltitude extends AltosCValue {
378 private void set_speed(AltosValue v) {
379 if (!acceleration.is_measured() || !ascent)
380 speed.set_derivative(this);
383 void set_computed(double a, double time) {
384 super.set_computed(a,time);
389 void set_measured(double a, double time) {
390 super.set_measured(a,time);
400 private AltosAltitude altitude;
402 class AltosGpsAltitude extends AltosValue {
404 private void set_gps_height() {
406 double g = gps_ground_altitude.value();
408 if (a != AltosLib.MISSING && g != AltosLib.MISSING)
411 gps_height = AltosLib.MISSING;
414 void set(double a, double t) {
424 private AltosGpsAltitude gps_altitude;
426 private AltosValue gps_ground_speed;
427 private AltosValue gps_ascent_rate;
428 private AltosValue gps_course;
429 private AltosValue gps_speed;
431 public double altitude() {
432 double a = altitude.value();
433 if (a != AltosLib.MISSING)
435 return gps_altitude.value();
438 public double max_altitude() {
439 double a = altitude.max();
440 if (a != AltosLib.MISSING)
442 return gps_altitude.max();
445 public void set_altitude(double new_altitude) {
446 double old_altitude = altitude.value();
447 if (old_altitude != AltosLib.MISSING) {
448 while (old_altitude - new_altitude > 32000)
449 new_altitude += 65536.0;
451 altitude.set_measured(new_altitude, time);
454 public double gps_altitude() {
455 return gps_altitude.value();
458 public double max_gps_altitude() {
459 return gps_altitude.max();
462 public void set_gps_altitude(double new_gps_altitude) {
463 gps_altitude.set(new_gps_altitude, time);
466 public double gps_ground_speed() {
467 return gps_ground_speed.value();
470 public double max_gps_ground_speed() {
471 return gps_ground_speed.max();
474 public double gps_ascent_rate() {
475 return gps_ascent_rate.value();
478 public double max_gps_ascent_rate() {
479 return gps_ascent_rate.max();
482 public double gps_course() {
483 return gps_course.value();
486 public double gps_speed() {
487 return gps_speed.value();
490 public double max_gps_speed() {
491 return gps_speed.max();
494 class AltosPressure extends AltosValue {
495 void set(double p, double time) {
497 if (state == AltosLib.ao_flight_pad)
498 ground_pressure.set_filtered(p, time);
499 double a = pressure_to_altitude(p);
500 altitude.set_computed(a, time);
508 private AltosPressure pressure;
510 public double pressure() {
511 return pressure.value();
514 public void set_pressure(double p) {
515 pressure.set(p, time);
518 class AltosForce extends AltosValue {
519 void set(double p, double time) {
527 private AltosForce thrust;
529 public double thrust() {
530 return thrust.value();
533 public void set_thrust(double N) {
537 public double baro_height() {
538 double a = altitude();
539 double g = ground_altitude();
540 if (a != AltosLib.MISSING && g != AltosLib.MISSING)
542 return AltosLib.MISSING;
545 public double height() {
546 double k = kalman_height.value();
547 if (k != AltosLib.MISSING)
550 double b = baro_height();
551 if (b != AltosLib.MISSING)
557 public double max_height() {
558 double k = kalman_height.max();
559 if (k != AltosLib.MISSING)
562 double a = altitude.max();
563 double g = ground_altitude();
564 if (a != AltosLib.MISSING && g != AltosLib.MISSING)
566 return max_gps_height();
569 public double gps_height() {
570 double a = gps_altitude();
571 double g = gps_ground_altitude();
573 if (a != AltosLib.MISSING && g != AltosLib.MISSING)
575 return AltosLib.MISSING;
578 public double max_gps_height() {
579 double a = gps_altitude.max();
580 double g = gps_ground_altitude();
582 if (a != AltosLib.MISSING && g != AltosLib.MISSING)
584 return AltosLib.MISSING;
587 class AltosSpeed extends AltosCValue {
590 return state < AltosLib.ao_flight_fast || state == AltosLib.ao_flight_stateless;
594 acceleration.set_derivative(this);
597 void set_derivative(AltosCValue in) {
598 super.set_derivative(in);
602 void set_computed(double new_value, double time) {
603 super.set_computed(new_value, time);
607 void set_measured(double new_value, double time) {
608 super.set_measured(new_value, time);
617 private AltosSpeed speed;
619 public double speed() {
620 double v = kalman_speed.value();
621 if (v != AltosLib.MISSING)
624 if (v != AltosLib.MISSING)
627 if (v != AltosLib.MISSING)
629 return AltosLib.MISSING;
632 public double max_speed() {
633 double v = kalman_speed.max();
634 if (v != AltosLib.MISSING)
637 if (v != AltosLib.MISSING)
640 if (v != AltosLib.MISSING)
642 return AltosLib.MISSING;
645 class AltosAccel extends AltosCValue {
648 return state < AltosLib.ao_flight_fast || state == AltosLib.ao_flight_stateless;
651 void set_measured(double a, double time) {
652 super.set_measured(a, time);
654 speed.set_integral(this.measured);
662 AltosAccel acceleration;
664 public double acceleration() {
665 return acceleration.value();
668 public double max_acceleration() {
669 return acceleration.max();
672 public AltosCValue orient;
674 public void set_orient(double new_orient) {
675 orient.set_measured(new_orient, time);
678 public double orient() {
679 return orient.value();
682 public double max_orient() {
686 public AltosValue kalman_height, kalman_speed, kalman_acceleration;
688 public void set_kalman(double height, double speed, double acceleration) {
689 double old_height = kalman_height.value();
690 if (old_height != AltosLib.MISSING) {
691 while (old_height - height > 32000)
694 kalman_height.set(height, time);
695 kalman_speed.set(speed, time);
696 kalman_acceleration.set(acceleration, time);
699 public double battery_voltage;
700 public double pyro_voltage;
701 public double temperature;
702 public double apogee_voltage;
703 public double main_voltage;
705 public double igniter_voltage[];
708 public boolean gps_pending;
713 public static final int MIN_PAD_SAMPLES = 10;
716 public int gps_waiting;
717 public boolean gps_ready;
721 public AltosGreatCircle from_pad;
722 public double elevation; /* from pad */
723 public double range; /* total distance */
725 public double gps_height;
727 public double pad_lat, pad_lon, pad_alt;
729 public int speak_tick;
730 public double speak_altitude;
732 public String callsign;
733 public String firmware_version;
735 public double ground_accel;
737 public int log_format;
738 public int log_space;
739 public String product;
741 public AltosMs5607 baro;
743 public AltosCompanion companion;
745 public int pyro_fired;
747 public void set_npad(int npad) {
749 gps_waiting = MIN_PAD_SAMPLES - npad;
750 if (this.gps_waiting < 0)
752 gps_ready = gps_waiting == 0;
758 System.out.printf("state init\n");
759 received_time = System.currentTimeMillis();
760 time = AltosLib.MISSING;
761 time_change = AltosLib.MISSING;
762 prev_time = AltosLib.MISSING;
763 state = AltosLib.ao_flight_invalid;
766 rssi = AltosLib.MISSING;
768 config_major = AltosLib.MISSING;
769 config_minor = AltosLib.MISSING;
770 apogee_delay = AltosLib.MISSING;
771 main_deploy = AltosLib.MISSING;
772 flight_log_max = AltosLib.MISSING;
774 ground_altitude = new AltosCValue();
775 ground_pressure = new AltosGroundPressure();
776 altitude = new AltosAltitude();
777 pressure = new AltosPressure();
778 thrust = new AltosForce();
779 speed = new AltosSpeed();
780 acceleration = new AltosAccel();
781 orient = new AltosCValue();
783 temperature = AltosLib.MISSING;
784 battery_voltage = AltosLib.MISSING;
785 pyro_voltage = AltosLib.MISSING;
786 apogee_voltage = AltosLib.MISSING;
787 main_voltage = AltosLib.MISSING;
788 igniter_voltage = null;
790 kalman_height = new AltosValue();
791 kalman_speed = new AltosValue();
792 kalman_acceleration = new AltosValue();
798 last_imu_time = AltosLib.MISSING;
800 ground_rotation = null;
803 accel_zero_along = AltosLib.MISSING;
804 accel_zero_across = AltosLib.MISSING;
805 accel_zero_through = AltosLib.MISSING;
807 accel_ground_along = AltosLib.MISSING;
808 accel_ground_across = AltosLib.MISSING;
809 accel_ground_through = AltosLib.MISSING;
811 pad_orientation = AltosLib.MISSING;
817 elevation = AltosLib.MISSING;
818 range = AltosLib.MISSING;
819 gps_height = AltosLib.MISSING;
821 pad_lat = AltosLib.MISSING;
822 pad_lon = AltosLib.MISSING;
823 pad_alt = AltosLib.MISSING;
825 gps_altitude = new AltosGpsAltitude();
826 gps_ground_altitude = new AltosGpsGroundAltitude();
827 gps_ground_speed = new AltosValue();
828 gps_speed = new AltosValue();
829 gps_ascent_rate = new AltosValue();
830 gps_course = new AltosValue();
832 speak_tick = AltosLib.MISSING;
833 speak_altitude = AltosLib.MISSING;
836 firmware_version = null;
838 ground_accel = AltosLib.MISSING;
840 log_format = AltosLib.MISSING;
841 log_space = AltosLib.MISSING;
843 receiver_serial = AltosLib.MISSING;
844 altitude_32 = AltosLib.MISSING;
852 void finish_update() {
853 ground_altitude.finish_update();
854 altitude.finish_update();
855 pressure.finish_update();
856 speed.finish_update();
857 acceleration.finish_update();
858 orient.finish_update();
860 kalman_height.finish_update();
861 kalman_speed.finish_update();
862 kalman_acceleration.finish_update();
869 elevation = AltosLib.MISSING;
870 range = AltosLib.MISSING;
875 if (gps.locked && gps.nsat >= 4) {
876 /* Track consecutive 'good' gps reports, waiting for 10 of them */
877 if (state == AltosLib.ao_flight_pad || state == AltosLib.ao_flight_stateless) {
879 if (pad_lat != AltosLib.MISSING && (npad < 10 || state == AltosLib.ao_flight_pad)) {
880 pad_lat = (pad_lat * 31 + gps.lat) / 32;
881 pad_lon = (pad_lon * 31 + gps.lon) / 32;
882 gps_ground_altitude.set_filtered(gps.alt, time);
885 if (pad_lat == AltosLib.MISSING) {
888 gps_ground_altitude.set(gps.alt, time);
890 gps_altitude.set(gps.alt, time);
891 if (gps.climb_rate != AltosLib.MISSING)
892 gps_ascent_rate.set(gps.climb_rate, time);
893 if (gps.ground_speed != AltosLib.MISSING)
894 gps_ground_speed.set(gps.ground_speed, time);
895 if (gps.climb_rate != AltosLib.MISSING && gps.ground_speed != AltosLib.MISSING)
896 gps_speed.set(Math.sqrt(gps.ground_speed * gps.ground_speed +
897 gps.climb_rate * gps.climb_rate), time);
898 if (gps.course != AltosLib.MISSING)
899 gps_course.set(gps.course, time);
901 if (gps.lat != 0 && gps.lon != 0 &&
902 pad_lat != AltosLib.MISSING &&
903 pad_lon != AltosLib.MISSING)
907 if (h == AltosLib.MISSING)
909 from_pad = new AltosGreatCircle(pad_lat, pad_lon, 0, gps.lat, gps.lon, h);
910 elevation = from_pad.elevation;
911 range = from_pad.range;
915 public String state_name() {
916 return AltosLib.state_name(state);
919 public void set_product(String product) {
920 this.product = product;
923 public void set_state(int state) {
924 if (state != AltosLib.ao_flight_invalid) {
926 ascent = (AltosLib.ao_flight_boost <= state &&
927 state <= AltosLib.ao_flight_coast);
928 boost = (AltosLib.ao_flight_boost == state);
936 public void set_log_format(int log_format) {
937 this.log_format = log_format;
938 switch (log_format) {
939 case AltosLib.AO_LOG_FORMAT_TELEGPS:
940 this.state = AltosLib.ao_flight_stateless;
945 public void set_log_space(int log_space) {
946 this.log_space = log_space;
949 public void set_flight_params(int apogee_delay, int main_deploy) {
950 this.apogee_delay = apogee_delay;
951 this.main_deploy = main_deploy;
954 public void set_config(int major, int minor, int flight_log_max) {
955 config_major = major;
956 config_minor = minor;
957 this.flight_log_max = flight_log_max;
960 public void set_callsign(String callsign) {
961 this.callsign = callsign;
964 public void set_firmware_version(String version) {
965 firmware_version = version;
968 public int compare_version(String other_version) {
969 if (firmware_version == null)
970 return AltosLib.MISSING;
971 return AltosLib.compare_version(firmware_version, other_version);
974 private void re_init() {
975 int rs = receiver_serial;
977 receiver_serial = rs;
980 // public void set_flight(int flight) {
982 // /* When the flight changes, reset the state */
983 // if (flight != AltosLib.MISSING) {
984 // if (this.flight != AltosLib.MISSING &&
985 // this.flight != flight) {
988 // this.flight = flight;
992 // public void set_serial(int serial) {
993 // /* When the serial changes, reset the state */
994 // if (serial != AltosLib.MISSING) {
995 // if (this.serial != AltosLib.MISSING &&
996 // this.serial != serial) {
999 // this.serial = serial;
1003 // public void set_receiver_serial(int serial) {
1004 // if (serial != AltosLib.MISSING)
1005 // receiver_serial = serial;
1008 public boolean altitude_32() {
1009 return altitude_32 == 1;
1012 public void set_altitude_32(int altitude_32) {
1013 if (altitude_32 != AltosLib.MISSING)
1014 this.altitude_32 = altitude_32;
1018 if (rssi == AltosLib.MISSING)
1023 public void set_rssi(int rssi, int status) {
1024 if (rssi != AltosLib.MISSING) {
1026 this.status = status;
1030 public void set_received_time(long ms) {
1034 public void set_gps(AltosGPS gps) {
1043 public double accel_zero_along;
1044 public double accel_zero_across;
1045 public double accel_zero_through;
1047 public AltosRotation rotation;
1048 public AltosRotation ground_rotation;
1050 public void set_accel_zero(double zero_along, double zero_across, double zero_through) {
1051 if (zero_along != AltosLib.MISSING) {
1052 accel_zero_along = zero_along;
1053 accel_zero_across = zero_across;
1054 accel_zero_through = zero_through;
1058 public int pad_orientation;
1060 public double accel_ground_along, accel_ground_across, accel_ground_through;
1062 void update_pad_rotation() {
1063 if (pad_orientation != AltosLib.MISSING && accel_ground_along != AltosLib.MISSING) {
1064 rotation = new AltosRotation(AltosIMU.convert_accel(accel_ground_across - accel_zero_across),
1065 AltosIMU.convert_accel(accel_ground_through - accel_zero_through),
1066 AltosIMU.convert_accel(accel_ground_along - accel_zero_along),
1068 ground_rotation = rotation;
1069 orient.set_computed(rotation.tilt(), time);
1073 public void set_accel_ground(double ground_along, double ground_across, double ground_through) {
1074 accel_ground_along = ground_along;
1075 accel_ground_across = ground_across;
1076 accel_ground_through = ground_through;
1077 update_pad_rotation();
1080 public void set_pad_orientation(int pad_orientation) {
1081 this.pad_orientation = pad_orientation;
1082 update_pad_rotation();
1085 public double last_imu_time;
1087 private double radians(double degrees) {
1088 if (degrees == AltosLib.MISSING)
1089 return AltosLib.MISSING;
1090 return degrees * Math.PI / 180.0;
1093 private void update_orient() {
1094 if (last_imu_time != AltosLib.MISSING) {
1095 double t = time - last_imu_time;
1097 double pitch = radians(gyro_pitch());
1098 double yaw = radians(gyro_yaw());
1099 double roll = radians(gyro_roll());
1101 if (t > 0 & pitch != AltosLib.MISSING && rotation != null) {
1102 rotation.rotate(t, pitch, yaw, roll);
1103 orient.set_computed(rotation.tilt(), time);
1106 last_imu_time = time;
1109 private double gyro_roll, gyro_pitch, gyro_yaw;
1111 public void set_gyro(double roll, double pitch, double yaw) {
1118 private double accel_along, accel_across, accel_through;
1120 public void set_accel(double along, double across, double through) {
1121 accel_along = along;
1122 accel_across = across;
1123 accel_through = through;
1127 public double accel_along() {
1131 public double accel_across() {
1132 return accel_across;
1135 public double accel_through() {
1136 return accel_through;
1139 public double gyro_roll() {
1143 public double gyro_pitch() {
1147 public double gyro_yaw() {
1151 private double mag_along, mag_across, mag_through;
1153 public void set_mag(double along, double across, double through) {
1155 mag_across = across;
1156 mag_through = through;
1159 public double mag_along() {
1163 public double mag_across() {
1165 return AltosMag.convert_gauss(mag.across);
1166 return AltosLib.MISSING;
1169 public double mag_through() {
1171 return AltosMag.convert_gauss(mag.through);
1172 return AltosLib.MISSING;
1175 public void set_companion(AltosCompanion companion) {
1176 this.companion = companion;
1179 public void set_acceleration(double acceleration) {
1180 if (acceleration != AltosLib.MISSING) {
1181 this.acceleration.set_measured(acceleration, time);
1186 public void set_temperature(double temperature) {
1187 if (temperature != AltosLib.MISSING) {
1188 this.temperature = temperature;
1193 public void set_battery_voltage(double battery_voltage) {
1194 if (battery_voltage != AltosLib.MISSING) {
1195 this.battery_voltage = battery_voltage;
1200 public void set_pyro_voltage(double pyro_voltage) {
1201 if (pyro_voltage != AltosLib.MISSING) {
1202 this.pyro_voltage = pyro_voltage;
1207 public void set_apogee_voltage(double apogee_voltage) {
1208 if (apogee_voltage != AltosLib.MISSING) {
1209 this.apogee_voltage = apogee_voltage;
1214 public void set_main_voltage(double main_voltage) {
1215 if (main_voltage != AltosLib.MISSING) {
1216 this.main_voltage = main_voltage;
1221 public void set_igniter_voltage(double[] voltage) {
1222 this.igniter_voltage = voltage;
1225 public void set_pyro_fired(int fired) {
1226 this.pyro_fired = fired;
1229 public AltosState (AltosCalData cal_data) {