Board index FlightGear Development Aircraft Autopilot and route manager

Buildings and objects avoidance system?

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

Buildings and objects avoidance system?

Postby ausdkunst » Tue Jan 12, 2016 2:32 am

Hi,
As some of you know, I have made a few vehicles for flightgear. Now I am planning to make something similar to autonomous driving and run into a few problems.

Using the flightgear built in autopilot system, I can set the speed and bearing, but given the system is for aircrafts:
1. The car will drive itself to water - which can be fixed by inserting codes from seaplanes
2. The car will collide into buildings/objects - which I have no idea how to fixed.

Here is "possible" solution:
1. Having a buildings/objects avoidance system and steer itself around the buildings
2. Ability to drive through the buildings without causing any problem

I don't know which solution is plausible and what the code should be. Any help would be appreciated!!
BULLDOG RS (The No.1 place for Flightgear automobile): https://bulldogrs.wordpress.com/
User avatar
ausdkunst
 
Posts: 343
Joined: Fri Aug 28, 2015 10:47 am
Callsign: bulldog
Version: 2016.2.1
OS: Mac OS X

Re: Buildings and objects avoidance system?

Postby Necolatis » Tue Jan 12, 2016 2:41 am

I do not know how Yasim works, but if you are using JSBSim you can do like this:

You probably have a contact point for each wheel. You just make an extra contact point out in front of the car, say 5 meters out.
The you write some code that detects WOW on that contact point, and stops or diverts the car when WOW is true (meaning there is an obstacle in front.
Make the springs very very soft on the contact point, so that if you should happen to drive close to the obstacle you will hardly notice it.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2233
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: Buildings and objects avoidance system?

Postby ausdkunst » Tue Jan 12, 2016 2:55 am

Thanks. I will look into it if there is no other solutions because currently I am using Yasim.
BULLDOG RS (The No.1 place for Flightgear automobile): https://bulldogrs.wordpress.com/
User avatar
ausdkunst
 
Posts: 343
Joined: Fri Aug 28, 2015 10:47 am
Callsign: bulldog
Version: 2016.2.1
OS: Mac OS X

Re: Buildings and objects avoidance system?

Postby Hooray » Tue Jan 12, 2016 3:10 am

you would need to build an internal map/model of your surroundings to do this, i.e. using Nasal scripting and geodinfo() calls to determine what kind of terrain (materials) is around you - you could then use the existing autopilot code and switch between different modes (possibly customized a little).

Otherwise, you would need to process the FlightGear visuals by using somethign like openCV.

Terrain sampling via geodinfo() should get you going though - Thorsten prototyped a whole weather system using this approach (to determine where/what kind of clouds are to be put). Equally, the ridge lift system is using terrain sampling to determine terrain slopes.

Next, you would probably want to access ground network information and/or access other internals (e.g. floor plans)

Computer vision is unlikely to work within the FG main loop - so you would need to capture/stream the image and use an external program to do that.
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: Buildings and objects avoidance system?

Postby Hooray » Tue Jan 12, 2016 4:26 pm

Red Leader has just finished updating a Nasal tutorial that would be helpful for this: http://wiki.flightgear.org/Howto:Terrai ... g_in_Nasal

Using this approach, you could implement a simple "bot" that tracks the terrain - using the geodinfo() API, you can also retrieve other information (materials).

With Nasal, you can also access runway/taxiway information, which is how the airport map below is created:
Image

Otherwise, you may need additional vector information (i.e. shapefiles)
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: Buildings and objects avoidance system?

Postby ausdkunst » Wed Jan 13, 2016 3:56 am

Hooray wrote in Tue Jan 12, 2016 4:26 pm:Red Leader has just finished updating a Nasal tutorial that would be helpful for this: http://wiki.flightgear.org/Howto:Terrai ... g_in_Nasal

Using this approach, you could implement a simple "bot" that tracks the terrain - using the geodinfo() API, you can also retrieve other information (materials).

With Nasal, you can also access runway/taxiway information, which is how the airport map below is created:
Image

Otherwise, you may need additional vector information (i.e. shapefiles)

Thanks. I will look into it :) Say I can get it to track the terrain, how do I make it avoid certain terrain (i.e. buildings, objects and water)? Is there any tutorial?
BULLDOG RS (The No.1 place for Flightgear automobile): https://bulldogrs.wordpress.com/
User avatar
ausdkunst
 
Posts: 343
Joined: Fri Aug 28, 2015 10:47 am
Callsign: bulldog
Version: 2016.2.1
OS: Mac OS X

Re: Buildings and objects avoidance system?

Postby Hooray » Wed Jan 13, 2016 4:37 am

I already posted the relevant pointers to get you started with this:

http://wiki.flightgear.org/Howto:Terrai ... g_in_Nasal
http://wiki.flightgear.org/Nasal_library#geodinfo.28.29

You would also want to read up on FlightGear "materials" landcover.

And avoiding buildings may need additional tricks/work, depending on the type of buildings (simply because they are using different techniques, so that different approaches may work or not).

For starters, you are well-advised to work through the first two links and look up the other examples I mentioned.

Most other features will probably fall into place once you have something to share with other users, e.g. those more familiar with random buildings, OSM use etc
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 Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 2 guests