Board index FlightGear Development Spaceflight

Space Shuttle

Discussion about development and usage of spacecraft

Re: Space Shuttle

Postby Hooray » Thu Jun 16, 2016 7:01 pm

Could you post a few links (including the line number, which sourceforge adds automatically once you click a link), and maybe a few of the existing use-cases ?
That would be most useful - apart from that, I would probably suggest using named function parameters (also in calls), and to make the name of the variable self-explanatory, including any units (e.g. by appending a corresponding suffix).
Anything that may need to be customized should probably be a variable (if necessary, with a default value) - any logic that may need to be overridden, would benefit from taking an optional "predicate", which is a fancy word for a callback function that can be passed to the function to apply external logic, I think you are familiar with the concept due to your shader work:

untested pseudo code:
Code: Select all
var myUsefulAPI = func(x,y, condition) {

# this will call the condition function and pass in the x,y arguments
return condition(x,y);
}

var myANDLogic = func(a,b) {return a and b;}
var myORLogic = func(a,b) {return a or b;}
var myEQUAL = = func(a,b) {return a == b;}

var result = myUsefulAPI(100,100, myEQUAL);
print(result);
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby Thorsten » Fri Jun 17, 2016 5:57 pm

After some prettyfications, it now looks fairly close to the original:

Image

