Python library bluerobotics_navigator help

Hello humans! I am pretty stuck here so any help would be appreciated.

Here’s what I have going on:

  • Raspberry Pi 5
  • Navigator Flight Controller
  • BlueOS 1.4
  • Python 3.11.7
  • Using BlueOS web terminal in pirate mode

I am attempting to use the bluerobotics_navigator python library to do some basic testing on a custom setup. I have installed the Python package using pip and I’m assuming that it is the latest/correct version. Here is my test script. It’s super basic:

import bluerobotics_navigator as navigator

navigator.init()

acceleration = navigator.read_accel()

forward_acc = acceleration.x

print(forward_acc)

Super simple, right? It’s basically just a Hello World to make sure the library can control the Navigator. I have also tried other basic functions from the documentation, but I keep getting something akin to this error:

thread ‘’ panicked at ‘Failed to create Bmp280: Other(())’,
/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/navigator-rs-0.6.0/src/lib.rs:442:22
stack backtrace:
0: rust_begin_unwind
at /rustc/c373194cb6d882dc455a588bcc29c92a96b50252/library/std/src/panicking.rs:578:5
1: core::panicking::panic_fmt
at /rustc/c373194cb6d882dc455a588bcc29c92a96b50252/library/core/src/panicking.rs:67:14
2: core::result::unwrap_failed
at /rustc/c373194cb6d882dc455a588bcc29c92a96b50252/library/core/src/result.rs:1651:5
3: navigator_rs::NavigatorBuilder::build_navigator_v1_pi4
4: bluerobotics_navigator::NavigatorManager::get_instance
5: set_led
6: bluerobotics_navigator::*::pyfunction_set_led
7: pyo3::impl*::trampoline::trampoline_inner
8: bluerobotics_navigator::\_::::DEF::trampoline
9:
10: \_PyObject_MakeTpCall
11: \_PyEval_EvalFrameDefault
12:
13: PyEval_EvalCode
14:
15: Py_run_SimpleFileObject
16: Py_RunAnyFileObject
17: Py_RunMain
18: Py_BytesMain
19:
20: \__libc_start_main
21: \_start

note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Traceback (most recent call last):
File “/root/test.py”, line 14, in
navigator.set_led(navigator.UserLed.Led1, True)
pyo3_runtime.PanicException: Failed to create Bmp280: Other(())

It’s important to note that this isn’t the exact error message I got with this code, as the code that generated this message was setting an LED, but the rest of the message is the exact same. Has anyone seen this before, or know what could be happening? Any help would be appreciated. Thanks!

Hello @WinstonCSM,
Can you retry the code with the following code before init()?

from bluerobotics_navigator import NavigatorVersion, Raspberry

navigator.set_navigator_version(NavigatorVersion.Version1)
navigator.set_raspberry_pi_version(Raspberry.Pi5)

This example may be helpful for further reference.

3 Likes

DUDE!!! I copied the example script and it worked perfectly. You are actually amazing. Thank you so much!!

1 Like