Skip to main content

This package serves as the entry point for embedded applications using Python on Blue Robotics's Navigator

Project description

Navigator Library

Actions PyPI

This library serves as the entry point for applications that want to use Navigator with Python or C++.

1 . How-to setup the Raspberry Pi computer, please read Instructions. 2 . For Rust 🦀, please check the navigator-rs library.

Features

  • LEDs (User and RGB) access
  • PWM (Pulse Width Modulation) control
  • ADC (Analog Digital Converter) reading
  • Magnetometer / Accelerometer / Gyroscope sampling
  • Temperature reading
  • Pressure estimation

📖 Documentation:

Check the examples folder for further information and guide.

🐍 Python:

Install the library.

pip install bluerobotics_navigator

With that, you'll bee able to run the examples, or creating your own:

#!/usr/bin/env python

import bluerobotics_navigator as navigator

print("Initializing navigator module.")
navigator.init()

print("Setting led on!")
navigator.set_led(navigator.UserLed.Led1, True)

print(f"Temperature: {navigator.read_temp()}")
print(f"Pressure: {navigator.read_pressure()}")

print(
    f"Data ADC Channels: {navigator.read_adc_all().channel}"
)

print(f"Data ADC Channel: 1 = {navigator.read_adc(navigator.AdcChannel.Ch1)}")

data = navigator.read_mag()
print(f"Magnetic field: X = {data.x}, Y = {data.y}, Z = {data.z}")

🛠️ C++:

Follow our example folder as a template to create your own project. To compile and run the examples, you can run:

cd examples/cpp
cmake -B build -DCMAKE_BUILD_TYPE=Debug && cmake --build build --config Debug --parallel
# Run one of the examples
./build/simple
./build/rainbow

For an example of C++ code, you can check the following code:

#include "bindings.h"
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main() {
  printf("Initiating navigator module.\n");
  init();

  printf("Setting led on!\n");
  set_led(UserLed::Led1, true);

  printf("Temperature: %f\n", read_temp());
  printf("Pressure: %f\n", read_pressure());

  ADCData adc = read_adc_all();
  printf("Reading ADC Channels: 1 = %f, 2 = %f, 3 = %f, 4 = %f\n",
         adc.channel[0], adc.channel[1], adc.channel[2], adc.channel[3]);
  printf("Data ADC Channels: 1 = %f\n", read_adc(AdcChannel::Ch1));

  AxisData mag = read_mag();
  printf("Magnetic field: X = %f, Y = %f, Z = %f\n", mag.x, mag.y, mag.z);

  return 0;
}

Note: The CMakeLists_Standalone.txt is a self-contained CMake project file example. Users can use it as a template to create their standalone projects based on the navigator-lib.

🏗️ Supported Architectures

Currently, the library supports armv7 and aarch64 architectures, which are the official defaults for BlueOS. The library also provides C++ .so files for both gnu and musl.

For more detailed information, including installation instructions, schematics, and hardware specifications, please refer to the navigator hardware setup guide.

:ocean: Instructions for BlueOS (Recommended)

  1. Open the Autopilot Firmware page, enable Pirate Mode, and "change board" to SITL
    • This stops the autopilot firmware from trying to operate while the WebAssistant is in use
  2. Reboot the vehicle computer, and wait for the interface to re-connect

Note: Since this library access the Navigator hardware, it can´t run in parallel with ArduPilot. If you are running ArduPilot, be sure to disable it or set the board as SITL (Software Simulation) before running Navigator WebAssistant

:cherries: Instructions for Raspberry Pi OS

  1. Download the Raspberry OS image (32 or 64 bits)

Note: To use a kernel that matches with the BlueOS and avoid incompatilities, please use: 32 Bits: raspios_lite_armhf-2023-02-22 64 Bits: raspios_lite_arm64-2023-02-22

  1. Install the Raspberry Pi Imager and flash the image

Note: You can also automatically setup the ssh, user, hostname and wi-fi settings.

  1. Execute the following command to setup the overlay required for Navigator ( I2C, SPI, GPIOs & others)
sudo su -c 'curl -fsSL https://raw.githubusercontent.com/bluerobotics/blueos-docker/master/install/boards/configure_board.sh | bash'
sudo reboot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_armv7l.whl (1.5 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.1+ ARMv7l

bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.1+ ARM64

bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARMv7l

bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

File details

Details for the file bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_armv7l.whl.

File metadata

File hashes

Hashes for bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_armv7l.whl
Algorithm Hash digest
SHA256 80629f125913ff6949c12d7b90c4ee9adea66f3c955d40ae33557f6d4797f950
MD5 8475093ae02182953be5b69450f32245
BLAKE2b-256 c279a184ebf2fc0af125c235c47c20bba9cf1a8b6d1ad70b6aabfd306ddbc419

See more details on using hashes here.

File details

Details for the file bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for bluerobotics_navigator-0.0.6-cp39-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 af746fc8e9fa8501ed31d4bdea65b4e202fdaae05c981bb9de179c678f5036ff
MD5 25750e478aa12ef697e32fb2ef8443b7
BLAKE2b-256 935359701b7d52bcee5c2ebb5cc1cd60a20e3b693ce8777559084b0521b5ce40

See more details on using hashes here.

File details

Details for the file bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 375897360070941f177b6cc3223a19e2e5079808be5061045eab8fb8af8f09bc
MD5 93c8352f72c39649bf5e86e117170e4f
BLAKE2b-256 4b6d17058817327db78608d387b578240d2cb28309fb703a447f591aa64a6dd6

See more details on using hashes here.

File details

Details for the file bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for bluerobotics_navigator-0.0.6-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a55b804839f7807c765f933280c5aec66e3bb90c5fa13a534deb3d609cb6b836
MD5 b47567b383633d1fa0977b14b5de99ce
BLAKE2b-256 7d53e29e2b1e9612f2d4c47a3a4fe50f67650726720170ef15059869cbc3c79b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page