3689624585?profile=original

This blog is a continuation of my previous post.

How to build a High-Definition FPV UAV using a Rasperry PI with HD camera, using a high speed WiFi link

This post will discuss how to use GStreamer and Mission Planner together to display the HD video with a HUD (Head-Up-Display).

Note: I have only tested this feature on Windows so the instructions given here are for Windows only. 

To give proper credit, the HUD created here was borrowed from APM Planner, a Qt-Based app similar to Mission Planner. The HUD part was created from the Qt codebase QML HUD created by Bill Bonney who is on the APM Planner development team. To make the HUD work with the background video, I used a GStreamer library called "QtGStreamer" which integrates GStreamer plugins with painting on a Qt widget.  This library is available on the GStreamer website.

The end-result is dynamically added to Mission Planner using the plug-in architecture. 

In the previous posts I discussed used a Raspberry PI and a High-speed WiFi link using GStreamer on the PI and the ground station PC.  To get the HUD to work, you need to already have a successful link with the video on your ground station. 

Here are the steps to follow to install the plugin:

1) Install Mission Planner.

2) Download and install GStreamer from this link.  Use the x86 version, the x86_64 version will NOT work. (Use the default path 'C:\GStreamer' when installing). When installing GStreamer, select 'Custom' install and select ALL plugins to be installed.

3) Follow the steps in the previous blog noted above to get your video stream working.

4) Download and the MSI installer from this link. and run the installer.

If all went well, you should have the plugin installed.

Open Mission Planner and navigate to the "Flight Data" page and right-click on the map. You should see a menu item called "GStreamer HUD" as shown below:

3689624376?profile=original

Select this menu item and the following screen should appear:

3689624624?profile=original

In the upper-left corner is a context menu. Here is where you enter your GStreamer Pipeline string. If you had the video displaying without the HUD using a valid pipeline, enter it here.

Note: The GStreamer Pipeline string should be exactly the same as the string you used before, but WITHOUT the final video sink element. The video sink is the QtGStreamer element which will be added automatically by the plugin. The GStreamer pipe should therefore be the same, except remove the last element for the video sink.

Here is an example string I used on my setup:

udpsrc port=9000  buffer-size=60000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_h264

If all is well, you can connect to your UAV and see the HUD elements moving.  To change the HUD, right click on the display and select which elements you want to display. The default is to display everything shown here. 

If anybody has problems, please post back and I'll update the blog in case I missed something, and you cannot get it to work.

Happy Flying!

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • FYI, I have posted a new version of the HUD which fixes the color balance issue. I found a bug in the QtGstreamer code and have fixed it. I will post the fix to the GStreamer developers and hopefully they will incorporate the fix in the source. There are a number of color matrix multipliers for color corrections for various formats, and it turns out BT601 and BT709 were swapped for I420 (YV12) format.  Once I swapped them back, the colors are fine. You should set the sliders for hue, saturation, contrast and brightness to the center positions to get the default. The update is on dropbox, the same location as specified in the blog. If anybody tries this out, please let me know if it works for you.

     ap105, I'll have your requested items, possibly this week, and some other items that I have added. The status messages are now included in the display, so you can see if you are disarmed or not, and the GPS status. 

  • @Patrick: My wish list for the HUD would countain: watts, satcount, gpshdop, DisToHome, timeInAir. Were you able to resolve the color balance issue with the gstreamer plugin? Looking forward to your next release!

  • For anybody using the HUD, please send me a 'wish list' of items that you want to display. I have another release that I am going to post soon, but the user-customized version stills needs work. I have made some improvements to the first revision, one being increasing the font size, as I realized that it's hard to read with FPV goggles, and I added some additional data items, such as a 'home heading' indicator, and the warning message popups.

  • @Patrick. Well noted. One more thing, would be good to see if we get any improvement  by adding  -n -pf high  behind bitrate.

  • @bocorps.  I tried using that element but it did not improve latency. When I looked at the source code, it's just a wrapper around raspivid.

  • Did someone tried  rpicamsrc element ? some people report lower latency with it. On Pi side it would start by gst-launch-1.0 rpicamsrc ! 'video/x-h264, width=1280, height=720, framerate=48/1 

  • @bocorps,  I don't use the stock motor so I can't comment on the performance on that. I have a 700kv (3548) with an 11x7 prop and 50% throttle will cruise the wing nicely. What size prop are you using? The plastic folding prop that came with the GoDiscover I threw in the trash. I am using a 5800mAh battery and with that setup I can fly for around 25 minutes with 15 to 20% battery to spare.

  • @Patrick, raspivid -t 0 -w 1280 -h 720 -fps 48 -b 6000000 -o - | tee 

    i think latency is around 120-150ms, i have no idea how to measure it with accuracy. At home i get no error. Besides, last week i tried the whole setup (but with 30fps and bitrate 1700000, i got horrific pixelation) on the godiscover, with stock motor i had to use 75% throttle to keep the wing in the air, do you think it is normal ?

  • @bocorps,  I assume you are running 720p since the PI camera can only do 30 fps at full HD.  I tried a similar frame rate, but GStreamer reported errors saying, "Ignoring insane framerate".  Are you getting any errors when you run >30fps? What is your latency?

  • I just tried  to stream in 48fps with 6000000 bitrate, result is much better than 30fps  + bitrate 2000000.

This reply was deleted.