Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: variable documentation #134

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 6 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
42 changes: 42 additions & 0 deletions src/cellular/dataCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,55 @@

typedef struct Ensemble10_eventData_
{
/**
* @brief Average temperature value of the water in Celsius provided
* by the temperature sensor
*/
double temperature;
/**
* @brief Truncated average of whether or not system in water over
* accumulation period
*
*/
int32_t water;
/**
* @brief Array saving average of the accumulated accelerometer data on the
* x, y, and z axis in g scaled up by 16834
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that if acc has the value {1, 0, 0}, I should interpret this as [0.000059, 0, 0] g's of acceleration?

Conversely, should I expect [1, 0, 0] g's of acceleration to be represented at {16834, 0, 0}?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you specify this, please add units for the real-world value so that it is unambiguously the real-world value vs the stored representation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up being confusing - are we stating that the values as stored in memory are directly interpretable as G's of acceleration?

Additionally, in line 26, I think you have the wrong constant.

One suggested wording might be this:

acc[i] = acceleration[i] * 16384, where `acceleration` is the acceleration in G's (multiple of Earth gravity), and acc is the stored representation, stored as `int32_t`.  Thus, acc[i] = 16384 = 1 G.

Consider updating the other field documentation to be similar.

*
* Values {1, 0, 0} would have an array value of [0.000061g, 0g, 0g]
* Values {16384, 0, 0} so the array values would be [1g, 0g, 0g]
*
* g is approximately equal to 9.81 m/s^2
*/
int32_t acc[3];
/**
* @brief Array of length 3 saving average of the accumulated gyroscope data
* on the x, y, and z axis in degrees per second scaled up by 131.072
*/
int32_t ang[3];
/**
* @brief Array of length 3 saving average of the accumulated magnetometer
* data on the x, y, and z axis in uT scaled down by 0.15.
*
*/
int32_t mag[3];
/**
* @brief Array of length 2 saving latitude and longitude values, multiplied
* by 1e6, of the point at which data was collected
*/
int32_t location[2];
/**
* @brief Indicates if GNSS point is locked and more than 4 point
* satellites in view
*
* All possible values are [0,1]:
* 0 - less than 4 point satellites are in view thus GNSS point is not locked
* 1 - 4 or more point satellites are in view thus GNSS point is locked
*/
uint8_t hasGPS;
/**
* @brief Number of times measurements gathered
*/
uint32_t accumulateCount;
}Ensemble10_eventData_t;

Expand Down
Loading