{"id":13600807,"url":"https://github.com/mbertschler/dragon-iss-docking-autopilot","last_synced_at":"2026-01-16T15:23:01.975Z","repository":{"id":57532523,"uuid":"266431437","full_name":"mbertschler/dragon-iss-docking-autopilot","owner":"mbertschler","description":"Autopilot in Go for docking the SpaceX Dragon capsule in the simulator ","archived":false,"fork":false,"pushed_at":"2020-05-29T07:56:09.000Z","size":32,"stargazers_count":293,"open_issues_count":0,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T01:39:34.634Z","etag":null,"topics":["autopilot","controller","controller-algorithm","go","spacex","webassembly"],"latest_commit_sha":null,"homepage":"https://youtu.be/jLTr6UwuSd4","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbertschler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-23T22:42:27.000Z","updated_at":"2025-02-19T07:01:02.000Z","dependencies_parsed_at":"2022-09-26T18:22:10.034Z","dependency_job_id":null,"html_url":"https://github.com/mbertschler/dragon-iss-docking-autopilot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbertschler/dragon-iss-docking-autopilot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbertschler%2Fdragon-iss-docking-autopilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbertschler%2Fdragon-iss-docking-autopilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbertschler%2Fdragon-iss-docking-autopilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbertschler%2Fdragon-iss-docking-autopilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbertschler","download_url":"https://codeload.github.com/mbertschler/dragon-iss-docking-autopilot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbertschler%2Fdragon-iss-docking-autopilot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autopilot","controller","controller-algorithm","go","spacex","webassembly"],"created_at":"2024-08-01T18:00:49.042Z","updated_at":"2026-01-16T15:23:01.959Z","avatar_url":"https://github.com/mbertschler.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Dragon ISS Docking Autopilot in Go\n\nAutopilot written in Go and executed as WebAssembly for docking the SpaceX\nDragon capsule in the [official simulator](https://iss-sim.spacex.com). \n\n### [Screencast of the autopilot in action](https://youtu.be/jLTr6UwuSd4)\n\n\u003cimg alt=\"Autopilot during docking\" src=\"https://mbertschler.com/github/dragon-iss-docking-autopilot/dragon-iss-autopilot-docking.png\" width=\"420px\"/\u003e\n\n## Why\n\nI never used Go and WebAssembly together before. This seemed like a nice and\nsmall excercise and I also got to refresh controller algorithms.\n\n## Using this autopilot\n\n- Compile the autopilot and serve the files.\n\n```bash\ngo run ./cmd/autopilot-server\n```\n\n- Open the SpaceX ISS docking simulator: https://iss-sim.spacex.com\n- Open the developer console of your browser (eg. right click \u003e Inspect in Chrome)\n- Paste the following code into the console to load the autopilot:\n\n```js\nconst s = document.createElement(\"script\");\ns.setAttribute(\"src\", \"http://localhost:8000/loader.js?t=\"+ new Date().getTime());\ndocument.body.appendChild(s);\n```\n\nIf you want to make modifications to `autopilot.go`, restart the\n`autopilot-server`, refresh the simulator page and paste the above\nJavaScript code into the console again.\n\n## Controller algorithm\n\nThe main controller algorithm is the `correct()` method in `autopilot.go`.\nAt first the current rate is calculated using the previous time and offset\nand dampened over some cycles `DampingCycles`.\n\nThen a correction factor `Correction` is used to calculate the target rate.\nThis target rate is limited based on the offset and `RateFactor` but kept\nbetween `RateMin` and `RateMax`.\n\nThe difference between target and current rate is then added to a clicks\naccumulator. Full clicks are then subtracted from the accumulator and\nreturned from the function.\n\nPlay around with the `ios` configuration to get different controller behavior.\n\n## Contributing\n\nIf you improved this autopilot or added a new feature, don't hesitate to open a PR.\nI'm looking forward to see what you will do with it.\n\n---\n\nBuilt by [@mbertschler](https://twitter.com/mbertschler)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbertschler%2Fdragon-iss-docking-autopilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbertschler%2Fdragon-iss-docking-autopilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbertschler%2Fdragon-iss-docking-autopilot/lists"}