Closed zjc2106 closed 8 months ago
function
field to sent command JSON, with the other required fields dependent on what the function isSee below on how the packets are structured now:
Sent commands are in JSON format, where the function
field can be:
Each of these functions have their own required fields:
motor
direction
: l
/r
/f
/b
to denote the direction the tank should go (respectively, left, right, forward, backwards)value
: degrees for l,r and milliseconds for f,bExample:
{
"function": "motor",
"direction": "f",
"value": "1000"
}
light
(TBD) value
: range from 0 = off to ??? = full brightnesscamera
(TBD) TBD
Note: Commands should be entered via the serial in the form: [function] <required fields>
, where the required fields follow the order specified above.
Responses are also in JSON format, with the fields:
status
: success
or error
message
: for a detailed message of the command executedExample:
{
"status": "success",
"message":
}
Will add the above as a doc in communication/README.md
[X] Update the tank's responses to the coordinator to be JSON objects instead of strings [X] Make sure all other network communication is JSON objects