GPS and Compass Hardware

The BN880 board combines a GPS receiver with an HMC5883L-compatible magnetometer. The current navigation runtime consumes GPS fixes from the UART. Compass reading is available in a separate bench utility but is not integrated into the live route manager, so the docs do not claim live compass-based heading control.

Parts (Amazon)

How It Works

  • navigation.py opens the GPS on /dev/ttyAMA0 at 9600 baud and reads NMEA sentences line by line (GPS_PORT, GPS_BAUD).
  • Parsed fixes can be passed to the route manager and snapped to a graph vertex in trossachs_nav_graph.json. The A* planner routes over that graph and divides the route into AI and manual segments with crosswalk handoffs.
  • code/test_files/sensors/bn880_test.py can read the magnetometer over I2C for bench verification. That test path is separate from navigation.py.

Why This Choice

  • The BN880 packages GPS and compass hardware on one board, which keeps the physical sensor assembly compact even though the current runtime uses only the GPS path.
  • UART at 9600 baud is the standard, low-overhead interface for NMEA GPS and does not compete with the higher-rate LiDAR or camera buses.

Verify Before a Run

  • Bench test: code/test_files/sensors/bn880_test.py reads the module and prints fixes and compass data.
  • Failure symptoms: permission denied on /dev/ttyAMA0 can mean the serial console, device permissions, or another process owns the port. Do not confuse this port with the LiDAR: GPS is /dev/ttyAMA0; the LiDAR uses a CP2102 UART-to-USB Adapter.