{"id":16984827,"url":"https://github.com/jaeyoung-lim/mavros_controllers","last_synced_at":"2025-04-04T20:09:31.245Z","repository":{"id":40304845,"uuid":"140596755","full_name":"Jaeyoung-Lim/mavros_controllers","owner":"Jaeyoung-Lim","description":"Aggressive trajectory tracking using mavros for PX4 enabled vehicles","archived":false,"fork":false,"pushed_at":"2022-09-03T11:46:41.000Z","size":361,"stargazers_count":447,"open_issues_count":25,"forks_count":171,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-28T19:07:45.631Z","etag":null,"topics":["drone","gazebo","mavros","px4","quadrotor","robotics","ros","trajectory"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Jaeyoung-Lim.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":"2018-07-11T15:43:22.000Z","updated_at":"2025-03-22T15:25:19.000Z","dependencies_parsed_at":"2022-08-09T16:52:14.690Z","dependency_job_id":null,"html_url":"https://github.com/Jaeyoung-Lim/mavros_controllers","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaeyoung-Lim%2Fmavros_controllers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaeyoung-Lim%2Fmavros_controllers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaeyoung-Lim%2Fmavros_controllers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaeyoung-Lim%2Fmavros_controllers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaeyoung-Lim","download_url":"https://codeload.github.com/Jaeyoung-Lim/mavros_controllers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"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":["drone","gazebo","mavros","px4","quadrotor","robotics","ros","trajectory"],"created_at":"2024-10-14T02:34:51.635Z","updated_at":"2025-04-04T20:09:31.214Z","avatar_url":"https://github.com/Jaeyoung-Lim.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mavros_controllers\n[![Build Test](https://github.com/Jaeyoung-Lim/mavros_controllers/workflows/Build%20Test/badge.svg)](https://github.com/Jaeyoung-Lim/mavros_controllers/actions?query=workflow%3A%22Build+Test%22) [![DOI](https://zenodo.org/badge/140596755.svg)](https://zenodo.org/badge/latestdoi/140596755)\n\nControllers for controlling MAVs using the [mavros](https://github.com/mavlink/mavros) package in OFFBOARD mode.\n\n\n## Overview\nThe repository contains controllers for controlling MAVs using the mavros package. The following packages are included in the repo\n- geometric_controller: Trajectory tracking controller based on geometric control\n- controller_msgs: custom message definitions\n- trajectory_publisher: Node publishing setpoints as states from motion primitives / trajectories for the controller to follow.\n\n[![Multiple drone](https://user-images.githubusercontent.com/5248102/87020057-a3e25200-c1d3-11ea-9f76-cd010cb8329a.gif)](https://user-images.githubusercontent.com/5248102/87020057-a3e25200-c1d3-11ea-9f76-cd010cb8329a.gif)\n\n[![Hovering drone](https://img.youtube.com/vi/FRaPGjX9m-c/0.jpg)](https://youtu.be/FRaPGjX9m-c \"Hovering done\")\n\n[![Circular trajectory tracking](https://img.youtube.com/vi/IEyocdnlYw0/0.jpg)](https://youtu.be/IEyocdnlYw0 \"Circular trajectory tracking\")\n\n## Getting Started\n### Install PX4 SITL(Only to Simulate)\nFollow the instructions as shown in the [ROS with Gazebo Simulation PX4 Documentation](https://dev.px4.io/master/en/simulation/ros_interface.html)\nTo check if the necessary environment is setup correctly, you can run the gazebo SITL using the following command\n\n```bash\ncd \u003cFirmware_directory\u003e\nDONT_RUN=1 make px4_sitl_default gazebo\n```\nTo source the PX4 environment, run the following commands\n\n```bash\ncd \u003cFirmware_directory\u003e\nsource ~/catkin_ws/devel/setup.bash    # (optional)\nsource Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default\nexport ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)\nexport ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo\n```\n\nYou can run the rest of the roslaunch files in the same terminal\n\n```bash\n roslaunch px4 posix_sitl.launch\n```\n\nYou will need to source the PX4 environment in every new terminal you open to launch mavros_controllers. \n\n### Installing mavros_controllers\n\nCreate a catkin workspace:\n\nThis folder will probably be already created since the previous process would have created it. If it is not present, do:\n\n```bash\nmkdir -p ~/catkin_ws/src\ncd ~/catkin_ws\ncatkin init\ncatkin config --merge-devel\ncd ~/catkin_ws/src\nwstool init\n```\n\n###### Clone this repository\n\n```bash\ncd ~/catkin_ws/src\ngit clone https://github.com/Jaeyoung-Lim/mavros_controllers\n```\n\nNow continue either with wstool to automatically download dependencies or download them manually.\n\n###### With wstool\n\nwstool automates the installation of dependencies and updates all packages. If you have no problem updating the packages required by mavros_controllers and/or any other packages, follow this procedure. If not, follow the next 'Manually Download dependencies and build' section.\n\n```bash\ncd ~/catkin_ws\nwstool merge -t src src/mavros_controllers/dependencies.rosinstall\nwstool update -t src -j4\nrosdep install --from-paths src --ignore-src -y --rosdistro $ROS_DISTRO\ncatkin build\nsource ~/catkin_ws/devel/setup.bash\n```\n\n\n###### Manually Download dependencies and build\n\nIf you did not install with wstool, you need to manually download the dependencies:\n- [catkin_simple](https://github.com/catkin/catkin_simple)\n- [eigen_catkin](https://github.com/ethz-asl/eigen_catkin)\n- [mav_comm](https://github.com/ethz-asl/mav_comm)\n\nDo:\n\n```bash\ncd ~/catkin_ws/src\ngit clone https://github.com/catkin/catkin_simple\ngit clone https://github.com/ethz-asl/eigen_catkin\ngit clone https://github.com/ethz-asl/mav_comm\n```\n\nBuild all the packages:\n\n```bash\ncd ~/catkin_ws\ncatkin build\nsource ~/catkin_ws/devel/setup.bash\n```\n\n## Running the code\nRemember to source the workspace `setup.bash` before sourcing the PX4 environment.\n```bash\ncd \u003cFirmware_directory\u003e\nsource ~/catkin_ws/devel/setup.bash    # (necessary)\nsource Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default\nexport ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)\nexport ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo\n```\nThe following launch file enables the geometric controller to follow a circular trajectory\n\n``` bash\nroslaunch geometric_controller sitl_trajectory_track_circle.launch\n```\n\nIf the UAV does not takeoff, please open QGroundControl and enable virtual joystick as mentioned [here](https://docs.qgroundcontrol.com/master/en/SettingsView/VirtualJoystick.html)\n\n## Nodes\n`mavros_controllers` include the following packages.\n### geometric_controller\n\nThe geometric controller publishes and subscribes the following topics.\n- Parameters\n    - /geometric_controller/mavname (default: \"iris\")\n    - /geometric_controller/ctrl_mode (default: MODE_BODYRATE)\n    - /geometric_controller/enable_sim (default: true)\n    - /geometric_controller/enable_gazebo_state (default: false)\n    - /geometric_controller/max_acc (default: 7.0)\n    - /geometric_controller/yaw_heading (default: 0.0)\n    - /geometric_controller/drag_dx (default: 0.0)\n    - /geometric_controller/drag_dy (default: 0.0)\n    - /geometric_controller/drag_dz (default: 0.0)\n    - /geometric_controller/attctrl_constant (default: 0.2)\n    - /geometric_controller/normalizedthrust_constant (default: 0.1)\n\n- Published Topics\n\t- command/bodyrate_command ( [mavros_msgs/AttitudeTarget](http://docs.ros.org/api/mavros_msgs/html/msg/AttitudeTarget.html) )\n\t- reference/pose ( [geometry_msgs/PoseStamped](http://docs.ros.org/kinetic/api/geometry_msgs/html/msg/PoseStamped.html) )\n\n- Subscribed Topics\n\t- reference/setpoint ( [geometry_msgs/TwistStamped](http://docs.ros.org/api/geometry_msgs/html/msg/TwistStamped.html) )\n\t- /mavros/state ( [mavros_msgs/State](http://docs.ros.org/api/mavros_msgs/html/msg/State.html) )\n\t- /mavros/local_position/pose ( [geometry_msgs/PoseStamped](http://docs.ros.org/kinetic/api/geometry_msgs/html/msg/PoseStamped.html) )\n\t- /gazebo/model_states( [gazebo_msgs/ModelStates](http://docs.ros.org/kinetic/api/gazebo_msgs/html/msg/ModelState.html) )\n\t- /mavros/local_position/velocity( [geometry_msgs/TwistStamped](http://docs.ros.org/api/geometry_msgs/html/msg/TwistStamped.html) )\n\n### trajectory_publisher\n\nTrajectory publisher publishes continous trajectories to the trajectory_controller.\n- Parameters\n    - /trajectory_publisher/initpos_x (default: 0.0)\n    - /trajectory_publisher/initpos_y (default: 0.0)\n    - /trajectory_publisher/initpos_z (default: 1.0)\n    - /trajectory_publisher/updaterate (default: 0.01)\n    - /trajectory_publisher/horizon (default: 1.0)\n    - /trajectory_publisher/maxjerk (default: 10.0)\n    - /trajectory_publisher/trajectory_type (default: 0)\n    - /trajectory_publisher/number_of_primitives (default: 7)\n    - /trajectory_publisher/shape_radius (default: 1.0)\n\n- Published Topics\n\t- reference/trajectory ( [nav_msgs/Path](http://docs.ros.org/kinetic/api/nav_msgs/html/msg/Path.html) )\n\t- reference/setpoint ( [geometry_msgs/TwistStamped](http://docs.ros.org/kinetic/api/geometry_msgs/html/msg/Twist.html) )\n\n- Subscribed Topics\n    - /trajectory_publisher/motionselector ([std_msgs/int32](http://docs.ros.org/api/std_msgs/html/msg/Int32.html));\n    - /mavros/local_position/pose ( [geometry_msgs/PoseStamped](http://docs.ros.org/kinetic/api/geometry_msgs/html/msg/PoseStamped.html) )\n    - /mavros/local_position/velocity( [geometry_msgs/TwistStamped](http://docs.ros.org/api/geometry_msgs/html/msg/TwistStamped.html) )\n\n## Contact\nJaeyoung Lim \tjalim@ethz.ch\n\n## Citation\nIn case you use this work as an academic context, please cite as the following.\n```\n@misc{jaeyoung_lim_2019_2619313,\n  author       = {Jaeyoung Lim},\n  title        = {{mavros_controllers - Aggressive trajectory \n                   tracking using mavros for PX4 enabled vehicles}},\n  month        = mar,\n  year         = 2019,\n  doi          = {10.5281/zenodo.2652888},\n  url          = {https://doi.org/10.5281/zenodo.2652888}\n}\n```\n\n## References\n[1] Lee, Taeyoung, Melvin Leoky, and N. Harris McClamroch. \"Geometric tracking control of a quadrotor UAV on SE (3).\" Decision and Control (CDC), 2010 49th IEEE Conference on. IEEE, 2010.\n\n[2] Faessler, Matthias, Antonio Franchi, and Davide Scaramuzza. \"Differential flatness of quadrotor dynamics subject to rotor drag for accurate tracking of high-speed trajectories.\" IEEE Robot. Autom. Lett 3.2 (2018): 620-626.\n\n### Build issues:\n\n\n###### catkin_simple() or eigen_catkin() not found\n\n This should not have happened if you clone the catkin_simple and eigen_catkin repositories. Try again:\n\n```bash\ncd ~/catkin_ws/src\ngit clone https://github.com/catkin/catkin_simple\ngit clone https://github.com/ethz-asl/eigen_catkin\ncd ~/catkin_ws\ncatkin build mavros_controllers\nsource ~/catkin_ws/devel/setup.bash\n```\n\n- Refer to [this issue](https://github.com/Jaeyoung-Lim/mavros_controllers/issues/61).\n\n###### iris.sdf model not found: \n\nTry:\n```bash\ncd \u003cFirmware_directory\u003e\nmake px4_sitl_default sitl_gazebo\n```\n\nor refer to [this issue](https://github.com/PX4/Firmware/issues?utf8=%E2%9C%93\u0026q=%2Firis%2Firis.sdf+) the [ROS with Gazebo Simulation PX4 Documentation](https://dev.px4.io/master/en/simulation/ros_interface.html). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaeyoung-lim%2Fmavros_controllers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaeyoung-lim%2Fmavros_controllers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaeyoung-lim%2Fmavros_controllers/lists"}