GoPiGo3 in C++ but not fully cooked

Took a look at the C++ API for the GoPiGo3 this morning (over Ubuntu 22.04 …) as a first step to building the ROS2 GoPiGo3 node in C++.

Managed to get the examples to run:

  • info returns GoPiGo3 board values:
GoPiGo3 info:
  Manufacturer    : Dexter Industries
  Board           : GoPiGo3
  Serial Number   : 56ECD67E5152415447202020FF192614
  Hardware version: 3.x.x
  Firmware version: 1.0.0
  Battery voltage : 9.234
  5v voltage      : 4.967

  • leds cycles the “Eyes” and “Blinkers”
  • “motors” I renamed to “encoders” as it actually only returns left and right encoder values

and I created:

  • us_ranger: reads the Grove Ultrasonic Ranger in AD2
  • drive: allows key press (a w d x) driving of GoPiGo3

But the most glaring absence is an API to load the /home/pi/Dexter/gpg3_config.json file.

I haven’t done a complete comparison of the Python API verses the C++ GoPiGo3.cpp API.

I did submit a pull request to fix two compile warnings, even though they did not prevent using the API as is.

My C++ is over 20 years rusty, so I really shouldn’t be contemplating writing a ROS2 GoPiGo3 node in C++. The fact that the GoPiGo3 C++ API is not fully developed is another reason not to pursue this further.

To view what I did, including my drive.cpp program: