Board index FlightGear Development Aircraft Autopilot and route manager

Tell Route Manager next waypoint

Designing a stable autopilot is one of the hardest things. Need help?

Tell Route Manager next waypoint

Postby Octal450 » Sat Feb 11, 2017 5:41 pm

I try to build custom LNAV system, I want the Route Manager to go to the next waypoint, when it gets 1nm from the waypoint.

Basically when distance to waypoint < 1.0
I want to advance to next waypoint.

I have this on a timer which runs every 1 second, only when LNAV mode engaged.

Any ideas?
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5601
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Tell Route Manager next waypoint

Postby sanhozay » Sat Feb 11, 2017 6:40 pm

I think you can just update the waypoint number in the property tree, i.e. "autopilot/route-manager/current-wp".

Obviously you need to check that it's not the last waypoint by looking at "autopilot/route-manager/route/num".

I wrote a script to do similar, but it works on turn radius and change in heading, which produces a much cleaner result than just doing it at 1nm. It also has fairly crude support for flyover waypoints based on turn angle. You can probably take some functions from here or just adapt the whole thing:

waypoint-smoothing.nas

It should probably be updated to use maketimer rather than settimer.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Tell Route Manager next waypoint

Postby Octal450 » Sat Feb 11, 2017 6:57 pm

I will check and test. Thanks.

I have my own smoothing systems for it, I just need the waypoint to advance earlier.

I have now figured it out!!!

I will post my finished code here when I'm done, so other can see if needed.

THANK YOU!

J
Last edited by Octal450 on Sat Feb 11, 2017 7:00 pm, edited 3 times in total.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5601
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Tell Route Manager next waypoint

Postby tikibar » Sat Feb 11, 2017 6:58 pm

The MD 11 has that functionality in step 5 of ap_update in AFDS.nas. The waypoint advance is the last section starting at "if(enroute[1] != nil)."
Boeing 747-8 (rename folder to 747-8i)
Boeing 757-200/300 (rename folder to 757-200)
Boeing 767-300/ER (rename folder to 767-300)
User avatar
tikibar
 
Posts: 545
Joined: Mon Mar 05, 2012 7:05 am
Location: Los Angeles
Callsign: CHT0009
OS: Ubuntu 14.04

Re: Tell Route Manager next waypoint

Postby Octal450 » Sat Feb 11, 2017 6:59 pm

OK, I will look.

I may adapt your follow the magenta line thing for certain modes of LNAV.

J
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5601
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest