BlueOS-core

Function

BlueOS-core is the body of BlueOS, and runs all of the built in services, along with the main web interface. It contains the key components for running, configuring, and operating a robotic vehicle, as well as a variety of convenience features to aid with system introspection and development.

Codebase

BlueOS-core is open source, and lives within the broader BlueOS GitHub repository. Issues can be used to report bugs or suggest features, and Pull Requests fixing bugs or adding new features are welcomed.

BlueOS is set up with a GitHub Action that automatically builds and deploys a BlueOS-core image when changes are pushed to the GitHub repository. If you want to make use of that functionality you'll need a DockerHub account, and will need to specify your DockerHub username (DOCKER_USERNAME) and password (DOCKER_PASSWORD) in your fork's GitHub secrets.

The BlueOS Version chooser can be used to install a custom image by either

  1. Changing the "Remote" to your DockerHub repository, then installing like you would normally
  2. Doing a "Manual Upload" of a .tar compressed BlueOS-core Docker image

Structure

  1. Dockerfile (and corresponding .dockerignore file) for building the BlueOS-core Docker image
  2. **/install-*.sh scripts that the Dockerfile uses to install the tools, libraries, and services
  3. tools scripts used to install the underlying programs used by the service backends
  4. configuration files that the Dockerfile moves to appropriate locations for the programs they apply to
  5. start-blueos-core script that runs when the BlueOS-core container gets started
    • Responsible for configuring and starting the services
    • Supports disabling a comma-separated list of core services via the BLUEOS_DISABLE_SERVICES environment variable (New in 1.2)
  6. libs code libraries of shared functionality available to the service backends
  7. services code for running the services
    • Mostly Python backend code, often wrapped around / making use of a program installed by tools
    • Some frontend code, for services that have a frontend that opens in its own window
  8. frontend web code for displaying the BlueOS web interface, including the main interface elements for the services
    • /public: browser tab icons and the like
    • /src:
      • Mostly Vuetify visual components and Typescript interface code
      • /assets: styling, images, and models used throughout the web interface

Services

BlueOS provides automatic detection of Available Services, whereby any HTTP server with a title tag is found and listed. This is particularly helpful for testing out API calls, both for development and debugging purposes.

Documentation can also be parsed if

  • it follows the Swagger / OpenAPI specification, and
  • is available at /docs or /v1.0/ui

The services built into BlueOS are as follows:

Service NamePurposeWebpage(s)?Tool(s)?Frontend?
ArduPilot ManagerHandles ArduPilot firmware connection, flashing, and MAVLink routing.- Autopilot Firmware
- MAVLink Endpoints
- tools/ardupilot_tools- views/Autopilot.vue
- views/EndpointView.vue
- components/autopilot
- store/autopilot.ts
- store/autopilot_manager.ts
- types/autopilot.ts
- types/autopilot/parameter*.ts
Available ServicesFinds and lists available HTTP servers and their API documentation.- Available Services--- views/AvailableServicesView.vue
- components/scanner
- store/servicesScanner.ts
Bag of HoldingA simple key-value storage API, used for storing and retrieving data as JSON objects through HTTP requests.- Bag Editor--- views/BagEditorView.vue
- store/bag.ts
Beacon ServiceHandles mDNS domain advertisement and local network vehicle identification--- tools/dnsmasq- components/beacon
- store/beacon.ts
- types/beacon.ts
BlueOSThe main BlueOS interface- Dashboard- tools/nginx- views/MainView.vue
- components/app
- components/notifications
- store/frontend.ts
- store/settings.ts
- types/notifications.ts
BridgetManages serial bridges.- Serial Bridges- tools/bridges- views/BridgesView.vue
- components/bridges
- store/bridget.ts
- types/bridges.ts
Cable-guyManages ethernet IP(s) and DHCP server configuration----- components/ethernet
- store/ethernet.ts
- types/ethernet.ts
CommanderProvides access to the operating system, and allows running arbitrary bash commands in the core docker container.------
File BrowserProvides a graphical interface to the file system.- File Browser- tools/filebrowser- views/FileBrowserView
- types/filebrowser.ts
helperLists available webpages- Sidebar--- types/helper.ts
KrakenManages extensions and the extension store.- Extensions Manager--- views/ExtensionView.vue
- views/ExtensionManagerView.vue
- components/kraken
- types/kraken.ts
log_zipperGZips old log files to reduce space usage, and deletes them if space runs out.------
Log BrowserAllows browsing, downloading, and viewing autopilot log files.- Log Browser- tools/logviewer- views/LogView.vue
- components/logs
MAVLink Camera ManagerManages camera and video stream pipelines, and presents them over MAVLink.- Video Streams- tools/ mavlink_camera_manager- views/VideoManagerView.vue
- components/video-manager
- store/video.ts
- types/video.ts
MAVLink2RestA REST-based interface to the MAVLink network- MAVLink Inspector
- Autopilot Parameters
- Vehicle Setup
- tools/mavlink2rest- views/MavlinkInspectorView.vue
- components/mavlink
- components/mavlink-inspector
- store/mavlink.ts
- types/mavlink.ts
- views/ParameterEditorView.vue
- components/parameter-editor
- types/parameter_repository.d.ts
- views/VehicleSetupView.vue
- components/vehiclesetup
NMEA InjectorInjects NMEA GPS position messages into the MAVLink stream.- NMEA Injector--- views/NMEAInjectorView.vue
- components/nmea-injector
- store/nmea-injector.ts
- types/nmea-injector.ts
PardalHelps to perform network speed and latency tests.- Network Test--- views/NetworkTestView.vue
- components/speedtest
Ping ServiceDetects and manages Ping family sonar devices.- Ping Sonar Devices- tools/bridges- views/Pings.vue
- components/ping
- store/ping.ts
- types/ping.ts
System InformationProvides access to and information about the system status and operating system.- System Information- tools/linux2rest- views/SystemInformationView.vue
- components/system-information
- store/system-information.ts
- types/system-information
- widgets
ttyd - TerminalProvides a web-based terminal.- Terminal- tools/ttyd
- tools/scripts
- views/TerminalView.vue
Version ChooserManages BlueOS version selection and updates.- BlueOS Version--- views/VersionChooser.vue
- components/version-chooser
- types/version-chooser.ts
Wifi ManagerManages wifi detection and hotspot configuration.--- tools/hotspot- components/wifi
- store/wifi.ts
- types/wifi.ts

