Autopilot

From Space Engineers Wiki
Jump to navigation Jump to search

The Remote Control (short: RC) block and the Automaton blocks (short: AI) support an optional autopilot function. The Autopilot is used to make shuttles, trams, or patrolling defense drones travel on a predetermined track and perform automatic actions at waypoints.

A “drone”, “tram”, or “shuttle” in this article’s sense is a cockpit-less ship with a Remote Control or Automaton block, gyroscopes, and thrusters, plus any specialised functionality of your choice — such as connectors, passenger cabin, turrets with AI targeting enabled, spotlights, cargo containers, etc.

For the Autopilot, antenna and cockpit are allowed but not required. You just need some port to access the Control Panel Screen to set everything up.

Usage

In the Control Panel Screen, the following settings apply to the Autopilot. They are explained in this article.

  • Collision Avoidance
  • Precision Mode
  • Flight Mode
  • Forward Direction
  • Speed Limit
  • Waypoints
  • Set up Actions
  • GPS Locations, Add, Remove

How to create waypoints

To configure the shuttle’s autopilot behaviour, you need to give it waypoints:

  1. Prepare a list of waypoints on your GPS screen.
  2. Open the AI Basic/Remote Control block’s Control Panel Screen.
  3. Create a list of Waypoints for the Autopilot to follow in order:
    • To add a location, select a coordinate from the "GPS Locations" list and click Add. It is added to the Waypoints.
    • To make corrections, select a misplaced coordinate from the Waypoints list and click Remove.

The Autopilot will interpret the list as a queue, starting from the top and working its way to the bottom, travelling from one to the next.

The Autopilot can control thrusters and gyroscopes to reach the listed waypoints. The Autopilot cannot steer wheels though — the "Control Wheels" option that you see in the Remote Control Panel refers to the player-steered Remote Control, not to the Autopilot function.

How to send a drone out on patrol using Flight modes

The autopilot operates in one of three flight modes:

  • Patrol - If the first and last waypoint lie far apart, you may want to choose Patrolling. The autopilot visits each waypoint, and then turns around and visits them in backwards order, and so on.
    Example: ABC CBA ABC CBA…
  • Circle - If the first and last waypoint are close to each other, you may want to choose circling. The autopilot visits each waypoint, and then starts over from the beginning, and so on.
    Example: ABC ABC ABC ABC…
  • One Way - The autopilot visits each waypoint, stops at the last waypoint, then toggles itself off.[1] This option is useful to send a ship somewhere, once, either on a kamikaze mission, or to automatically move one damaged ship to safety while the player pilot changes to another ship.
    Example: ABC.

How Precision Mode affects speed and safety

Toggle on Precision Mode for more accurate shuttle navigation. In precision mode, the autopiloted shuttle aims to stop exactly on each GPS waypoint before it rotates towards the next waypoints, using the Remote Control/AI Basic block as the center point of the vessel.

  • The advantage of precision mode is that the shuttle can follow a path through a narrow base or tight mining tunnel, and it aligns itself perfectly with waypoints recorded for Connectors.
  • The downside is that the shuttle will brake often and accelerate again, meaning the shuttle will waste power/fuel, and travel only very slowly.

When Precision Mode is off, the shuttle travels faster. The autopilot aims for a general area of about 50 meters around the waypoint. Once the way point is deemed close enough, the autopilot will immediately turn and continue on to the next GPS waypoint, without braking.

  • The advantage is that the Autopilot will use the fastest means to reach each waypoint.
  • The downside is that it will overshoot waypoints, miss connectors, and bash into base walls, because of its high speed.

This faster mode works well for patrolling open space, but is not recommended for shuttle navigation inside bases or near obstacles!

The GPS coordinates of the waypoints are aligned with the position of the AI/RC block! Especially when you want to position a ship at a connector, park the drone on its docking connector before creating the GPS waypoint to get the exact spot.

Tip: When the pilot creates the GPS waypoint while remotely piloting a grid, the waypoint is centered on the grid’s AI/RC block automatically. This makes it easier to create correct waypoints remotely — you don't need to fly there in person. If you however attempt to create waypoints in Spectator Mode, the GPS will record the location of the player character instead of the location of the Spectator!

How Collision Avoidance affects speed and safety

Collision Avoidance enables a basic obstacle sensor when flying long distances autonomously. The autopilot will attempt to detect obvious obstacles, like base walls, asteroids, or mountains, and brake to avoid crashing. It will not detect nor avoid players though.

Before the Automaton update, the function of Collision Avoidance merely prevented drones from totalling themselves by waiting in front of the obstacle for you to provide additional waypoints (on the RC's Control Panel Screen). Post-Automaton update, collision avoiding drones are expected to find a path around simple obstacles autonomously (although only very slowly).

  • If you gave the autopiloted drone very precise, safe waypoints to describe its path, for example for a shuttle inside a base, then switch Collision Avoidance off.
  • If the autopiloted grid is a player-built missile which is meant to collide with targets, switch Collision Avoidance off.
  • If you only know the corner points of the path, or if it's a long path, and anything (defense, attack, other events) could happen in between, switch Collision Avoidance on.
  • If the drone refuses to fly with Collision Avoidance on, some obstacle is too close to the Remote Control sensor. Place the RC block somewhere where it is not obstructed by the drone's own blocks either.

Note that the Autopilot sensor scans a spherical area to ensure the drone has room to rotate, so even if the drone is built slender, the AI considers narrow gaps a full obstacle.

How to not fly sideways/upside down

If you have built the remote control block (RC) the wrong way round, the shuttle will fly sideways, upside down, or even backwards. This poses an obstacle for docking or if your atmo thrusters need to point towards planetary gravity.

Grinding the RC down and rebuilding it may not be a choice if it’s squeezed into a small drone ship. Then correct it in the control panel "the software way": Select the new Forward Direction from the menu: backwards, left, right, up, or down. Default is forward.

Tip: Look at the text above the lens from the front to verify that the camera is right way up, too. A camera often easier to replace and turn around.

What's the speed limit good for?

Depending on how your waypoints are spaced, and if Precision mode is off, the shuttle’s behaviour can look like reckless flying. A shuttle that accelerates between waypoints can overshoot the target (and possibly damage itself) and will have to correct course a lot.

To prevent it from wasting time and energy with course corrections, use the Speed Limit slider to slow the drone down to a lower percentage of its maximum acceleration.

How to perform automatic actions at waypoints

At each waypoint, the autopilot can optionally trigger any ship functions from the G Menu, which makes your drones quite flexible and powerful.

For example at arrival, the drone can automatically play sounds, toggle lights on/off, de-/repressurise a passenger cabin, lock/unlock landing gears, lock/unlock connectors (to recharge batteries and restock ammo), discharge/recharge connected batteries, close/open its doors, and so on.

To have more control and activate multiple events, put each set of actions into a Timer Block, and make the Waypoint action start the Timer Block.

How to perform automatic re-actions anywhere

A drone can react to sudden changes in its own grid (e.g. damage) or to objects in sensor range. To make the drone react to dynamic events other than reaching a waypoint, build an Event Controller block or Sensor and set it up to detect situations and trigger actions.

Can the Autopilot steer rovers?

Be warned that for wheeled vehicles, waypoint detection is unreliable, because, in contrast to spacecraft, a rover in gravity cannot freely move in 6 directions to align with the target coordinates. If the suspension is higher or lower (simply because the cargo is full or empty), the autopilot struggles to "reach" the waypoint.

On top of that, collision avoidance and precision mode are not available for wheeled vehicles at all.

The workaround to combine slidy wheels with a propulsion override is only viable on flat terrain, the autopilot cannot handle driving uphill with low friction wheels.

If you still want to try it, see How to use autopilot with wheeled vehicles.

Steam Workshop Scripts

For autopiloted space flight, see Rdav‘s Fleet Command script; and for reliable autopiloted land vehicles, see Wanderer_308’s Driver Assisting System on the Steam Workshop.

References

Categoty:Drone