Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

wpisailbot/sailbot19-20

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sailbot19-20

Sailbot code for 2019-2020 MQP

Status

The following have been addressed and tested at least to some extent:

BBB

  • Socket comms with the trim tab
  • gRPC
  • Modular architecture
  • Comms with Arduino
  • Comms stability and recovery
  • Reading Airmar

Arduino

  • Reading PWM - Arduino
  • Outputting PWM - Rudder
  • Outputting PWM - Ballast
  • Comms with BBB
  • Comms stability and recovery

Crossplatform issue tips

Generating Protobuf and gRPC files

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.

Protobuf files 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'

Protobuf files for Arduino-based boards

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'

gRPC files for BBB

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'