Help with adapting the firmware to a different flight controller (Navio 2)

Hi,

As mentioned in the docs the rosflight firmware is developed for STM32F10x-based flight controllers (Naze32, Flip32, etc…) and STM32F4x5 boards (Revo).

I was wondering if the firmware can be adapted to Navio 2 flight controller and if possible, could you point me in the right direction. One potential setup that I can think of is, creating a virtual UART port and using it to communicate between rosflight_io and firmware. But note that this still requires creating a new rosflight board using the Navio 2 libraries.

Some of the reasons for exploring Navio 2 + rosflight:

  • Rosflight, obviously, is one the best platforms for researchers
  • Navio2 is like a companion computer + flight controller in a single unit, thus, more compact and fewer wires/connections onboard the vehicle.
  • Finally, (in my view, the most important) Navio2 uses Raspberry pi, can be used to run & test various lower-level controllers that require higher computation power and might not be possible using F3/F4 (again, to my knowledge). For instance, testing out lower-level controllers that require running optimizations at fairly decent rates.

Looking forward to further discussions on this,
Sincerely
Prasanth

You could certainly do this, but it will take some work. The ROSflight firmware is designed with a board layer that abstracts out access to various peripherals. To port ROSflight to the Navio, you will have to implement a new subclass of board. This includes writing drivers for such things as sensors and serial communications. Communication over UART would work fine, and we do that with the existing flight controllers.
You have some other options using existing microcontrollers:

  • Because ROSflight can communicate over UART, you can connect it to an offboard computer using a UART radio, saving weight on the aircraft.
  • ROSflight is designed from the ground up with the idea that computers would be able to do more powerful computations than the flight controller, so you can already offload heavier computations and stream just sensor data and motor commands.

@BillThePlatypus Thanks for getting back on this.

To port ROSflight to the Navio, you will have to implement a new subclass of board. This includes writing drivers for such things as sensors and serial communications.

Yes, I have already started working on board-subclass. Navio2 already provides drivers for sensors and other hardware peripherals. Currently, I interfaced imu, rc, barometer with the new board subclass here. I have to figure out a way to interface serial communication and parameters.

ROSflight is designed from the ground up with the idea that computers would be able to do more powerful computations than the flight controller, so you can already offload heavier computations and stream just sensor data and motor commands.

So, if I have to test a new lower-level controller and say, I implemented it on the companion computer, at what rate can I send the pwm signals to the fcu?

Thank you
Prasanth

I’m not sure of the limit for motor commands, but IMU data can be streamed at 500 Hz, and so motor commands can likely come in at least that quickly.

Hello, I’m wondering if you were successful in porting rosflight to navio2. I have the same issue right now and I am guessing you wanted to implement a custom controller since you were asking about motor commands refresh rate.

I am doing this as a research project and your help would be greatly appreciated.