{"id":30886888,"url":"https://github.com/discower/bsk-ros2-mpc","last_synced_at":"2025-09-08T13:52:42.342Z","repository":{"id":310185719,"uuid":"1022069970","full_name":"DISCOWER/bsk-ros2-mpc","owner":"DISCOWER","description":"ROS2 controllers for Basilisk Astrodynamics Simulator using BSK_ROS2_Bridge","archived":false,"fork":false,"pushed_at":"2025-08-16T09:21:26.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T11:28:53.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DISCOWER.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-18T12:00:04.000Z","updated_at":"2025-08-06T18:19:36.000Z","dependencies_parsed_at":"2025-08-16T11:40:23.376Z","dependency_job_id":null,"html_url":"https://github.com/DISCOWER/bsk-ros2-mpc","commit_stats":null,"previous_names":["discower/bsk-ros2-mpc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/DISCOWER/bsk-ros2-mpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fbsk-ros2-mpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fbsk-ros2-mpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fbsk-ros2-mpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fbsk-ros2-mpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DISCOWER","download_url":"https://codeload.github.com/DISCOWER/bsk-ros2-mpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fbsk-ros2-mpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274196114,"owners_count":25239148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-08T13:52:36.579Z","updated_at":"2025-09-08T13:52:42.297Z","avatar_url":"https://github.com/DISCOWER.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BSK ROS2 MPC Controller (BSK-ROS2-MPC)\n\nThis package integrates a Model Predictive Controller (MPC) with [Basilisk astrodynamics simulator](https://hanspeterschaub.info/basilisk/) using [BSK-ROS2-Bridge](https://github.com/Thomas-Chan-2019/srl-ros2-BSK-bridge.git).\n\nThe MPC is implemented using the [acados framework](https://github.com/acados/acados).\n\n## Overview\n\nThis package provides MPC controllers for spacecraft control in two main configurations:\n\n1. **Single Agent MPC**: Individual spacecraft control with position and attitude tracking\n2. **Leader-Follower MPC**: Multi-agent formation control where followers maintain relative positions to a leader spacecraft\n\n## Setup\n\nThis package depends on `acados`. Follow the official [installation guide](https://docs.acados.org/installation/) to set it up.\n\nClone this repo and the following dependencies into your ROS 2 workspace:\n\n* [bsk-msgs](https://github.com/E-Krantz/bsk-msgs.git)\n\nBuild the workspace:\n\n```bash\ncolcon build --packages-up-to bsk-ros2-mpc\nsource install/local_setup.bash\n```\n\n## Prerequisites\n\nBefore launching the MPC controllers, ensure the following components are running:\n\n1. **Basilisk Simulation**: The astrodynamics simulation must be started first\n2. **BSK-ROS2-Bridge**: The bridge connecting Basilisk to ROS2 must be active\n\n## Running the MPC Controllers\n\n### Single Agent MPC\n\nFor individual spacecraft control with position and attitude tracking:\n\n```bash\nros2 launch bsk-ros2-mpc bsk_mpc.launch.py\n```\n\n### Leader-Follower Formation Control\n\nFor multi-agent formation control, launch the controllers in sequence:\n\n1. **Start the leader controller** (moves between waypoints):\n```bash\nros2 launch bsk-ros2-mpc mpc_leader.launch.py\n```\n\n2. **Start the follower controllers** (maintains relative positions to leader):\n```bash\nros2 launch bsk-ros2-mpc mpc_followers.launch.py\n```\n\nThe follower launch file starts MPC controllers for both follower spacecraft simultaneously. \n\n\n### Launch File Options\n\nThe launch files support various configuration options:\n\n#### `bsk_mpc.launch.py`\n* `type`: Controller type (`da` for direct allocation, `wrench` for force/torque control)\n* `namespace`: ROS namespace for the spacecraft\n\n#### `mpc_leader.launch.py`\n* Configures the leader spacecraft to follow waypoint trajectories\n* Handles position and attitude reference tracking\n\n#### `mpc_followers.launch.py`\n* Launches MPC controllers for follower spacecraft\n* Configures relative position maintenance with respect to the leader\n\n### Examples\n\n**Single Agent - Basic:**\n```bash\nros2 launch bsk-ros2-mpc bsk_mpc.launch.py\n```\n\n**Single Agent - Direct Allocation MPC:**\n```bash\nros2 launch bsk-ros2-mpc bsk_mpc.launch.py type:=da\n```\n\n**Single Agent - Wrench MPC:**\n```bash\nros2 launch bsk-ros2-mpc bsk_mpc.launch.py type:=wrench namespace:=bskSat0\n```\n\n**Formation Control - Leader:**\n```bash\nros2 launch bsk-ros2-mpc mpc_leader.launch.py\n```\n\n**Formation Control - Followers:**\n```bash\nros2 launch bsk-ros2-mpc mpc_followers.launch.py\n```\n\n## References\n\n- [Basilisk Astrodynamics Simulation](https://hanspeterschaub.info/basilisk/)\n- [ROS 2 Documentation](https://www.ros.org/)\n- [BSK-ROS2 Bridge](https://github.com/DISCOWER/bsk-ros2-bridge.git)\n\n## License\n\nThis project is licensed under the BSD-3-Clause License - see the [LICENSE](LICENSE) file for details.\n\n## Authors\n\n**Elias Krantz**  \nEmail: eliaskra@kth.se","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscower%2Fbsk-ros2-mpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscower%2Fbsk-ros2-mpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscower%2Fbsk-ros2-mpc/lists"}