Board index FlightGear Development Canvas

Canvas & OpenGL ES (Rasberry PI, Android etc)

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby Hooray » Tue Jan 28, 2014 11:59 am

split from: Subject: TQ/Panel for FG made with Kivy


pommesschranke wrote in Tue Jan 28, 2014 7:08 am:About "FGPanel without FG" I just had another Idea

There's also the long-term plan to eventually port FGPanel back into FG and come up with some sort of "FGCanvas" mode, where Canvas-based displays could be run in a separate "standalone" mode and interface to the main/master FG instance.
I don't think that the Canvas system currently builds against just OpenGL ES - but it should be possible to identify problematic use-cases and make the Canvas support OpenGL ES by setting some OSG traits accordingly - at some point, i.e. 12+ months from now

In general, it pays off to unify things - otherwise, there's lots of duplication and re-invention involved.
Technically, we could definitely run an OpenGL ES-based Canvas on a mobile device, we just need people interested in pursuing this and playing with it - as well as report any issues/showstoppers

Such an integrated solution would also make it possible to show any canvas texture (instrument, dialog/window, MFD etc) on external devices:
Image
http://wiki.flightgear.org/FGCanvas
Last edited by Hooray on Fri Jan 31, 2014 3:12 pm, edited 1 time in total.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: TQ/Panel for FG made with Kivy

Postby Hooray » Fri Jan 31, 2014 3:08 pm

pommesschranke wrote in Fri Jan 31, 2014 1:52 pm:
Technically, we could definitely run an OpenGL ES-based Canvas on a mobile device, we just need people interested in pursuing this and playing with it - as well as report any issues/showstoppers

I am interested.
It would be very nice to have PFD & ND on my tablet or a small LCD driven by RaspberyPi


We have other folks interested in running such things on Android devices or mobile phones:
Subject: using FGpanel to display various instruments and electrics

someguy wrote:I'm waiting for someone to write an app that will display instruments on an iPad over wifi or Bluetooth, or even USB, while the rest of the simulation runs on my Mac. Naturally, the controls would respond to touch gestures.


So it would make sense to coordinate such efforts, because the requirements will be very similar.
Even some core developers discussed this on the devel list: http://wiki.flightgear.org/Howto:Optimi ... .2F2013.29

For example, see: http://wiki.flightgear.org/Howto:Optimi ... le_devices

The Canvas is a property tree-based subsystem using listeners, the canvas is primarily a wrapper on top of Shiva and OSG that is invoked via listeners.
So all the OpenGL code is either located in Shiva or in OSG - OSG can be told to use OpenGL ES.

So it would be a matter of experimenting with it.
For this particular project, I would suggest to extract the Canvas into a standalone executable - something like this has been previously done by TorstenD when he came up with FGPanel, he "just" extracted FlightGear's 2D panel code and turned it into a standalone binary.

This alone would help us ensure that we can optimize the canvas to support OpenGL ES - once that is working, you could cross-compile the standalone canvas binary.

Technically, this will involve some -but not all- of the steps outlined at: http://wiki.flightgear.org/FGCanvas
(not all of them, because FGCanvas is eventually intended to be merged back into the main code base)

TheTom already prepared the Canvas subsystem to be used outside FG, see:
http://wiki.flightgear.org/Canvas
The canvas system has been refactored such that it can be more easily re-used in other programs, this included moving the Canvas component from FlightGear to SimGear and releasing the canvas code under SimGear's license (LGPL).
It is now possible to use the Canvas in projects unrelated to FlightGear, but you will obviously benefit from using certain FlightGear-related technologies, such as an 1) property tree 2) SGSubsystem-based main loop, 3) an osgviewer-based main window, and 4) Nasal scripting.
Icecode's FGRadar project is such a completely separate code base from FG, which uses SG/FG components to simplify code reuse, without re-inventing the wheel.
For this very purpose, FGRadar uses a custom "SGApplication" framework - so that existing FlightGear subsystems can be more easily reused in different projects. All that's needed is deriving your own class from "SGApplication" and implementing its interface. The whole idea behind "SGApplication" is to provide a scriptable framework for OpenGL applications, fully based on 1) OSG, 2) SGSubsystems, 3) Nasal scripting and 4) the Canvas.


Technically, another thing needs consideration, for technical reasons:
http://wiki.flightgear.org/Canvas
Beginning with 2.8, up to 2.99+, all FlightGear versions require FBO support for the canvas system to work properly [1]. In particular, this means that very old GPUs such as Intel 910/915 cards are currently not supported (FBO support is obviously also required for Rembrandt to work).
Unless render-to-texture (RTT) support can be provided through some form of fallback mode for hardware without FBO support, we we might need to consider officially un-supporting such old hardware from 3.0 (since we can already detect the vendor as Intel).
It seems 940-class chips are okay, and the 2000/3000/4000HD versions seem to work, but the earlier 9xx and before are going to be problematic for the time being [2]. At the moment, it isn't clear if telling the od_gauge/OSG backend code to use pbuffer rendering instead of FBOs would already help solve the problem [3].


This should give you a rough idea on what's involved in extracting the canvas system into a separate code base, to cross-compile it for other devices.
Basically, the steps are:
  • use the FGPanel/FGRadar or SGApplication code base to come up with a SGSubsystem-based program
  • add the Nasal, events (timers) and property tree subsystems
  • add the canvas system
  • check where OpenGL ES is not yet supported, report issues or fix them directly
  • come up with workarounds regarding the FBO issue

40-60% of this are already done inside FGPanel and FGRadar - so the first weekend will be primarily spent doing "copy & paste".
If you are interested in working on this, you should obviously know some C++ and you should be able to build from source.
If that's not a problem, I suggest to raise the question in the canvas forum, so that TheTom can provide some more informed input.

It would definitely be a useful project, not just for Rasberry PI support, but for FG itself - because the whole FGPanel/FGCanvas idea is generally agreed to be useful, so any work related to this would be highly appreciated, and we're here to help you accordingly.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby TheTom » Sat Feb 01, 2014 2:06 am

I'll get a Raspberry Pi soon, so I will probably try to also run the canvas there :-)
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby Hooray » Sat Feb 01, 2014 2:11 am

FWIW, just in 2013, I have been offered free hardware and donations by 3 different forum users (including 1 Rasberry PI), the only thing they asked for in return was improving FG's interfacing support - I told them that I am not a hardware guy and politely refused those offers, but I could check my inbox to see if I can still find them - i.e. if anybody is really serious about it, in the sense that they are able to 1)build FG from source, 2) know C/C++ and cross-compiling, 3) have OSG/OpenGL experience - then, it would be a real pity not to provide them with said hardware.

Overall, this shows that we should set up some channel for such offers - it speaks for itself that I am getting these offers, without ever having posted anything related to embedded systems - obviously, just based on my forum postings and helping in the I/O forum ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby TheTom » Sat Feb 01, 2014 2:32 am

I've just seen that the Raspberry Pi has hardware accelerated OpenVG support, so we won't need ShivaVG and the path rendering should be quite efficient.

Appart from some really expensive flightsimulator hardware, my problem is usually not the missing hardware but limited time :-) Once someone started with bounties to motivate people, maybe the same could be done with hardware. But the main problem of developers - the limited time - will probably not be solved by this.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby Hooray » Sat Feb 01, 2014 2:55 am

Right, not only is OpenVG natively supported in hardware, but there's even a vector font library available named "vgfont".
This OSG discussion may also be of interest for anybody pursuing this venture: http://forum.openscenegraph.org/viewtop ... &view=next
And specifically: https://code.google.com/p/osgrpi/

I am also not so sure about bounties, no matter if it's hardware, software or money - there's simply a certain barrier to entry involved when it comes to contributing. And it seems that some companies even donated hardware to FG hoping to prioritize development of hardware support (namely Saitek or CH products) without realizing, that hardware alone doesn't magically result in FlightGear support materializing :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby hollingwood » Mon Feb 22, 2016 8:57 pm

Hiya,
This is probably not the most appropriate thread, but here goes. (Moderator: please move as necessary)

This concerns using a Raspberry Pi to implement FGPanel in place of a full-size computer. For the information of those playing with porting FGPanel to the Raspberry Pi you should be aware that the latest release of Raspian Jessie (February 2016) for the Raspberry Pi 2 (not Raspberry Pi 1) now incorporates an experimental driver supporting OpenGL 2.1. For more details see:

http://www.geeks3d.com/20160209/raspber ... 1-support/
and:
http://www.geeks3d.com/20160215/raspber ... b-0-9-6-0/

I have tried the test environment. I will attempt to run FGPanel with it during the next few weeks.
Regards
FG environment: hp xw8600 2 Xeon quad core 2.66GHz
GTX760 graphics: 4 - X screens
FG v3.2 - x3 Viewsonic 2410 23" 1920 x 1080
FGPanel - x2 Samsung Syncmaster 740b 15" 1280 x 1024 as 2560 x 1024 hard cockpit
Aircraft: Cessna172sp
hollingwood
 
Posts: 21
Joined: Fri Oct 10, 2014 6:06 pm
Location: Yorkshire, UK
Version: 3.2.0
OS: Ubuntu 14.04

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby Hooray » Mon Feb 22, 2016 9:23 pm

A few weeks ago there were threads related to this, i.e. FGPanel on Rasberry PI, and Torsten seemed to appreciate the idea (and patches) very much: https://sourceforge.net/p/flightgear/ma ... l_list=all
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11354
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby hollingwood » Tue Mar 01, 2016 6:22 pm

I have now looked at the discussion on that thread.

I have downloaded FG 3.4.0 source and compiled FGPanel on a separate fast Linux computer from my FG setup. I have tested it and it works correctly displaying all instruments and radio stack updating by udp from my FG computer. I have also downloaded and compiled the proposed FGPanel port for Raspberry Pi (based on FG 3.4)which includes a version for Linux (non-Raspberry Pi) using OpenGL 2 and the GLEW library. I have compiled and tested this version also. It runs but does not display the textures of the instruments. The display shows only the frame rate and the digits display of the radio stack. I have all necessary libraries loaded and cmake and make run error free. I would like to run tests on my Raspberry Pi 2 setup in the next few days but feel I need to see the Linux version run properly first. The new FGPanel code is here:
http://www.iskra.talktalk.net/fgpanel.tar.bz2
I would be pleased for any comments.
FG environment: hp xw8600 2 Xeon quad core 2.66GHz
GTX760 graphics: 4 - X screens
FG v3.2 - x3 Viewsonic 2410 23" 1920 x 1080
FGPanel - x2 Samsung Syncmaster 740b 15" 1280 x 1024 as 2560 x 1024 hard cockpit
Aircraft: Cessna172sp
hollingwood
 
Posts: 21
Joined: Fri Oct 10, 2014 6:06 pm
Location: Yorkshire, UK
Version: 3.2.0
OS: Ubuntu 14.04

Re: Canvas & OpenGL ES (Rasberry PI, Android etc)

Postby hollingwood » Mon Mar 07, 2016 7:56 am

Raspberry Pi 2 supports OpenGL2. An experimental GL driver is provided with Raspbian Jessie released on February 9 2016 and with the version released on February 26 2016: the same time as Raspi 3 was launched. I have tested FGPanel as released with FlightGear 3.4.0 after compiling it on a Raspi 2. It was necessary to compile Simgear and to load all necessary libraries for this and for the compilation of FlightGear. It is not necessary to compile FlightGear itself. I used a 19" 1280x1024 vga monitor via an HDMI to VGA active adapter. With the GL feature disabled FGPanel at full screen ran at 1fps. With the GL feature enabled and the memory allocated to the GPU at 128MB the full screen rate was 33fps. The application was started from an X console. All instruments (15) and the radio stack were perfectly displayed. All numerals and indicators, needles responded perfectly to a UDP data stream from the main FG computer via wifi.

I also compiled and ran the two versions of FGPanel available from here:http://www.iskra.talktalk.net/fgpanel.tar.bz2
under the same conditions as above. These versions are for any Linux computer, and for the Raspi using the Raspi framebuffer. The Linux version ran in an X window with the same frame rates as the standard FG distribution tested above. The rates achieved were 34fps and 1fps at full screen with the GL feature enabled/disabled. The version using the Raspi framebuffer gave a full screen display at 59fps. Not all instruments were properly displayed presumably because their colour depth exceeded that provided by the frame buffer, eg rate of climb indicator which showed only the needle. It was known that at the current state of development no text was displayable so their was no updating of numbers in the clock, or on the radio stack. However, all needle movements were reliable.

In all cases required FlightGear files were placed in /usr/games/flightgear on the Raspi2.

My conclusion was that the standard FGPanel source compiles and runs with a very adequate frame rate on the Raspi2. The proposed FGPanel version for the RasPi using framebuffer only provides faster frame update rates but at the moment does not support text.
FG environment: hp xw8600 2 Xeon quad core 2.66GHz
GTX760 graphics: 4 - X screens
FG v3.2 - x3 Viewsonic 2410 23" 1920 x 1080
FGPanel - x2 Samsung Syncmaster 740b 15" 1280 x 1024 as 2560 x 1024 hard cockpit
Aircraft: Cessna172sp
hollingwood
 
Posts: 21
Joined: Fri Oct 10, 2014 6:06 pm
Location: Yorkshire, UK
Version: 3.2.0
OS: Ubuntu 14.04


Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests

cron