Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If the data intuitively comes in groups (eg. accelerometer x, y, and z readings)
| 1 byte | 4 bytes | 4 bytes | 4 bytes

- There is no limit to the amount of numbers you can send per group.
- The labels for these groups are not present in DataNames.h, they have their own convention, which at the time of this writing is (100 + label number of first number in group). For example, ACCELEROMETER_X is 0 so the accelerometer group label would be 100.
- The labels for these groups are not present in DataNames.h, they have their own convention, which at the time of this writing is (100 + label number of first number in group). For example, CURE_ACCELEROMETER_X is 0 so the accelerometer group label would be 100.

## Practical implementation notes

Expand Down
58 changes: 29 additions & 29 deletions include/data_handling/DataNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,46 @@
// Defines the uint8_t value for each data stream

// Sensor data
#define ACCELEROMETER_X 0
#define ACCELEROMETER_Y 1
#define ACCELEROMETER_Z 2
#define GYROSCOPE_X 3
#define GYROSCOPE_Y 4
#define GYROSCOPE_Z 5
#define TEMPERATURE 6
#define PRESSURE 7
#define ALTITUDE 8
#define MAGNETOMETER_X 9
#define MAGNETOMETER_Y 10
#define MAGNETOMETER_Z 11
#define CURE_ACCELEROMETER_X 0
#define CURE_ACCELEROMETER_Y 1
#define CURE_ACCELEROMETER_Z 2
#define CURE_GYROSCOPE_X 3
#define CURE_GYROSCOPE_Y 4
#define CURE_GYROSCOPE_Z 5
#define CURE_TEMPERATURE 6
#define CURE_PRESSURE 7
#define CURE_ALTITUDE 8
#define CURE_MAGNETOMETER_X 9
#define CURE_MAGNETOMETER_Y 10
#define CURE_MAGNETOMETER_Z 11

// Metrics
#define MEDIAN_ACCELERATION_SQUARED 12
#define AVERAGE_CYCLE_RATE 13
#define NUM_PACKETS_SENT 24
#define CURE_MEDIAN_ACCELERATION_SQUARED 12
#define CURE_AVERAGE_CYCLE_RATE 13
#define CURE_NUM_PACKETS_SENT 24

// Metadata
#define TIMESTAMP 14
#define STATE_CHANGE 15
#define CURRENT_STATE 23
#define FLIGHT_ID 16
#define CURE_TIMESTAMP 14
#define CURE_STATE_CHANGE 15
#define CURE_CURRENT_STATE 23
#define CURE_FLIGHT_ID 16

// State Estimation
#define EST_APOGEE 17
#define EST_VERTICAL_VELOCITY 18
#define EST_ALTITUDE 19
#define TIME_TO_APOGEE 22
#define ROLL 25
#define PITCH 26
#define YAW 27
#define CURE_EST_APOGEE 17
#define CURE_EST_VERTICAL_VELOCITY 18
#define CURE_EST_ALTITUDE 19
#define CURE_TIME_TO_APOGEE 22
#define CURE_ROLL 25
#define CURE_PITCH 26
#define CURE_YAW 27

// Power
#define BATTERY_VOLTAGE 20
#define CURE_BATTERY_VOLTAGE 20

// Active Aero
#define FIN_DEPLOYMENT_AMOUNT 21
#define CURE_FIN_DEPLOYMENT_AMOUNT 21

// Payload
#define PROBE_TEMPERATURE 28
#define CURE_PROBE_TEMPERATURE 28

#endif
2 changes: 1 addition & 1 deletion src/data_handling/DataSaverSPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int DataSaverSPI::saveTimestamp(uint32_t timestamp_ms){
return 1; // Do not save if writes are blocked by post-launch state.
}

TimestampRecord_t timeStampRecord = {TIMESTAMP, timestamp_ms};
TimestampRecord_t timeStampRecord = {CURE_TIMESTAMP, timestamp_ms};
if (addRecordToBuffer(&timeStampRecord) != 0) {
if (isChipFullDueToPostLaunchProtection_) {
return 1;
Expand Down
6 changes: 3 additions & 3 deletions src/state_estimation/BurnoutStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int BurnoutStateMachine::update(const AccelerationTriplet& accel, const DataPoin
Serial.println(accel.x.timestamp_ms);
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_POWERED_ASCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);

// Put the data saver into post-launch mode
Expand Down Expand Up @@ -63,7 +63,7 @@ int BurnoutStateMachine::update(const AccelerationTriplet& accel, const DataPoin
Serial.println(accel.y.timestamp_ms);
dataSaver_->saveDataPoint(
DataPoint(accel.y.timestamp_ms, STATE_COAST_ASCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);
}
break;
Expand All @@ -80,7 +80,7 @@ int BurnoutStateMachine::update(const AccelerationTriplet& accel, const DataPoin
Serial.println(accel.x.timestamp_ms);
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_DESCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);
}
break;
Expand Down
10 changes: 5 additions & 5 deletions src/state_estimation/StateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int StateMachine::update(const AccelerationTriplet& accel, const DataPoint& alt)
// Log the state change.
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_ASCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);

// Put the data saver into post-launch mode
Expand Down Expand Up @@ -63,7 +63,7 @@ int StateMachine::update(const AccelerationTriplet& accel, const DataPoint& alt)
// Log the state change.
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_SOFT_ASCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);

// Put the data saver into post-launch mode
Expand All @@ -88,7 +88,7 @@ int StateMachine::update(const AccelerationTriplet& accel, const DataPoint& alt)
// Log the state change.
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_ASCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);

// Start the apogee detection system
Expand All @@ -108,7 +108,7 @@ int StateMachine::update(const AccelerationTriplet& accel, const DataPoint& alt)
// Log the state change.
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_ARMED),
STATE_CHANGE
CURE_STATE_CHANGE
);

// Clear post-launch mode
Expand All @@ -128,7 +128,7 @@ int StateMachine::update(const AccelerationTriplet& accel, const DataPoint& alt)
// Log the state change.
dataSaver_->saveDataPoint(
DataPoint(accel.x.timestamp_ms, STATE_DESCENT),
STATE_CHANGE
CURE_STATE_CHANGE
);
}
return 0;
Expand Down
Loading