Java Robotics library for the Raspberry Pi
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Java Robotics library for the Raspberry Pi.

B9 is a Java library which provides robotics devices support and other cool stuff for the Raspberry Pi.

This project is part of the Robotics Mission to Antarctica


Devices supported:

  • #1589F0 Blue Robotics BlueESC T100/T200 Marine Thrusters
  • #1589F0 Blue Robotics BasicESC (or similar) via a PCA9685 PWM servo driver
  • #1589F0 RockBLOCK Iridium 9602 Satellite Modem
  • #1589F0 GPS parsing and integration via the Pi's onboard serial
  • #1589F0 HMC5883L Compass Module (I2C)
  • #1589F0 Wii Classic Controller (I2C)
  • #1589F0 Raspberry Pi camera - via the raspistill and raspivid executable
  • #1589F0 Binary Motor Control - forward and reverse 'tank tracks' via GPIO

Update: Blue Robotics have suspended production of the BlueESC (internal and external) due to failure issues. The BlueESC should not be used in mission critical situations.

Library features:

  • #33ff15 Spacial maths, decimal degrees, headings, position, target and angle calculations.
  • #33ff15 Compact Binary Symmetric Serialization - for broadcast and logging of telemetry and command data
  • #33ff15 UDP transceivers for telemetry and command data
  • #33ff15 Abstract System Time - supports simulated time for running simulations in non-realtime

B9 uses the excellent Pi4J library.

Getting Started

The package contains utilities and tools to get you started.

To use B9, begin by installing Pi4J on your Raspberry Pi. Pi4J will automatically link in it's native libraries, so it's important Pi4J is actually installed rather than just trying to use the jar files on their own.

Check out B9 either on your Raspberry Pi or on another machine which has a Java 8 installed and Maven. Change directory into B9 and then build the project...

    mvn clean install

The build process will create the B9 jar and copy all the dependency jars into the 'target' directory. Copy the jar files onto the pi if you've built this on another machine. Put them in a directory such as 'target'. If you've built the project on the pi you should be able to run one of the tools using a command such as this...

    java -cp "target/*"

Some GPIO device access may require 'sudo' root access. Raspbian seems to be allowing more of these to be accessed by non-root users. There are also ways to add devices to the "non-root" list.

Also, by default, many devices such as serial and I2C are disabled in Raspbian. You'll need to enabled them as needed. The serial port is often allocated to a TTY session. There are various ways to disable this depending on the Raspbian version you re using.

From here you can make your own maven project and include B9 as a dependency. You could use the same maven copy-dependencies goal.