Skip to content

michaelkapteyn/mavros_controllers

 
 

Repository files navigation

mavros_controllers

Controllers for controlling MAVs using the mavros package in OFFBOARD mode.

Overview

The repository contains controllers for controlling MAVs using the mavros package. The following packages are included in the repo

  • geometric_controller: Trajectory tracking controller based on geometric control
  • controller_msgs: custom message definitions
  • trajectory_publisher: Node publishing setpoints as states from motion primitives / trajectories for the controller to follow.

Hovering done

Circular trajectory tracking

Getting Started

Install PX4 SITL(Only to Simulate)

Follow the instructions as shown in the PX4 Documentation To check if the necessary environment is setup correctly, you can run the gazebo SITL using the following command

cd <Firmware_directory>
make posix_sitl_default gazebo

To source the PX4 environment, run the following commands

source ~/catkin_ws/devel/setup.bash    // (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo

You can run the rest of the roslaunch files in the same terminal

Building mavros_controllers

mavros_controllers can be built using catkin build

cd <path_to_catkin_ws>
catkin build mavros_controllers

Running the code

The following launch file enables the geometric controller to follow a circular trajectory

roslaunch geometric_controller trajectory_track_circle.launch

Nodes

mavros_controllers include the following packages.

geometric_controller

The geometric controller publishes and subscribes the following topics.

  • Parameters

    • /geometric_controller/mavname (default: "iris")
    • /geometric_controller/ctrl_mode (default: MODE_BODYRATE)
    • /geometric_controller/enable_sim (default: true)
    • /geometric_controller/enable_gazebo_state (default: false)
    • /geometric_controller/max_acc (default: 7.0)
    • /geometric_controller/yaw_heading (default: 0.0)
    • /geometric_controller/drag_dx (default: 0.0)
    • /geometric_controller/drag_dy (default: 0.0)
    • /geometric_controller/drag_dz (default: 0.0)
    • /geometric_controller/attctrl_constant (default: 0.2)
    • /geometric_controller/normalizedthrust_constant (default: 0.1)
  • Published Topics

  • Subscribed Topics

trajectory_publisher

Trajectory publisher publishes continous trajectories to the trajectory_controller.

  • Parameters

    • /trajectory_publisher/initpos_x (default: 0.0)
    • /trajectory_publisher/initpos_y (default: 0.0)
    • /trajectory_publisher/initpos_z (default: 1.0)
    • /trajectory_publisher/updaterate (default: 0.01)
    • /trajectory_publisher/horizon (default: 1.0)
    • /trajectory_publisher/maxjerk (default: 10.0)
    • /trajectory_publisher/trajectory_type (default: 0)
    • /trajectory_publisher/number_of_primitives (default: 7)
    • /trajectory_publisher/shape_radius (default: 1.0)
  • Published Topics

  • Subscribed Topics

References

[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.

[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.

Contact

Jaeyoung Lim jalim@student.ethz.ch

About

Aggressive trajectory tracking using mavros for PX4 enabled vehicles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.6%
  • CMake 3.4%