Board index FlightGear Development

SLUGS Waypoint Visualization

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

SLUGS Waypoint Visualization

Postby dagoodma » Mon Jul 29, 2013 7:52 am

Hello,

I am new to the forums. I have been developing a means to visualize waypoints and waypoint legs from FlightGear's route manager system. I created this for a project I'm working on, and I think there have been some nice results. Here is an image showing a desired trajectory for the aircraft in red and yellow beads as 10 meters markers between waypoints, which are shown as red beads.

Image

FlightGear's FDM was disabled and simulink was used with SLUGS autopilot. Although I developed this for our autopilot, this could be used by anyone to show routes from the route-manager. If people are interested in having a feature like this is FlightGear, please let me know by responding to this thread.
dagoodma
 
Posts: 4
Joined: Wed Jul 10, 2013 11:42 pm

Re: SLUGS Waypoint Visualization

Postby zakalawe » Mon Jul 29, 2013 11:02 am

Looks interesting - I think several similar systems have been done by different research and academic groups before, but not have made it into Git. Part of the issue is that some have been quite domain-specific. E.g if they're intended for small-areas of flight, loading in a arbitrary route-manager route can create enough marker objects to bring the frame-rate crashing down.

Can you speak in rough terms about the approach you're using to get the markers into the scene, and constrain the total number visible in the view?
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: SLUGS Waypoint Visualization

Postby Hooray » Mon Jul 29, 2013 12:44 pm

Hi & welcome!

As the most basic implementation, there's the fully scripted "glideslope tunnel" script: http://wiki.flightgear.org/Glideslope_Tunnel
Image
A more recent variation of it is called "Hoops", also fully scripted: Image

viewtopic.php?f=6&t=18759&hilit=hoops
git repo at: https://gitorious.org/hoops

There's been talk about integrating this into FG/git and adding it as an optional component to the tutorial system, so that tutorial could use such trajectory markers for different visualization purposes - i.e. not just ILS and/or route manager trajectories, but anything.

Ideally, we would look at all these implementations and generalize/unify them, and get them committed to fgdata - there should be no need for C++ changes here, it's all supported in Nasal space - and if something isn't, it would be better to expose it to scripting space.
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: SLUGS Waypoint Visualization

Postby dagoodma » Tue Jul 30, 2013 9:23 pm

zakalawe wrote in Mon Jul 29, 2013 11:02 am:Looks interesting - I think several similar systems have been done by different research and academic groups before, but not have made it into Git. Part of the issue is that some have been quite domain-specific. E.g if they're intended for small-areas of flight, loading in a arbitrary route-manager route can create enough marker objects to bring the frame-rate crashing down.

Can you speak in rough terms about the approach you're using to get the markers into the scene, and constrain the total number visible in the view?



This is a good point. Bounds checking and testing would need to be done to determine how this system effects the frame rate. Currently, there are no constraints on the number of beads drawn, and I am not doing anything to hide beads that aren't visible.

This implementation is fully scripted in Nasal. To get the markers into the scene I use geo.put_model(). Waypoints are pulled directly from the route manager, which allows routes to be modified/saved/loaded from inside FlightGear.


Hooray wrote in Mon Jul 29, 2013 12:44 pm:Hi & welcome!

As the most basic implementation, there's the fully scripted "glideslope tunnel" script: http://wiki.flightgear.org/Glideslope_Tunnel
(see glideslope image above).
A more recent variation of it is called "Hoops", also fully scripted: (see hoops image above)

http://flightgear.org/forums/viewtopic. ... ilit=hoops
git repo at: https://gitorious.org/hoops

There's been talk about integrating this into FG/git and adding it as an optional component to the tutorial system, so that tutorial could use such trajectory markers for different visualization purposes - i.e. not just ILS and/or route manager trajectories, but anything.

Ideally, we would look at all these implementations and generalize/unify them, and get them committed to fgdata - there should be no need for C++ changes here, it's all supported in Nasal space - and if something isn't, it would be better to expose it to scripting space.


Thanks! The glideslope tunnel script was a very helpful starting point for the script I wrote. I had not seen hoops before. It looks very useful. I like the idea of these implementations being unified/generalized. That could produce an effective tutorial.

I have been speaking with Curt Olson about all this. He mentioned that it would be nice to be able to show desired roll angles at the waypoint positons (I've been looking through the code for hoops and it seems like a variable pitch and roll are supported), although the bank angles would depend on your airspeed, which complicates things.
dagoodma
 
Posts: 4
Joined: Wed Jul 10, 2013 11:42 pm

Re: SLUGS Waypoint Visualization

Postby dagoodma » Mon Aug 12, 2013 8:55 pm

I have created a github repository for my code: https://github.com/dagoodma/slugs_flightgear. There is still more work to do though. I need to add a menu item to plot waypoints, because currently, the only way to plot waypoints is by updating the route manager with your waypoints and then setting
Code: Select all
/autopilot/route-manager/update_waypoints = 1

I will update this thread when everything is finished.

Hopefully we can start a project to combine these three addons (hoops, glideslope tunnel, and the slugs waypoint visualizer) into something that covers all the bases.
dagoodma
 
Posts: 4
Joined: Wed Jul 10, 2013 11:42 pm

Re: SLUGS Waypoint Visualization

Postby Hooray » Mon Aug 12, 2013 9:11 pm

Regarding your todo list: https://github.com/dagoodma/slugs_fligh ... aster/TODO
Ideally, the Nasal file would be turned into a Nasal submodule, so that it can be fully disabled: http://wiki.flightgear.org/Creating_new ... ub_modules
And then, we'd need to look at the other scripts to see how to generalize and unify all approaches to cover all bases, like you say. Preferably, without being restricted to a single "source", such as the route manager, or an ILS approach.

https://github.com/dagoodma/slugs_fligh ... ackend.nas
Also, your code looks currently strictly procedural, so that it would seem difficult to support multiple concurrent instances of the code, i.e. for different purposes (glideslope, route manager or "hoops") without affecting other paths - in other words, it would make sense to turn it into a conventional OOP design that supports multiple instances: http://wiki.flightgear.org/Object_orien ... g_in_Nasal
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: SLUGS Waypoint Visualization

Postby dagoodma » Mon Aug 12, 2013 10:44 pm

Hooray wrote in Mon Aug 12, 2013 9:11 pm:Regarding your todo list: https://github.com/dagoodma/slugs_fligh ... aster/TODO
Ideally, the Nasal file would be turned into a Nasal submodule, so that it can be fully disabled: http://wiki.flightgear.org/Creating_new ... ub_modules
And then, we'd need to look at the other scripts to see how to generalize and unify all approaches to cover all bases, like you say. Preferably, without being restricted to a single "source", such as the route manager, or an ILS approach.

https://github.com/dagoodma/slugs_fligh ... ackend.nas
Also, your code looks currently strictly procedural, so that it would seem difficult to support multiple concurrent instances of the code, i.e. for different purposes (glideslope, route manager or "hoops") without affecting other paths - in other words, it would make sense to turn it into a conventional OOP design that supports multiple instances: http://wiki.flightgear.org/Object_orien ... g_in_Nasal



Thanks for the feedback. This gives me a good road map for how to proceed. As soon as I have to a chance work on this I will convert into an OO sub-module like you say. Eventually, I may even have time to work on consolidating all of the projects into one.

Cheers,
dagoodma
 
Posts: 4
Joined: Wed Jul 10, 2013 11:42 pm

Re: SLUGS Waypoint Visualization

Postby Hooray » Tue Aug 13, 2013 12:01 am

OOP in Nasal is fairly straightforward and simple, we have a bunch of tutorials to cover the basics, and there's no need to get fancy.

The most relevant tutorials are these:
http://wiki.flightgear.org/Howto:Unders ... nd_Methods
http://wiki.flightgear.org/Howto:Start_ ... mmended.29
http://wiki.flightgear.org/Object_orien ... g_in_Nasal
http://wiki.flightgear.org/Object_Orien ... with_Nasal

These should answer more questions than you'll have for such a well-defined project.

However, please do feel free to post questions to get answers more quickly - see the Nasal sub forum, and if you shouldn't get a response there, just shoot a PM.
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: SLUGS Waypoint Visualization

Postby Hooray » Tue Aug 13, 2013 2:59 pm

Also see:
http://www.mail-archive.com/flightgear- ... 33801.html

Just for the sake of completeness, there's also the possibility to use a canvas-driven HUD for visualization purposes, without having to actually place anything in the scenery:

Subject: Drawing lines in the sky/environment

TheTom wrote:If you want to do something similar like a HUD, you could place a transparent canvas in front of the pilots viewpoint and draw the lines onto it. If you calculate the direction from the pilots viewpoint to the according position in the environment and intersect an imaginary line between this two points with the canvas you can draw it exactly where the point is located in the environment. You just need the two angles describing the direction to the point (up/down and left/right).


Subject: Drawing lines in the sky/environment

Hooray wrote:According to your comments, I would agree with TheTom that you should probably look at using a custom canvas-based HUD instead and use a layer to transparently handle the projection maths for placing objects at fixed coordinates that are then automatically shown on the HUD.

Also see:
Subject: radar special effects
Hooray wrote:If so, you could simply use an animated 3D model and add it to the scenery - using the aircraft's current position and update the position each frame.
There are a bunch of examples on adding 3D geometry to the simulator at runtime, see $FG_ROOT/Nasal and glideslope_tunnel.nas for example.

But you may want to provide some more details, or maybe even a little drawing to illustrate what you are trying to do.

At the moment it sounds to me like you won't need to do any C++ programming or any external software to do this.

A similar effect could probably also be added to originate from the aircraft and look like a radar cone
Tons of other stuff is possible, for more examples and ideas on adding visual cues to the scenery, see: http://www.cobbin.com/synthetic_vision/ ... vision.htm
Image
Image



@TheTom: yes, that sounds like another neat workaround that would not require any C++ modifications. Obviously, another cool feature would be directly placing a canvas at certain lat/lon/alt coordinates - or even drawing directly in 3D, like the canvas map works currently. So that even primitives like OpenVG paths could be drawn between coordinates.

Maybe we should have a wrapper on top of the HUD module that provides this functionality (drawing elements at absolute scenery coordinates and transparently showing them on the HUD)? That would simplify such efforts tremendously, while not requiring many C++ changes.
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: SLUGS Waypoint Visualization

Postby Hooray » Sat Aug 24, 2013 7:48 pm

dagoodma wrote in Mon Aug 12, 2013 10:44 pm:As soon as I have to a chance work on this I will convert into an OO sub-module like you say


I only just realized that the hoops developer has apparently already started using an OO module back in February, while the gitorious project hasn't been updated since January, he shared a screen shot showing his hoops.nas module obviously using OO, so you may want to get in touch with him:
Subject: Hoops
Image
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: SLUGS Waypoint Visualization

Postby Stevenj279 » Fri Jul 31, 2020 6:26 pm

dagoodma wrote in Mon Aug 12, 2013 8:55 pm:I have created a github repository for my code: https://github.com/dagoodma/slugs_flightgear. There is still more work to do though. I need to add a menu item to plot waypoints, because currently, the only way to plot waypoints is by updating the route manager with your waypoints and then setting
Code: Select all
/autopilot/route-manager/update_waypoints = 1

I will update this thread when everything is finished.

Hopefully we can start a project to combine these three addons (hoops, glideslope tunnel, and the slugs waypoint visualizer) into something that covers all the bases.


Hi dagoodma! I know it's been quite some time since your referenced post, but I'm trying to do essentially just what you described - showing waypoints and drawing the route leg between each. I downloaded your code from github and followed your instructions for where to copy what, but when I open the Route Manager (FG 2020.2.1), I'm not sure how, or even if I can get it to interact with a mission I've created with several waypoints. I'm sure I'm missing something, and it's even possible that there's a newer version of your work that I've not yet found.''

Any pointers or help would be greatly appreciated!
Williamsburg, VA
Win 7 Pro 64-bit, Intel Core i7-4700MQ 2.40 GHz
32 Gb Ram, 500 GB SSD, 2 TB SCSI HDD, NVIDIA GeForce GTX 780M
Stevenj279
 
Posts: 47
Joined: Fri Jul 24, 2020 1:26 am

Re: SLUGS Waypoint Visualization

Postby wkitty42 » Fri Jul 31, 2020 7:38 pm

the last post was in 2013... i doubt seriously the OP will respond :(
"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: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: SLUGS Waypoint Visualization

Postby Hooray » Fri Jul 31, 2020 7:45 pm

If in doubt, try github - according to the developer's profile, he's been active there, and also lists an eMail address to get in touch: https://github.com/dagoodma
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 Development

Who is online

Users browsing this forum: No registered users and 4 guests