This package serves as the entry point for embedded applications using Python on Blue Robotics's Navigator
Project description
Navigator Library
This library serves as the entry point for applications that want to use Navigator with Python or C++.
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.
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
Built Distributions
Hashes for bluerobotics_navigator-0.0.2-cp39-abi3-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04ea1892f2bec3267747b27e995dfaf2ef32619c025a6085bb369af2215695bc |
|
MD5 | b5e40d83a332e9f5b4b94955a2ff72a9 |
|
BLAKE2b-256 | ff0fdd86fcc5cdba24ad915cc27a29e1e816072e367301418ce740c69420690b |
Hashes for bluerobotics_navigator-0.0.2-cp39-abi3-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 128cdb0c440a9c74aefca579cf37838b780288174b78431d3be35c5f8652c02e |
|
MD5 | 9302ea6943b59349725a027d3f8ead4f |
|
BLAKE2b-256 | 3323c1146e19c1161fa17400c97867278512f187f400f957c6318decf02ca185 |
Hashes for bluerobotics_navigator-0.0.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999b1f3c45b5bebe8dff549c8531ddf67132042b2e73dd18a29c276b88ed4be8 |
|
MD5 | 5c5091636d6a955db9f1a52dbb67d044 |
|
BLAKE2b-256 | 39e92b36cd674ab141a5eb8e188bd81b1b00990ffa532bbdb836b4e750385f74 |
Hashes for bluerobotics_navigator-0.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d73a57e1e4a8ad4c6044191341d140aaa68a036b220c50d476d357b18f571b6 |
|
MD5 | fbb178eeb25a9f992c848455e85a053f |
|
BLAKE2b-256 | 51b521a9f55f73059cb43214b854be9961131ff0f8cb16df80bce918796efeab |