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 4: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?
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: Tell Route Manager next waypoint

Postby sanhozay » Sat Feb 11, 2017 5: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 11:57 am
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Tell Route Manager next waypoint

Postby Octal450 » Sat Feb 11, 2017 5: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 6:00 pm, edited 3 times in total.
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: Tell Route Manager next waypoint

Postby tikibar » Sat Feb 11, 2017 5: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)
McDonnell Douglas MD-11 (rename folder to MD-11)
User avatar
tikibar
 
Posts: 514
Joined: Mon Mar 05, 2012 6:05 am
Location: Los Angeles
Callsign: CHT0009
OS: Ubuntu 14.04

Re: Tell Route Manager next waypoint

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

OK, I will look.

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

J
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 0 guests