Eventually I need to test performance and if it drains too much offer a simplified version for the users of low-end systems. There's agressive Nasal culling taking place to reduce property IO, but there's still plenty of visible elements which all need to be re-computed every update (being a sphere, it's unfortunately not a simple combination of rotations and translations as the 2d structures are, so it actually has to be re-drawn).
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby Thorsten » Mon Jun 20, 2016 6:23 pm

Ascent mode ought to be (mostly) ready. We have 'fly to' error needles, the earth relative and inertial bearing markers, the H-tape switching scale at certain altitudes, a meaningful Delta-Inc,... The only thing I don't really know how to do right now is X-Trk (launch guidance doesn't currently aim for a point in space but for an inclination value, so it's hard to determine the offset to such a point..)

Image

I believe by running launch guidance but leaving the controls in CSS, it'd be possible to fly an ascent just following the error needles, though I haven't tried chasing them.

Now working on the bearing pointers and the CDI for TAEM guidance...
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby amalahama » Tue Jun 21, 2016 6:46 am

It looks superb! PFD is a complex page with lots of subtle changes in functionality depending on the flight phase, but you are doing a great work. I don't know but maybe X-trk shows the delta between current X pos and the theoretical trajectory in ASCENT TRAJ?

Regards
amalahama
 
Posts: 105
Joined: Mon Mar 28, 2016 9:54 am

Re: Space Shuttle

Postby Thorsten » Tue Jun 21, 2016 7:11 am

X-trk shows the lateral distance between pre-computed insertion point and actual insertion point (aka, you may reach the same inclination, but be off by a few miles laterally, i.e. have a different longitude of the ascending node than planned). The trouble is that launch guidance 'as is' doesn't aim for a particular point, it just aims to launch you from a site into a given inclination, so it can't compute an error to a theoretical point.
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby amalahama » Tue Jun 21, 2016 7:58 am

Knowing the orbit inclination, it could be worked out easily using spheric trigonometry.

https://en.wikipedia.org/wiki/Spherical_trigonometry

Regards!
amalahama
 
Posts: 105
Joined: Mon Mar 28, 2016 9:54 am

Re: Space Shuttle

Postby Thorsten » Tue Jun 21, 2016 9:14 am

... up to the corrections for the fact that we're not really simulating a sphere. Which are of order of a few tens of kilometers or some hundredth of a degree in values of inclination or node longitude. Which is just the order of magnitude the instrument would show.

Follow the value of the inclination computed instantaneously around an orbit - you'll see that the actual orbit wobbles around the analytical due to the non-spherical gravity terms.

Getting something to an accuracy of 100 km is simple. For an accuracy of 1 km, you have to work hard.
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby Richard » Tue Jun 21, 2016 10:38 am

The PFD is brilliant. Well done.
Richard
 
Posts: 693
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: Space Shuttle

Postby amalahama » Tue Jun 21, 2016 12:18 pm

Thorsten wrote in Tue Jun 21, 2016 9:14 am:... up to the corrections for the fact that we're not really simulating a sphere. Which are of order of a few tens of kilometers or some hundredth of a degree in values of inclination or node longitude. Which is just the order of magnitude the instrument would show.

Follow the value of the inclination computed instantaneously around an orbit - you'll see that the actual orbit wobbles around the analytical due to the non-spherical gravity terms.

Getting something to an accuracy of 100 km is simple. For an accuracy of 1 km, you have to work hard.


According to this link:

http://gis.stackexchange.com/questions/ ... 8740#18740

It's not that bad. Relative errors should be around 10^(-5) maximum (that is, 0.001%), when compared with WGS-84 model.

Regards!
amalahama
 
Posts: 105
Joined: Mon Mar 28, 2016 9:54 am

Re: Space Shuttle

Postby Hooray » Tue Jun 21, 2016 4:01 pm

Richard wrote in Tue Jun 21, 2016 10:38 am:The PFD is brilliant. Well done.


agreed, for that to work so well, he must have basically come up with a complete 3d=>2D rendering implementation for those paths forming the sphere, because the Canvas system doesn't understand 3D stuff at all - which is why we felt it would be much easier to simply extend it accordingly.

Anyway, Thorsten is once again proving that a strong background in maths is generally very useful to tackle these sorts of problems, including even problems that people with a background in CS/SE don't want to tackle :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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle

Postby Thorsten » Wed Jun 22, 2016 5:26 pm

The majority of functions should now be implemented as described in the DPS dictionary. During TAEM there's a working glideslope indicator and the CDI is valid to monitor situation relative to the runway on final, there's distance readings to runway and to HAC-center, the entry phase has the additional H dot dot gauge and Delta Az, i.e. TAEM can be flown by instruments.

I don't have much guidance on the final approach (well, just look out of the window...) and TAEM guidance is only good if you actually stay on the HAC, if you fly a different pattern it will be off.

There's no 'fly to' needles for entry and TAEM (that's because there's also no AP capable of doing the job) - there will be error needles for orbital maneuvering soonish.

Switching the ADI ball from LVLH to inertial attitude works, but has to be done via property browser.

There's a couple of minor consistency issues, and the abort-specific functions aren't currently implemented, but pretty much all the artwork is there.

@wlbragg - I guess we can now re-activate the ADI attitude selection switch and the rate and error range switches - properties for that are already there and will be supported soon.

I'll do the 'just orbit' mode next.
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby amalahama » Thu Jun 23, 2016 9:51 am

Cool! Did you leave the "growth potential" slot for Entry and TAEM error needles for when we have the autopilot funactionality available?

Regards
amalahama
 
Posts: 105
Joined: Mon Mar 28, 2016 9:54 am

Re: Space Shuttle

Postby wlbragg » Thu Jun 23, 2016 5:26 pm

@wlbragg - I guess we can now re-activate the ADI attitude selection switch and the rate and error range switches - properties for that are already there and will be supported soon.

Can you draw me a map? :lol: I know the switches, but not the properties. :oops:

I'm almost done with my latest rounds of updates to the j3cub and will start on R2 and this shortly.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4692
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Space Shuttle

Postby Thorsten » Thu Jun 23, 2016 5:36 pm

Did you leave the "growth potential" slot for Entry and TAEM error needles for when we have the autopilot funactionality available?


Nothing under that name is documented in the DPS Dictionary, so I guess that means either it has a different name or it's not implemented.

Can you draw me a map?


/fdm/jsbsim/systems/adi/(pretty-self-explanatory-name) :mrgreen:

I've done a few performance tests, and the ADI ball at full glory is a hog (mainly property throughput, canvas isn't good at that kind of problem...), it's okay under my windows setup (i.e. I can detect the effect on dragging one frame if I look for it), but just to be safe I'll do it in quality levels starting from not animating the ADI ball at all over lowres to a final hires version with all features and ladders.
Thorsten
 
Posts: 10643
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle

Postby Hooray » Thu Jun 23, 2016 6:49 pm

to see if it's just the property I/O, you could call the .hide() method of the top-level group and see if disabling rendering of the group has a noticeable effect or not - i.e. because the property tree overhead will remain identical.
If you are willing to patch/rebuild sg/fgfs, you would want to open $SG_SRC/canvas/elements/CanvasGroup.cxx to change its update method and wrap it in between two SGTimeStamp::now() statements, that will tell you how much time is spent updating the group.
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 0 guests