Hooray wrote:http://wiki.flightgear.org/Flying_the_S ... eels_in_FGThorsten wrote:Currently there's very little support for displaying ground track or estimating the needed deceleration as function of range to target, so try aiming a track only if you're ambitious, otherwise try to survive.
I don't know what the real avionics look like - but using Nasal/Canvas it should be pretty straightforward to draw whatever you may need - in fact, there's support for procedurally-generated vector graphics - the "flight path history" shown below (blue) is generated using 5 lines of Nasal:
While the Canvas system itself does have support for geographic coordinates, it can also draw using absolute screen coordinates instead - so, shouldn't be limited by any built-in assumptions about the "aircraft" always being on Earth.
Like I said, I don't know what else is required or what the real thing looks like - but a GUI dialog showing the current position in relation to an "ideal" ground track should be relatively straightforward to create - and anything that's using Canvas is just a RTT/FBO so that it can be placed/shown and updated pretty much everywhere, including HUDs, GUI dialogs, cockpit controls or even liveries etc.
Here's a conventional UI dialog using two embedded Canvas textures, #1 showing a ND, #2 doing property plotting - something like this could just as well show a ground track and/or approach gradients:
Assuming that you're not overly interested in becoming familiar with Canvas, we would need to work out what is required on each side of this and how to plug together these components - for instance, we do have a wiki article containing a bunch of snippets of common Canvas purposes: http://wiki.flightgear.org/Canvas_Snippets
Note that the Canvas side of this just works via the property tree, so the corresponding computations could just as well be provided by another subsystem (think autopilot/property rules)
Like I said, I don't know much about the space shuttle or the way its avionics are supposed to look, but I can definitely provide self-contained snippets for drawing vector graphics to a Canvas RTT/FBO and display that in some UI dialog and/or HUD. But just like you are probably not interested in working out Canvas stuff, I am -quite frankly- not the slightest bit interested in working out the corresponding math - so if you'd fancy exploring this, I'd either need 2-3 APIs or just properties to provide what you need, and plot those to a corresponding texture.
So I am really just in "bootstrapping mode" here, which you should be able to relate to given your own recent bootstrapping here
Integration-wise, those examples are meant to be executed via the Nasal console, so are fairly self-contained (not being very interested in aircraft development myself).
Thorsten wrote:The real avionics is surprisingly (or perhaps not) spartan and not very visual. The entry management displays are velocity vs. altitude diagrams with the pre-calculated track for the mission and the envelope lines shown and the current state of the orbiter as a triangle plotted inside. Azimuthal deviation from course, AoA and target acceleration are just given as numbers.
I'm not sure at this point how much to aim for 'real' avionics (which by and large runs everything on auto and assumes mission control is just a call away and can supply all info from remote) and how much to support piloting. The Shuttle can be flown by stick control and cue cards in more or less all situations, but again the trajectories are often pre-computed.
I think what I want to have is a map of Earth displaying the future ground track projection of the orbit for a few revolutions, and at this point I'd probably need canvas.
Most of the computational tasks are currently done by JSBSim fcs_functions since they're relevant for guidance of the orbiter (they're basically something like the autopilot system, except JSBsim native - it's a pretty neat system and there's little you can't do with it). I think for track projections, I might use Nasal (since that's not guidance-critical), but at this point it's a rather vague collection of ideas. The current plan is to supply flyable systems before nice-looking systems. Also, I have to look into the description of the real avionics a little more.
Hooray wrote:may respond to your other comments later on.Thorsten wrote:I think what I want to have is a map of Earth displaying the future ground track projection of the orbit for a few revolutions, and at this point I'd probably need canvas.
if all you need is a "flat" 2D map, that is supported out of the box - and those maps can either live in $FG_ROOT or be fetched "live" if necessary using the http protocol.
There is the notion of "layers" in Canvas using multiple Canvas groups stacked together using explicit z-indexing and transparency settings so showing a flat 2D map would be suffficient to put other layers on top.
The basic snippet to show a UI dialog (just for prototyping purposes) is this: http://wiki.flightgear.org/Canvas_Snipp ... GUI_Window
To add a raster image, you would add the 5 lines found at: http://wiki.flightgear.org/Canvas_Snipp ... ter_Images
The "filename" could just as well be a URL (just for testing), for example using: http://www.worldwidetelescope.org/docs/ ... fEarth.jpg
(I am admittedly not sure if JPG is supported or not by FG/OSG by default, so this may need to be converted to png first).
Or use this URL instead: http://gallery.hd.org/_exhibits/places- ... 1-ANON.png
There is a dedicated "Map" element in Canvas which will position elements (raster images, text labels etc) using lat/lon directly - i.e. implicit projection handling. So the current/intended ground track could be visualized accordingly using a few lines of Nasal, where you treat your coordinates like waypoints that are connected using some kind of line/curve (vector graphics) - which is using OpenVG, and which is also the way used for drawing the taxiways in the screen shot below:think for track projections, I might use Nasal (since that's not guidance-critical), but at this point it's a rather vague collection of ideas.
like I said, projection handling in Canvas can be handled by dedicated C++ code automatically - Gijs has also begun adding support for new projections which provide better results/performance under certain circumstances (think flight plans crossing the poles).
The two "Canvas Snippets" links above are entirely self-contained for loading/displaying a raster image found either in $FG_ROOT or fetched via http.
Once that is working, we can add more layers on top of this to plot a corresponding ground track.
While using a UI dialog may seem counter-intuitive at first, it allows rapid prototyping (i.e. not reset/reload required) and it can be easily shown elsewhere later on.
Once a basic prototype is in place, I could also help generalize things to turn this into a "MapStructure" layer, with "MapStructure" being a framework for reusable gauges/charting layers (think moving map stuff), so that the display/instrument could be reused elsewhere (think vostok/spaceship2) - not unlike effects which can be reused/shared between different aircraft - e.g:
Hooray wrote:@TheTom: Do you have a better idea on handling Thorsten's use-case, i.e. in terms of "Map" being used for visualizing orbital flights (shuttle, vostok, spaceship2) with a background image of the Earth being used as a geo-referenced overlay ?
Also, how would you proceed to deal with raster images used as pre-projected map backgrounds - you once said that you were designing Canvas with the "tiled map" use-case in mind - so I am wondering if we could add a pre-projected raster image and specify the used projection so that the C++ code can deal with this correctly, or do you think that's over-engineered ?
Equally, sub-textures/textures maps and clipping support may benefit from geo-support, so that coordinates can be specified as lat/lon tuples probably ?
Supporting texture maps using geo-coordinates would allow us to deal with a Map element as a CanvasImage so that caching would be supported more easily, i.e. by retrieving sub-maps from a top-level maps - which could be useful in the case of highly detailed satellite imagery.
(This is just a brainstorming/feedback, so no concrete feature requests yet - just thinking out loud to determine how to support Thorsten's use-case and spacecraft avionics in particular - and to make you aware of ongoing Canvas related efforts)
Hooray wrote:There is a dedicated "Map" element in Canvas which will position elements (raster images, text labels etc) using lat/lon directly - i.e. implicit projection handling. So the current/intended ground track could be visualized accordingly using a few lines of Nasal, where you treat your coordinates like waypoints that are connected using some kind of line/curve (vector graphics)
http://wiki.flightgear.org/Canvas_Snipp ... _on_demand
Thorsten wrote:Well, pretty, but I lack a clear example how it's done. The map creating code is not precisely easy to unravel. I understand that I probably need to tell the system what coords the edge of my picture are supposed to represent, and then draw a shuttle symbol somewhere on it. The snippets are nice, but they lack a list of options of what I could change. The SVG in canvas demo doesn't work...
Hooray wrote:I don't know what SVG example you're referring to ?
I haven't tested things in a while, but last I checked, this was working: http://wiki.flightgear.org/Howto:Use_SV ... ello_World
And it should display a full SVG file including all its "layers":
A few messages ago, I did offer to help with specific examples, as long as you provide the back-end snippets (computations), either in the form of a few APIs or simply properties.
The documentation may be lacking behind a bit admittedly...
But how about you ask a handful of really specific questions and I get back to you with updated docs/examples (totally self-contained of course) ?
Let's start simple please though (or _I_ may lose interest in it...)
Alternatively, there's a full framework for creating such maps, using "MapStructure", where all you need to do is provide two files with functions specifiying 1) a vector with lat/lon coordinates for each "waypoint/coordinate", and another function that basically iterates over the vector using foreach() and draws symbols/lines or curves between those:
http://wiki.flightgear.org/Canvas_MapStructure
EDIT: I have begun extending the examples based on our PMs: http://wiki.flightgear.org/Canvas_Snipp ... _on_demand
Will be adding more stuff once you have laid out your requirements
Hooray wrote:@TheTom: I think Thorsten is asking for a way to automatically handle the projection/transformation of the background image by mapping image/screen coordinates via lat/lon coordinates. I don't think we have any built-in support for doing that - we can of course "hard-code" that using image dimensions for one specific image, but it would probably be better to extend the Map handling code to support doing this at some point automatically ?
Especially GeoTIFF already tend to contain the meta-data for geo-referencing the image or have associated TFW files.
So we kinda need to expose this stuff as properties for raster images added as children to Maps - i.e. projection, dimensions etc - as per: Georeferenced instrument procedures and airport diagrams
Which should also come in handy for all the EFB stuff:
Subject: A project to create a source of free geo-referenced instrumeTheTom wrote:I don't think it makes sense (and is easily possible) to include the script somehow in FlightGear. It "just" creates a matrix for a given plate containing it's scale and position, so all we have to do to display such charts within FlightGear is to load the chart image and apply the matrix created by the script. In the case of VRT files, it should be enough to just read the GeoTransform tag and set it as matrix on the Image element inside the canvas (with the parent element set up to have a coordinate system matching the current position and range).
These charts would not only be useful for FlightGear, but also for real aviation applications, like EFBs. I think I saw this or a similar script somewhere inside the sources of Avare?
Thorsten wrote:Okay, I have a nice loaded earth texture picture. I have the position of my shuttle -
- first thing I want is to draw it in real time on the picture, see it move.
- Next thing is - I want to display the ground track. What do I do - store past positions into an array regularly? Is it done automatically?
- Beyond that, I want to display the groundtrack prediction based on current state. So, I can create an array of future points. Or properties. Or pass the function which, when given a time, will spit out coordinates. Don't care - whatever is best.
- Finally, I'd like to have the ability to display the selected landing site on the map. But that's probably the same as the shuttle problem - I have a set of coords and I want a symbol drawn there.
Probably all are solved problems - but how?
Cheers and thanks for the help!
* Thorsten