Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Compass-Guided Autopilot Raft (CGAR)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
170.763 KB
16 Jul, 2018 @ 2:41pm
16 Jul, 2018 @ 2:43pm
2 Change Notes ( view )

Subscribe to download
Compass-Guided Autopilot Raft (CGAR)

Description
AFTER RECENT UPDATES, THIS IS OBSOLETE!

To my knowledge, this is the first autopilot system of this type and took a lot of effort to create, so please give a rating or some feedback if you appreciate the work put in! :)

This is an autonomous raft that navigates via a compass heading. Set a waypoint and the raft calculates the corresponding angle to reach it and travels there.

Logic Breakdown:
  • Orange - atan2
    This converts an (x,y) coordinate pair into an angle, allowing us to work out the relevant direction of travel needed to reach a waypoint.

  • Green - Conversion to degrees
    This converts the atan2 value into degrees from radians and also converts the compass bearing to the same. It also rotates the coordinate system to align with the northern direction.

  • Pink - PID and coord transform
    This translates the coordinate system so that the angle is calculated from your current position and not from the default (0,0). It also contains the PID controller which matches the desired heading to the current heading.

I believe this to be a superior method to the minimisation of distances between two GPS's https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1441746901 as it's more accurate, true to life, and you can also display the relavent heading you need to travel on a screen.

Once atan2 gets officially added to the logic pool, this will become a much more compact and reasonable navigation system and I will update it as such when the time comes :)

For now, enjoy this for what is it worth!

Please do not reupload without my permission
1 Comments
pingeon 17 Jul, 2018 @ 10:47am 
This is awesome!