Giter Club home page Giter Club logo

dragon-iss-docking-autopilot's Introduction

Dragon ISS Docking Autopilot in Go

Autopilot written in Go and executed as WebAssembly for docking the SpaceX Dragon capsule in the official simulator.

Autopilot during docking

Why

I never used Go and WebAssembly together before. This seemed like a nice and small excercise and I also got to refresh controller algorithms.

Using this autopilot

  • Compile the autopilot and serve the files.
go run ./cmd/autopilot-server
  • Open the SpaceX ISS docking simulator: https://iss-sim.spacex.com
  • Open the developer console of your browser (eg. right click > Inspect in Chrome)
  • Paste the following code into the console to load the autopilot:
const s = document.createElement("script");
s.setAttribute("src", "http://localhost:8000/loader.js?t="+ new Date().getTime());
document.body.appendChild(s);

If you want to make modifications to autopilot.go, restart the autopilot-server, refresh the simulator page and paste the above JavaScript code into the console again.

Controller algorithm

The main controller algorithm is the correct() method in autopilot.go. At first the current rate is calculated using the previous time and offset and dampened over some cycles DampingCycles.

Then a correction factor Correction is used to calculate the target rate. This target rate is limited based on the offset and RateFactor but kept between RateMin and RateMax.

The difference between target and current rate is then added to a clicks accumulator. Full clicks are then subtracted from the accumulator and returned from the function.

Play around with the ios configuration to get different controller behavior.

Contributing

If you improved this autopilot or added a new feature, don't hesitate to open a PR. I'm looking forward to see what you will do with it.


Built by @mbertschler

dragon-iss-docking-autopilot's People

Contributors

mbertschler avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.