Explanation of data.json¶
The file data/data.json contains Topside's model of sensor values, and what topside sends down to the rover.
The file looks like this:
It can also contain nested values, meaning:
The file is read using the json library:
import json # loads the json library
# Opens the file and loads the data into __data_dict__.
with open('data/data.json', 'r') as file:
data_dict = json.load(file) # Change the name of __data_dict__ to whatever you prefer.
Once it is loaded, you read values using the syntax:
Nested keys are read with:
Overview of values¶
Thrust:¶
"Thrust" : [x,y,z,pitch,roll,yaw]
List (array) of 6 values. data_dict["Thrust"][1] gives the y value.
Buttons¶
Buttons from the joystick - 0 or 1. (not held down vs. held down.)
thrusters¶
Measured values for the thrusters. Ex:
Each has "power" and "temp".
9dof¶
Measured 9dof values - "acceleration", "gyroscope", and "magnetometer".
Each has an x, y, and z value.
Example:
"9dof": {
"acceleration": {
"x": 0.02,
"y": -0.01,
"z": 9.81
},
"gyroscope": {
"x": 0.01,
"y": 0.02,
"z": 0.00
},
"magnetometer": {
"x": 30.6,
"y": -22.3,
"z": 15.5
}
}
Lights¶
Lights.
Example:
Battery¶
Battery. Percentage.
Depth¶
"dpt" is the measured depth.
"dptSet" is the depth it is trying to reach (target).