Outerra forum

User mods, screenshots & videos => Vehicles => Topic started by: Uriah on August 08, 2015, 03:31:43 pm

Title: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 08, 2015, 03:31:43 pm
A while back I built a simple waypoint navigation script for vehicles, and I thought I would share it.

I modified M7's Tiger 2 as a basic demonstration of this functionality, and share it with the hope that someone will help improve it!  8) At the moment it is a real hack-job, as I only spent a short amount of time on it. The vehicle script has functions to 1) calculate latitude and longitude from the ECEF position, 2) I calculate the forward azimuth from the current position to the target waypoint, and 3) calculate the true relative bearing to follow. Once it gets within 10 meters of the waypoint the vehicle will stop. Sometimes it may go in circles, especially if the vehicles is too far away from the waypoint, but if it is not too far it should correct the course after a few seconds. A PID controller would probably fix this problem.

One functionality I would like to develop is obstacle avoidance. This is getting into the domain of building a basic AI construct, which isn't too difficult and is really a matter of calling the correct methods to the OT interface to determine if the current course is clear, blocked or cannot be passed.

In this version, you must set the waypoint manually, by editing the variables near the top of the script for the latitude and longitude of the target waypoint in radians. Currently, these are set for a point near the OT default location: Airport 2, Lower Himalayas.

Code: [Select]
var lat_tgt_rad = 0.48663567294854004; //Latitude Radians
var lon_tgt_rad = 1.4642145502211033; //Longitude Radians

Here is the download link for the package:
http://www.mediafire.com/download/1bajxk9hgb5zijl/tiger2.m7c7.otx

Best regards,
Uriah

(http://i.imgur.com/oHgIg26.jpg)
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Acetone on August 08, 2015, 04:47:14 pm
Time to start doing awful experiments with this poor little guy

(http://i.imgur.com/kvMC3Ab.jpg)
Here, you can do it, don't worry...

https://youtu.be/y6UHd28BVB4
 :facepalm:

Awesome job Uriah :)

Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 08, 2015, 04:59:54 pm
Ha ha!  :D

I'll setup a system for placing multiple waypoints dynamically in a few weeks once I have some free time. I have ideas for obstacle avoidance too, but they have yet to be put to the test.

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Revolver on August 09, 2015, 05:10:18 am
Oh ... very nice ... we have Tiger-2 space program  :)... what is coming next ... Leo-2 on the Moon?   ::)
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: andfly on August 09, 2015, 11:17:16 am
Very interesting....
I'm always fascinated by algorithms which seem to give a "soul" and "a little autonomous intelligence" to models of simulation!
It is the basis for the creation of a world more and more realistic!   8)
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 09, 2015, 04:43:57 pm
Thanks! I'll build a move advanced and extensible version when I get some free time in a few weeks. I plan for this version to have a basic obstacle avoidance algorithm, multiple waypoint (route) capability, and for it to be a separate script which can be added to any vehicle with a simple $include statement. Any suggestions are appreciated!  :D

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Revolver on August 10, 2015, 03:43:09 am
Moin,
For us it would be very interesting to have an AI (also scripted) that follows and is doing a launched their functions.
For example, an aircraft mechanic who goes to the aircraft to do his bill tasks ... if you understand what I mean. :)
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: zzz on August 10, 2015, 07:45:21 pm
Nice. I just made an auto-targeting turret script that works for all angles & offsets and was trying to shoehorn it into an autopilot script by having the world as the base and the vehicle the off-centre turret to calculate the headings but atm it only works at the north pole
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 10, 2015, 07:48:10 pm
Hi

That is awesome! Sounds like just what we need for vehicles to automatically engage targets. Mind sharing?

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 10, 2015, 07:54:43 pm
Moin,
For us it would be very interesting to have an AI (also scripted) that follows and is doing a launched their functions.
For example, an aircraft mechanic who goes to the aircraft to do his bill tasks ... if you understand what I mean. :)

Do you mean something like a ground support crew for aircraft maintenance and airport ground activities?

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Revolver on August 10, 2015, 10:54:33 pm
Moin,
For us it would be very interesting to have an AI (also scripted) that follows and is doing a launched their functions.
For example, an aircraft mechanic who goes to the aircraft to do his bill tasks ... if you understand what I mean. :)

Do you mean something like a ground support crew for aircraft maintenance and airport ground activities?

Regards,
Uriah

Yes, exactly what I mean. Because today it is seeing in many games that is much more focused on substantial as to what takes place in the background.

BR,
Stefan
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 10, 2015, 11:05:29 pm
Hi Stefan,

Such functionality would either have to be hard-code/scripted, or else it would require a sophisticated AI system. Scripting being by far the easier of the two methods.

These kind of features are at a much higher level than anything I can built currently, but it is certainly within the realm of possibility.

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Revolver on August 10, 2015, 11:18:58 pm
Hi Stefan,

Such functionality would either have to be hard-code/scripted, or else it would require a sophisticated AI system. Scripting being by far the easier of the two methods.

These kind of features are at a much higher level than anything I can built currently, but it is certainly within the realm of possibility.

Regards,
Uriah

Moin Uriah,

I'm not a programmer and far away from the, but I think that something like that can develop as Point Snap.
That is, the object is given a one-point X as a target where it can then be moved. So as I see it.  ::)
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: Uriah on August 10, 2015, 11:33:31 pm
Yes, we would need a dynamic waypoint placement tool and another method for vehicles to follow roads.

Now if you want the vehicle to interact with the world dynamically as events transpire, you'll need AI.

Regards,
Uriah
Title: Re: Automatic Waypoint Navigation (Tiger 2)
Post by: zzz on August 11, 2015, 06:29:04 pm
Hi

That is awesome! Sounds like just what we need for vehicles to automatically engage targets. Mind sharing?

Regards,
Uriah

I'm going to try and turn it into a function for the weekend. In the mean time here's a video.

https://www.youtube.com/watch?v=ubX8M07llFg

Second scene is for a super close target to show the independent angles.