Sailbot code for 2019-2020 MQP
The following have been addressed and tested at least to some extent:
- Socket comms with the trim tab
- gRPC
- Modular architecture
- Comms with Arduino
- Comms stability and recovery
- Reading Airmar
- Reading PWM - Arduino
- Outputting PWM - Rudder
- Outputting PWM - Ballast
- Comms with BBB
- Comms stability and recovery
You must generate language specific Protobuf and gRPC files in order to use the .proto
definitions. To do this, run generateProtos.sh
. If it doesn't work, check that the directories in the script match what you have going on. Use the below commands, comments in the script, and the internet to help.
Also check that you have the following installed:
- Nanopb, version 0.3.9.3 is the last known working version
- Protobuf, version 3.11.0 is the last known working version.
- Python3
- gRPC
$SRC_DIR
is the source of the .proto files and $DST_DIR
is where the generated language-specific files should go. $NANOPB_PATH
is the path to the protoc program packaged with Nanopb, and $PROTOC_PATH
is where the protoc application packaged with Protobuf is located.
If running these commands by hand, note that the protobuf files must be generated twice - once for the BBB and once for the Arduino-based boards. The gRPC files must only be generated for BBB.
Linux:
$PROTOC_PATH -I=$SRC_DIR --python_out=$DST_DIR $SRC_DIR/*.proto
Windows:
$PROTOC_PATH -I='$SRC_DIR' --python_out='$DST_DIR' '$SRC_DIR/*.proto'
Linux:
$NANOPB_PATH --nanopb_out=$DST_DIR $SRC_DIR/TrimTabMessages.proto
$NANOPB_PATH --nanopb_out=$DST_DIR $SRC_DIR/ArduinoMessages.proto
Windows:
$NANOPB_PATH --nanopb_out='$DST_DIR' '$SRC_DIR/TrimTabMessages.proto'
$NANOPB_PATH --nanopb_out='$DST_DIR' '$SRC_DIR/ArduinoMessages.proto'
Linux:
python -m grpc_tools.protoc -I=$SRC_DIR --python_out=$DST_DIR --grpc_python_out=$DST_DIR $SRC_DIR/*.proto
Windows:
py -3 -m grpc_tools.protoc -I='$SRC_DIR' --python_out='$DST_DIR' --grpc_python_out='$DST_DIR' '$SRC_DIR/*.proto'