Skip to content

A simple, powerful and compact upgrade to the SwiftBot platform from BUL, with a focus on performance and ease-of-use.

License

Notifications You must be signed in to change notification settings

BisocM/SwiftBot-Expanded

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

SwiftBot - Expanded is a compact library written in C++ with a Java wrapper, focused on ease of use and performance, and includes slight upgrades and extensions to the original SwiftBot platform provided by the BUL CS Department.

SwiftBot Expanded

Core Features

The library was written with support for both old and new components in mind. An exhaustive list of supported components includes:

  • SSD1306 OLED Display
  • HMC5883 and MPU6050 Sensor Fusion for Yaw Calculations
  • HC-SR04 Ultrasonic Sensor
  • IMX219 Raspberry Pi Camera
  • SN2318 Underlight LED Array
  • Dual H-Bridge Motors
  • GPIO-Controlled Buttons & LEDs

The focus of the project was on the camera module and overall usability of the bot. The introduction of the OLED and a zero-copy mmap pipeline for video streaming enables a combination of improved UX and the ability to hook video footage to OpenCV processing on the Java layer.

The extension also features a 3D-printed mount for various components, as shown in the image above.

The project was compiled on the Raspberry Pi OS.


Build Guide

The Java artefacts rely on the native libswiftbotextended.so that lives under cpp/. Follow the steps below to compile the shared library and package the Java wrapper so the native binary is embedded automatically.

1. Build the Native Library

  1. Install the native prerequisites (examples for Raspberry Pi OS / Debian):

    sudo apt update
    sudo apt install build-essential cmake libgpiod-dev libcamera-dev libavcodec-dev libavformat-dev ffmpeg

    Ensure ffmpeg is discoverable on PATH; the CMake build fails if it is missing.

  2. Configure and build the shared library:

    cd cpp
    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
    cmake --build build --target swiftbotextended

    The compiled library is written to cpp/build/libswiftbotextended.so.

Optional: cmake --install build can be used if you want to install the library system-wide.

2. Package the Java Wrapper

  1. Verify the Maven property in java/swiftbot-expanded/pom.xml points at the shared library you just built:

    <swiftbot.native.path>${project.basedir}/../../cpp/build/libswiftbotextended.so</swiftbot.native.path>

    Adjust this path only if you keep the .so in a different location.

  2. Compile and package the Java module (from repository root or directly inside java/swiftbot-expanded):

    cd java/swiftbot-expanded
    mvn clean package

    During process-resources, Maven copies libswiftbotextended.so into target/classes/natives/linux-x86_64/ so the resulting JAR contains the native payload.

  3. Run the bundled demo. When the .so has already been copied into target/classes/natives/... (after the previous step), the demo runs without extra flags:

    mvn exec:java

    Pass -Dswiftbot.native.path=/absolute/path/to/libswiftbotextended.so only if you want to override the bundled copy with a different build.

    mvn exec:java -Dswiftbot.native.path=/absolute/path/to/libswiftbotextended.so

The packaged JAR can now be redistributed; it extracts the native library when SwiftBotNative.load() runs, so students only interact with the Java façade.

Licensing

Copyright © 2025 BisocM

This project is licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributing

While active development on SwiftBot - Expanded has concluded, the source code remains open for educational and community-driven extensions.

If you wish to contribute improvements or fixes, you may do so via the standard GitHub forking workflow:

  1. Fork this repository to your own GitHub account.

  2. Clone your fork locally:

    git clone https://github.com/<your-username>/SwiftBot-Expanded.git
  3. Create a new branch for your changes:

    git checkout -b feature/your-feature-name
  4. Commit and push your modifications:

    git commit -m "Describe your change"
    git push origin feature/your-feature-name
  5. Open a Pull Request to the main repository, explaining your proposed modifications clearly.

Acknowledgements

A special thank you to the Brunel University London Computer Science Department team, as well as the Trilobot team at Pimoroni, for bringing the SwiftBot to life.

About

A simple, powerful and compact upgrade to the SwiftBot platform from BUL, with a focus on performance and ease-of-use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors