Board index FlightGear Support Interfacing

fgpanel on raspberry pi?

Connecting two computers, using generic protocol, connecting with Matlab?

Re: fgpanel on raspberry pi?

Postby wkitty42 » Sun Apr 28, 2019 8:19 pm

have you checked the wayback machine at archive.org?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9162
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: fgpanel on raspberry pi?

Postby ScottBouch » Mon Apr 29, 2019 9:08 am

Hi, that's not a bad idea, thanks.

However in the meantime I did find this little guide:

https://sourceforge.net/p/flightgear/fl ... README.RPi

Unfortunately for me, step 1 and 2 are things I've never done; ie building parts of fgfs from source, so these steps for me are independent research projects in their own right.

Cheers, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: fgpanel on raspberry pi?

Postby dhudach » Mon Apr 29, 2019 1:07 pm

Hi Scott,

I managed to build flightgear on my PC using the download_and_compile.sh script. After fumbling through my first attempts, I either found this link or one of the developer members sent it to me: http://wiki.flightgear.org/User:Rominet.

it is definitely a must read. Any other way of running download and compile may end up in troubled waters. As far as using it on Raspberry Pi, I'm not sure. But my sense is that once the download_and_compile script has pulled down the source, it can be copied to Pi where fgpanel only can be built stand alone. I think the Pi/fgpanel article you linked has some of those instructions.

Aside from that, I have made great progress with fgpanel, building fgpanel instrument panel display for SenecaII that I'm going to use in my cockpit. I built the fgpanel xml files and am able to run flightgear, sending the fgpanel runtime data to localhost on the same pc. Fgpanel receives this data and displays real time instrument motion. It's a brilliant feature of flightgear and I send many thanks to you for bring it to my attention.

I have a lot of learning to do in Pi as I've never used it. Naturally I'll want to use it for fgpanel but figuring out how to set Pi up to receive the data from flightgear through wifi is going to be one area that I'm going to need to learn. But just like anything, buckle up and dive right in !!

Good Luck,
Dave
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: fgpanel on raspberry pi?

Postby ScottBouch » Tue Apr 30, 2019 12:13 am

Thanks Dave,

Been at this all evening, having a stab with a slow old original Raspberry Pi 1 Model B.

So far have installed the tools, dependencies, and an currently making / installing PLIB.

I did this the manual way (not using the install script) as I don't need all of Flightgear installing (my SD card us just 16GB). And I'm learning lots through the experience. Have found that some of the Flightgear wiki guidance doesn't work on a Pi, so am documenting what I'm doing differently to make it work, ie; making my own idiots guide as I go along.

Cheers, Scott
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: fgpanel on raspberry pi?

Postby dhudach » Tue Apr 30, 2019 12:38 am

Right, from what I've been reading (cursory searching only) it seems as though fgpanel on Pi is pretty much a manual compile, no download_and_compile or other script. But I can't be certain of that. I'll be in Pi land in the next month or so ... !!
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am


Re: fgpanel on raspberry pi?

Postby ScottBouch » Tue Apr 30, 2019 8:03 pm

Ok, so when I came to make OSG, I got mixed results:

Code: Select all
pi@raspberrypi:~/src/build-osg $ cmake -D LIB_POSTFIX="" -D CMAKE_INSTALL_PREFIX:PATH=/home/pi/FG-Stable /home/pi/src/OpenSceneGraph.git
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Found OpenGL: /usr/lib/arm-linux-gnueabihf/libGL.so 
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
-- Performing Test GL_HEADER_HAS_GLINT64
-- Performing Test GL_HEADER_HAS_GLINT64 - Success
-- Performing Test GL_HEADER_HAS_GLUINT64
-- Performing Test GL_HEADER_HAS_GLUINT64 - Success
-- Found Freetype: /usr/lib/arm-linux-gnueabihf/libfreetype.so (found version "2.6.3")
-- Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES)
-- Could NOT find LibXml2 (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8")
-- Could NOT find GDAL (missing:  GDAL_LIBRARY GDAL_INCLUDE_DIR)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
-- Checking for module 'gta'
--   No package 'gta' found
-- Found CURL: /usr/lib/arm-linux-gnueabihf/libcurl.so (found version "7.52.1")
-- Could NOT find GStreamer (missing:  GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES GSTREAMER_APP_INCLUDE_DIRS GSTREAMER_APP_LIBRARIES GSTREAMER_PBUTILS_INCLUDE_DIRS GSTREAMER_PBUTILS_LIBRARIES)
-- Could NOT find SDL2 (missing:  SDL2_LIBRARY SDL2_INCLUDE_DIR)
-- Could NOT find SDL (missing:  SDL_LIBRARY SDL_INCLUDE_DIR)
-- Checking for module 'cairo'
--   No package 'cairo' found
-- Checking for module 'poppler-glib'
--   No package 'poppler-glib' found
-- Checking for module 'librsvg-2.0>=2.35'
--   
-- Checking for module 'cairo'
--   No package 'cairo' found
-- Checking for module 'gtk+-2.0'
--   No package 'gtk+-2.0' found
-- Checking for module 'gtkglext-x11-1.0'
--   No package 'gtkglext-x11-1.0' found
-- Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Found PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (found version "1.6.28")
-- Could NOT find TIFF (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Failed
-- Looking for pthread_yield
-- Looking for pthread_yield - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for pthread_setconcurrency
-- Looking for pthread_setconcurrency - not found
-- Looking for pthread_getconcurrency
-- Looking for pthread_getconcurrency - not found
-- Looking for pthread_setaffinity_np
-- Looking for pthread_setaffinity_np - not found
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Success
-- Checking for module 'xrandr'
--   No package 'xrandr' found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for socket in socket
-- Looking for socket in socket - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/src/build-osg


Going to /home/pi/src/build-osg, it contains:

Code: Select all
pi@raspberrypi:~/src/build-osg $ ls
applications  CMakeCache.txt  cmake_install.cmake    include  Makefile   src
bin           CMakeFiles      cmake_uninstall.cmake  lib      packaging


I really am stuck now, as the guide http://wiki.flightgear.org/index.php?title=Building_FlightGear_-_Devuan doesn't cater for situation where you have these "make" issues listed above. Having never done "making" or "building" from source, I've been guessing it and so far was quite surprised with how far I got with it to be fair. Maybe it's a dependency thing where normal Debian would include components that Raspbian Lite does not?

(I realise this is the "interfacing" part of the forum, and I'm now digressing into issued with building...)
User avatar
ScottBouch
 
Posts: 183
Joined: Wed Jun 22, 2016 4:14 pm
Location: Midlands, UK
OS: Linux Mint

Re: fgpanel on raspberry pi?

Postby AndersG » Wed May 01, 2019 9:14 am

Did you try "make" and then "make install" inside ~/src/build-osg ?

On a very quick look it looks like cmake does produce the Makefile in your output above, so these two commands would be the normal continuation.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2527
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: fgpanel on raspberry pi?

Postby dhudach » Sat Jun 22, 2019 5:50 pm

I am going to purchase a Raspberry Pi for fgpanel. I am currently looking at CanaKit 3 B+. I am completely new to the Pi world so hopefully these rookie questions make sense. As to compatibility, is there a preferred Pi for fgpanel build, ones that are known to work. Are there ones known not to work? Suggestions or recommendations are welcome. Thanks in advance.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: fgpanel on raspberry pi?

Postby curt » Sat Jun 22, 2019 6:11 pm

This is a totally different thing, but I've had some good luck developing 2d instrument panels in html5 that run on pretty much any device with a simple web browser. Torsten D. has done something analogous as well (and he has far more experience with web technologies compared to me.) Torsten's work is called Phi: http://wiki.flightgear.org/Phi and already knows how to talk to flightgear.

My instrument panel work is tied to my UAV development for my day job. It is all still open-source (we use the MIT license) but not plug and play with flightgear.

The basic concept and architecture is that you create a small bit of html for all the place holders. The html loads and runs some javascript. The javascript handles reading data from the host (i.e. my uav communication server) and draws out textures and other primitives to create the display. I use websockets which is a 2-way network communication layer so data just flows like between any two apps on the internet. HTML5 has pretty rich capabilities for drawing sizing and placing textures. You can rotate them, draw extra text on top, etc. I can query the aircraft for it's "V" speeds and draw my green, yellow, red airspeed arcs in javascript ... so my airspeed indicator adjusts for whichever aircraft I'm flying that day. The communication server that relays data between a flying aircraft and my ground station is all written in python.

For me, the appeal of this approach is that I'm using pretty main stream technologies (python, websockets, html5, javascript, and my favorite web browser on my favorite device.) There's really nothing to compile. With the python bits you do need to install some dependencies before that will run. And then as long as you have a browser that's been updated in the last 10 years, everything just works.

Image
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: fgpanel on raspberry pi?

Postby dhudach » Sat Jun 22, 2019 6:16 pm

I agree, I do like the webpanel/Phi approach. I initially had trouble getting it to work and it was because I didn't have phi installed (linux). But because I'm building a cockpit, I'm drawn to fgpanel running on a monitor behind my instrument panel. However, I haven't tried configuring webpanel instruments and layouts manually as that might be an attractive alternative to building fgpanel for Raspberry Pi. In other words, If I could create a custom instrument panel using Phi/Webpanel, then it would seem to me that I would only need to point the Pi browser to the aircraft Phi URL and it should work, right?
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: fgpanel on raspberry pi?

Postby curt » Sat Jun 22, 2019 6:48 pm

dhudach wrote in Sat Jun 22, 2019 6:16 pm:I agree, I do like the webpanel/Phi approach. I initially had trouble getting it to work and it was because I didn't have phi installed (linux). But because I'm building a cockpit, I'm drawn to fgpanel running on a monitor behind my instrument panel. However, I haven't tried configuring webpanel instruments and layouts manually as that might be an attractive alternative to building fgpanel for Raspberry Pi. In other words, If I could create a custom instrument panel using Phi/Webpanel, then it would seem to me that I would only need to point the Pi browser to the aircraft Phi URL and it should work, right?


I think that's the general idea ... once you have the phi infrastructure in place, the display device just needs any web browser. You might need to figure out how to auto-start the browser and go full screen with it. That seems like it should be a doable thing. In a past life when I was doing cockpits, we had a panel cutout ... so there was always a step of nudging instrument sizes and locations to best fit the holes in the panel cover. We also found some super low profile analog pots so we could put a couple knobs right on the panel face. Then to dress it up, we had some plastic bezels around the edges of the holes to make them look a bit more realistic. We took it to an AOPA trade show and I would chuckle when groups of people would come by and debate if we were using real instruments or not, with some people being super convinced they were real because we did such a nice job with fake drop shadows and transparency and such. The one thing we never did was the glass cockpit stuff. For our work at the time, we actually ran a full copy of FlightGear on a PC and created a custom aircraft variant that had a 2d cockpit. That ended up being our "main" machine that ran the flight dynamics and everything else. From there we could drive as many add on display PC's as we wanted. In one case I think we ran 6 display PC's? It got pretty crazy back in the days when it was tough to run more than one display with fast 3d graphics.
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: fgpanel on raspberry pi?

Postby dhudach » Sat Jun 22, 2019 7:06 pm

That's excellent background information. Thanks for sharing. If the AOPA folks are scratching their collective heads, that's a remarkable feat! And that's my plan - to place a monitor (or monitors) behind a panel and dress it up. And I'm going to do the same thing, place knobs for each instrument in the panel to control the behavior. Beyond that, it's a matter of getting the measurements as accurate as possible for the panel openings.

I say monitors because if I simply place all of the desired instruments onto a single monitor, it will block the yoke location. So, based on the instruments I've selected and to get the layout as close to the SenecaII as possible, I'll need at least 3 small monitors. But I'm not anywhere near the construction phase just yet. I've just finished the Arduino circuit boards and software that I'm going to need. Next I'll probably work on the throttle/props/mixture console.

But I think webpanel is going to present some interesting challenges (opportunities) because I'm going to want to have many more instruments on the panels that currently exist 'out of the box' for the SenecaII. So it's going to mean learning some json and coupling it with html. In other words, before I commit to fgpanel, I have time to experiment with webpanel. Aside from the phi documentation, do you know where I might find some more information on creating and animating the instruments that don't exist yet for the aircraft webpanel? Kind of the rule of thumb is - once I can add one, it represents the pattern for doing others. Is there a correspondence, correlation or association between an instrument that exists in the aircraft that I'll need to create for phi? In other words, for the animation, are there properties easily seen in any of the instrument xml files that would help me build the webpanel version? Can I just look at the instrument xml file for the simulator and apply those properties in a json file?

Thanks for the information and assistance.

Thanks for the information.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: fgpanel on raspberry pi?

Postby dhudach » Sat Jun 22, 2019 8:51 pm

I am looking at creating additional SenecaII webpanel instruments. The default instruments all use svg files for images and animation. I don't see where other instruments use svg files. The ones I've used for my initial fgpanel attempts mostly use rgb files. So naturally the goal would be to somehow convert existing cockpit rgb instruments to svg. I'm running linux and after a bit of research I make sure that ImageMagick is installed then install potrace. I can then run:

Code: Select all
convert file.rgb file.ppm
potrace -s MP.ppm -o MP.svg


And it appears that at least in the first instrument I tried, it correctly converts the file to svg. If anyone is adding instruments to webpanel and needs something like this, give it a try. If you have used other methods, let me know. I'm interested in building a nice, custom SenecaII webpanel.
Flight Instruction Elevator Control: pull back = houses get smaller, push forward = houses get bigger.
dhudach
 
Posts: 118
Joined: Tue Apr 14, 2015 12:46 am

Re: fgpanel on raspberry pi?

Postby Alant » Sat Jun 22, 2019 10:54 pm

Torsten´s phi is simple if you only want to display instruments.
I tried, but failed completly when I tried to make the altimeter and compass knobs work, or add switches.
It should be possible as phi has one or two interactive elements, but understanding how to use them was beyond me.
The idea of using a tablet, or my mobile phone, acting as a cockpit panel (e.g. autopilot, fuel management, navigation, radio etc) is something that I would love to have.
Alan
Alant
 
Posts: 1223
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

PreviousNext

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests