Board index FlightGear Development Canvas

MapStructure layer for orbital mapping/trajectory map

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.

MapStructure layer for orbital mapping/trajectory map

Postby Hooray » Sun Oct 15, 2017 12:22 pm

Space Shuttle
Thorsten wrote:
Image
STSPlus! haven't seen that in the wild in a while... hated when david ransom passed to the next realm...


Admittedly it's a nicer display than what we have, showing more stuff for starters... if someone wants to have a go re-doing the groundtrack map, he's most welcome, the current design is my first (!) canvas experiment and the code is pretty crappy because I didn't know any better.

But it's waaay down on my priority list to replace it...


Thorsten, I don't remember the file name/location, could you post a link/pointer to the current implementation, so that people may take a look ?
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MapStructure layer for orbital mapping/trajectory map

Postby Thorsten » Sun Oct 15, 2017 12:44 pm

With the explicit understanding that I want no comments how crappy the code is...

https://sourceforge.net/p/fgspaceshuttl ... al/map.nas
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: MapStructure layer for orbital mapping/trajectory map

Postby Hooray » Sun Oct 15, 2017 4:13 pm

Thank you, no worries there - you stated already, that it was your first Nasal/Canvas experiment, and as a matter of fact, I do remember that I posted some portions of the code in response to your questions

Based on your existing code and your familarity with the shuttle setup: would it even suffice to provide just a function for passing a vector of coordinates to it, i.e. containing what is to be plotted ?

The point being that an orbital map is a bit special, so it would be easier for the MapStructure side of things to only accept a vector with lat/lon tuples and plot a corresponding line/curve.

That is something that we're already doing for the ground track/flight path history (blue line):
Image

If that could be made to work, Stuart's recent tilemap work would mean, that your existing display code could be much more easily generalized - but you are in a much better position to judge if that's sufficient or not ?

From a customization standpoint, I expect that you may want to plot those lines using different colors/styles, at most passing your own drawing callback, is that correct ?

What about the lat/lon grid and the circular elements in the STSPlus screen shot, is that something that we'd ideally also provide ?
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MapStructure layer for orbital mapping/trajectory map

Postby wkitty42 » Sun Oct 15, 2017 7:07 pm

Hooray wrote in Sun Oct 15, 2017 4:13 pm:What about the lat/lon grid and the circular elements in the STSPlus screen shot, is that something that we'd ideally also provide ?

the circular elements are the visual boundary based on the current viewing location and the altitude of the selected craft... the higher the selected craft, the larger the visibility circle... there is one on the craft, itself so you can see what areas could view the craft flying over and one at the viewing location site so it can tell when the craft comes into view, its elevation and azimuth... at the viewing location, the circle is effectively the horizon edge where the craft come into visible range...
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: MapStructure layer for orbital mapping/trajectory map

Postby Thorsten » Mon Oct 16, 2017 7:07 am

The point being that an orbital map is a bit special, so it would be easier for the MapStructure side of things to only accept a vector with lat/lon tuples and plot a corresponding line/curve.


Then what do I need the map structure for? That's just a plot on a background raster image (which I have right now).

Point being - it'd be interesting if it'd be somehow less effort - but if I have to do the same computations anyway, it ends up being more effort that way.

I guess that's the common thread in recent conversations. The Shuttle contains plenty of trail-blazing stuff that could be of interest for others (a shitload of coordinate transformation routines for both Nasal and JSBSIm, a general thermal modeling code, numerical fit routines, new and improved geodesic computations, the blackbody radiation shader, the procedural HUD code,...) and pretty much after every Shuttle milestone release I summarize what's there on the mailing list and ask if anyone is interested.

So far, we've got few takers for the graphics stuff (the thruster flame, the HUD effect,...), not so much for the rest (not even for the parachute code which is available and well-documented).

Usually what this requires is someone stepping up and willing to at least share the workload of implementing this more widely - and documenting it. I'm not interested in investing work to generalize these code pieces, make them more widely available and write Wiki pages just on the off-chance that someone might have use for them - I have the code, it works for me, I try to get the information out that it's there, if anyone has use for it, ball is in that person's court.

So if you want to add orbital functions to the map layer, I'll be happy to tell you where the calculations are done, and I'll tell you what is there for what reason and I'll handle any commits to FGData, but I'm not investing any work.

there is one on the craft, itself so you can see what areas could view the craft flying over and one at the viewing location site so it can tell when the craft comes into view


There actually is no such display anywhere among the Shuttle avionics pages. There isn't even a summary display of orbital elements, in fact the orbital information you do get from the avionics is scattered across three different pages.

Otherwise, it's not so much for visibility but for communication line-of-sight (which was more essential before the TDRS network which gives you an uplink to a satellite in geosync orbit). We internally have the line of sight information producing a local horizon distance from the S-band antenna code.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: MapStructure layer for orbital mapping/trajectory map

Postby wkitty42 » Mon Oct 16, 2017 2:50 pm

Thorsten wrote in Mon Oct 16, 2017 7:07 am:
there is one on the craft, itself so you can see what areas could view the craft flying over and one at the viewing location site so it can tell when the craft comes into view


There actually is no such display anywhere among the Shuttle avionics pages. There isn't even a summary display of orbital elements, in fact the orbital information you do get from the avionics is scattered across three different pages.

the talk about the visibility circles was only regarding the STSPlus image in relation to Hooray's question about retaining them in future work...
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: MapStructure layer for orbital mapping/trajectory map

Postby Hooray » Tue Oct 17, 2017 8:11 pm

I do see your point, maybe the answer is because we need to walk before we run ? ;-)
Seriously though, the point of the MapStructure framework is primarily to encapsulate useful functionality using a common-backend that can be easily controlled using arbitrary front-ends (think cockpit panels, GUI dialogs, MFDs/avionics) by providing hooks that allow customizing/styling the backened layers.
In layman's terms that means that there'd be a single "TRAJ" layer set up, which would become the shared back-end to be used for all related purposes - no matter if that means a dediciated "orbital map" dialog or custom avionics showing orbital trajectors, all using custom styling, a common back-end, and support for a number of arbitrary instances (trajectories).

As such, the mechanism is well-suited to be augmented/replaced using C++ space helpers, which means that optimizations or other improvements would automatically benefit all front-ends/use case.

I do however see your point that it may make more sense to provide a concrete orbital mapping routine - but that will require a way to specify different orbits, e.g. a function, a symbol and a style - would that work for you ?

What else would need to be configurable ?

For starters, you could get me going to provide the pointers to the relevant functions, and maybe a helper function to make it generate an orbit that I can use for testing purposes. If you can foresee this being potentially useful for other use-cases (think displaying satellite/ISS orbits), all the better.

The point really being that there would be a single place/file to be updated/maintained and profiled/optimized - regardless of the front-end (or aircraft) in use.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests

cron