AI programming in depth – Part 1

So you are technically inclined and want to know how to really control Allec?

 

The AI programming language is the answer.

 

For those with programming experience a very breif description is that the AI programming language is much inspired by common C, with some robot relavant functions added. The language is really very simple, with faily few functions.

 

Let’s dive into how it works.

 

First some core information:

 

Missions are in fact AI programs, so you can create new or change the existing missions. Your missions can be stored in flash memory in Allec, so if you create something on PC you can then later use it using say your tablet.

 

Or you can import and export missions (AI programs), sharing your new great inventions with the rest of teh community and with us. We certainly want to push the best community created missions to everyone.

 

When in AI mode (not manually controlled) Allec always has four functions running:

 

Depth and Direction control. The value entered for these is what Allec always will aim at. That is, if you enter a depth of 3 meter and a direction of 67 degress, Allec will, through his navigation system automatically correct to be at the wanted depth and pointing in the wanted direction. Pretty much point and engage. If no values are entered, the defaults are zero.

 

The third automatical function is Avoidance.  The job of avoidance is to react in  proper way when obstacles are encountered, to try to still fullfill the wanted job, but at the same time avoiding the obstacle. A simple example is when doing the Scout mission Allec might encounter some seaweed. So avoidance will override the normal sailing program, to get around or over the sea weed, where upon the normal sailing program is continued.

 

The fourth system is an emergency return system. It will continous compare the remaining battery charge with distance sailed and distance in direct line back to start. If the battery charge starts getting close to not being able to sail the full way back (plus a margin) the emergency system will override the AI programming, bring Allec to the surface and turn the lights down. Then Allec will sail the most direct way back to start. The avoidance system will still be functional, so Allec will avoid obstacles on his way back.

 

Another core part is that the AI runs in one major loop, but sub loops are not directly possible. They are though indirectly possible through branches. More about that below.

 

 

 

A few words about the AI programming interface.

 

The interface is made up of three parts:

  • Command selector in the top
  • AI program listing windows
  • Command values
  • Import/Export functionality below.

 

 

AI programming interface

 

 

 

What better way to learn that through an example?

 

Part 2 will do just that.

Leave a Reply