{"id":26076776,"url":"https://github.com/discower/px4-mpc","last_synced_at":"2025-04-07T06:04:23.022Z","repository":{"id":249431463,"uuid":"497602312","full_name":"DISCOWER/px4-mpc","owner":"DISCOWER","description":"MPC implementation using acados integrated with with PX4 on ROS2","archived":false,"fork":false,"pushed_at":"2025-03-07T13:50:57.000Z","size":141,"stargazers_count":95,"open_issues_count":4,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T08:11:37.574Z","etag":null,"topics":["drones","mpc","px4","robotics","ros2"],"latest_commit_sha":null,"homepage":"","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}},"created_at":"2022-05-29T13:41:25.000Z","updated_at":"2025-04-04T12:39:56.000Z","dependencies_parsed_at":"2024-07-20T19:28:10.714Z","dependency_job_id":"6f854b4d-4789-4a4f-a276-cc1dbf04350c","html_url":"https://github.com/DISCOWER/px4-mpc","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":0.5217391304347826,"last_synced_commit":"00d9bf9c36cc8bcf8c48cbda285a4303c44c3f3b"},"previous_names":["jaeyoung-lim/px4-mpc","discower/px4-mpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fpx4-mpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fpx4-mpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fpx4-mpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DISCOWER%2Fpx4-mpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DISCOWER","download_url":"https://codeload.github.com/DISCOWER/px4-mpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"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","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":["drones","mpc","px4","robotics","ros2"],"created_at":"2025-03-09T02:29:24.533Z","updated_at":"2025-04-07T06:04:22.996Z","avatar_url":"https://github.com/DISCOWER.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# px4-mpc\nThis package contains an MPC integrated with with [PX4 Autopilot](https://px4.io/) and [ROS 2](https://ros.org/).\n\nThe MPC uses the [acados framework](https://github.com/acados/acados)\n\n![px4-mpc](https://github.com/user-attachments/assets/6713b8e6-815f-42fe-b3a0-51708d3416e5)\n\n## Paper\nIf you find this package useful in an academic context, please consider citing the paper\n\n- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. \"Towards Open-Source and Modular Space Systems with ATMOS.\" arXiv preprint arXiv:2501.16973 (2025).\n. [[preprint](https://arxiv.org/abs/2501.16973)]\n\n```\n@article{roque2025towards,\n  title={Towards Open-Source and Modular Space Systems with ATMOS},\n  author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},\n  journal={arXiv preprint arXiv:2501.16973},\n  year={2025}\n}\n```\n\n## Setup\nThe MPC formulation uses acados. In order to install acados, follow the following [instructions](https://docs.acados.org/installation/)\nTo build the code, clone the following repositories into a ros2 workspace\nDependencies\n- [px4_msgs](https://github.com/PX4/px4_msgs/pull/15)\n- [px4-offboard](https://github.com/Jaeyoung-Lim/px4-offboard) (Optional): Used for RViz visualization\n\n```\ncolcon build --packages-up-to px4_mpc\n```\n\n## Running MPC with PX4 SITL\nIn order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup.\nFor instructions, follow the [documentation](https://docs.px4.io/main/en/ros/ros2_comm.html)\n\nRun PX4 SITL\n```\nmake px4_sitl gazebo\n```\n\nRun the micro-ros-agent\n```\nmicro-ros-agent udp4 --port 8888\n```\n\n### Quadrotor Example\nIn order to launch the mpc quadrotor in a ros2 launchfile,\n```\nros2 launch px4_mpc mpc_quadrotor_launch.py \n```\n\n### Spacecraft Example\nFirst, make sure that you have followed the instructions in the [ATMOS guide](https://atmos.discower.io/pages/Simulation/). To control the vehicle with this package, make sure to switch the vehicle to Offboard mode in QGroundControl (see [QGroundControl in ATMOS guide](https://atmos.discower.io/pages/PX4/#building-qgroundcontrol-for-spacecraft).\n\nThe mpc_spacecraft_launch.py file includes optional arguments:\n\n- **mode**: Control mode (wrench by default). Options: wrench, rate, direct_allocation.  \n- **namespace**: Spacecraft namespace ('' by default).  \n- **setpoint_from_rviz**: Use RViz for setpoints (True by default).\n\n**Example with no namespace:**\n```bash\nros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False\n```\n\n**Example with namespace:**\nFor this example to work, make sure you have run the PX4 SITL with the same namespace. Here goes an example\n```bash\nPX4_UXRCE_DDS_NS=pop make px4_sitl gz_spacecraft_2d\n```\nOn another terminal, run \n```\nmicro-ros-agent udp4 --port 8888\n```\n\nLastly, start PX4-MPC\n```bash\nros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench namespace:=pop setpoint_from_rviz:=False\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscower%2Fpx4-mpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscower%2Fpx4-mpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscower%2Fpx4-mpc/lists"}