Adding new Airframe to PX4 and QGC

Hi all,

I followed the guide (http://dev.px4.io/airframes-adding-a-new-frame.html) to add a new custom airframe configuration).

The configuration file is stored as /Firmware/ROMFS/px4fmu_common/init.d/2107_xhalerrv,
and the mixer file as /Firmware/ROMFS/px4fmu_common/init.d/xhale_rrv.main.mix

(BTW what does the numbering convention mean?)

I compiled the firmware and uploaded to my Pixhawk using
make px4fmu-v2_default upload

How do I select in QGC? I do not see this custom airframe appearing in any dropdown box when selecting airframe. Do I have edit a configuration file somewhere? Also, can I make this airframe configuration the “default” on boot?

Platform/Configuration:
px4 ( git branch v1.4.1 )
QGC 3.0.0 ( Running on Windows )
Linux Ubuntu 12.04 LTS

Thanks for your help!

QGroundControl loads ~/.config/QGroundControl/PX4AirframeFactMetaData.xml. I’m not sure what the location is on windows.
If you compile PX4, it generates an airframes.xml file. If you replace the original with the compiled one, it should be visible in QGC.

The simple way to do this is to flash the binary through QGC, which updates the file.

I am compiling on my linux development workstation while I am running QGC on a ruggedized windows laptop (which will be brought outdoor for flight testing).

Is there a way to do development/compiling on linux, while making it work on QGC (running on a separate windows computer?)

Thanks all for your fast response!

Ziyang

Update, it is working!

So I compiled the firmware on Linux, copied the binaries to the windows laptop (which will be running QGC). Then, I flashed using the compiled firmware using QGC. After applying and restarting, the entry appeared on QGC!

As for Bart’s suggestion, I think the file resides in User\AppData\Roaming\QGroundControl.org. This file is generated by uploading the custom firmware as detailed above.

Hope it helps. Perhaps @LorenzMeier can add a note about it in the dev guide. Maybe I’m new but this wasn’t too clear.

Thanks again!

Ziyang

1 Like

hi,gay. can the new airframe you add work correctly?

I have not flown it yet, but in ground test (in MANUAL mode) the passthrough for the servo signals works as expected.

Although strangely, I get duplicate entries in QGC interface as well as PX4AirframeFactMetaData.xml


@LorenzMeier You mentioned “flash the binary through QGC”. Do you mean .px4 file or .bin file? If .bin file, how to flash it? Thanks!

I flashed using the px4 file in /build_px4fmu-v2_default/src/firmware.

Can someone explain exactly which files are needed?

I put firmware_nuttx, firmware_nuttx.bin and nuttx-px4fmu-v2-default.px4 in the same directory (and the flash seems to work), Does it need any other files/libraries?

I think only nuttx-px4fmu-v2-default.px4 is needed. It works for me.

This piece of information in the Airframe development guide would have been very useful!

2 Likes

Well, it also works for me if I upload the .px4 file through QGroundControl. You just have to make sure to restart QGroundControl after you flashed the new firmware, otherwise it doesn’t show.

1 Like

Sure, it worked with a upload through QGroundControl for me as well. To me it was just natural to do the flashing using the make command, just after making a new build :slight_smile:

Would someone please elaborate on the process of “flashing the binary”. Which file do I need exactly and how do I do it? I have gotten as far as the original post but am unable to get it to appear in QGC. Thanks

in folder build_px4fmu-v2_default/src/firmware/nuttx

select this file in QGC custom firmware option: nuttx-px4fmu-v2-default.px4

still no luck. My file is here: (10609)

file:///home/vance/Pictures/Screenshot%20from%202017-04-13%2014-59-00.png

It looks like this :

file:///home/vance/Pictures/Screenshot%20from%202017-04-13%2014-59-55.png

I grab px4fmu-v2_default.px4 from here after building:

I upload that with custom firmware option in QGC, close, and reopen. Still no option use my airframe.

I did see that the MetaDatafile does NOT include my airframe after flashing.

Any ideas?

are you flashing from linux or windows?

This is what I have done

  1. compile on work machine running linux (make px4fmu-v2_default)
  2. copy out the entire build_px4fmy-v2_default/src/firmware/nuttx folder to windows laptop running QGC 3.1.3
  3. click firmware, select custom firmware option. Point it to px4fmu-v2_default.px4
  4. Restart QGC. It should be there.

I literally repeated the steps 5 mins ago. You can skip step 2 if you’re using the same machine to compile and flash

I must be missing a step previous to these but I am not sure what it could possibly be. There don’t seem to be that many steps in this process. I have two operating systems on my laptop, LInux and Windows. I have tried building and flashing in Linux. I also tried building in Linux and flashing on my Windows version of QGC just to try duplicating your process exactly. The new airframe never shows up. The init.d file has a unique name, unique type, unique mixer file. What else am I missing?

Thanks for all of your help

Teammate figured it out! I don’t know why, but it was necessary to delete the build folder before running make px4fmu-v2_default. This fresh build included the new init.d file.