Contributions

Adding a Flight Controller

Adding USB detection support for a new type of flight controller board is reasonably straightforward, but does require a few different steps:

Find the USB device information

  1. Connect your flight controller board via USB1 to a computer running BlueOS
  2. Go to the BlueOS Terminal page
  3. Open a Python console (run the python3 command)
  4. Run from serial.tools.list_ports import comports
  5. Run from pprint import pprint
  6. Run [pprint(port.__dict__) for port in comports()]
  7. Get the "product" and "manufacturer" values for your flight controller board
1

Non-USB serial connections are not yet supported.

Find the flight controller hardware information

  1. Go to the ArduPilot hardware definition files
  2. Find the folder corresponding to your flight controller board
  3. Find the APJ_BOARD_ID variable in the hwdef.dat or hwdef.inc file

Add the board, and confirm it works

  1. Fork the BlueOS repository
    • You'll need a GitHub account to do this
  2. Click where it says master, and create a new branch (e.g. add-pixhawk-6C)
  3. Navigate to core/services/ardupilot_manager/typedefs.py and add your board's name and type to the Platform class
    • Use PlatformType.Serial for USB/serial connections - Linux is reserved for sensor/peripheral expansion boards that run the autopilot firmware directly on the Onboard Computer
  4. Navigate to core/services/ardupilot_manager/flight_controller_detector/board_identification.py and add appropriate SerialBoardIdentifier instances to the identifiers list (using the "product" and "manufacturer" values from earlier)
    • The "product" is more important/useful, because one "manufacturer" can make multiple different board types
  5. Navigate to core/services/ardupilot_manager/firmware/FirmwareInstall.py and add your board to the get_board_id function (using the APJ_BOARD_ID value from earlier)
  6. If you did your code modifications in GitHub skip to the next step - if you're editing the files in a local clone make sure to git commit and git push back up to your GitHub fork of the repository
  7. GitHub should prompt you that there are recent changes in your new branch - click the prompt to submit a Pull Request to the upstream Blue Robotics repository
    • The "files" tab of your pull request should look similar to this example
  8. Wait for the GitHub actions to complete (at the bottom of your pull request), then find the build action corresponding to your branch, and download the BlueOS-core-docker-arm-v7 artifact from it
  9. Go to the BlueOS Version Chooser, scroll down to the bottom, and "manual upload" the artifact you downloaded
  10. Once BlueOS has restarted, see whether the flight controller board is being detected as an autopilot in the Autopilot Firmware page

Edit this page on GitHub