mzahana / mavros_trajectory_tracking

Accurate trajectory generation and tracking with interface to PX4 autopilot
BSD 3-Clause "New" or "Revised" License
28 stars 13 forks source link

mavros_trajectory_tracking

Accurate trajectory generation and tracking with interface to PX4 autopilot. This package provides integration of

Setup

Quick setup

NOTE: This is tested with ROS melodic

Installation inside docker container

You can do the setup inside a docker container that already has Ubuntu 18 + ROS Melodic + PX4 frimware v1.10.1. Use this repository to setup docker and required container, then do the setup as mentioned above.

Simulation

You can run the simulation using

roslaunch mavros_trajectory_tracking px4_trajectory_tracking.launch

You can use the ROS services provided by the waypoint_navigator_node to command the drone to go to a single waypoint, or a series of waypoints. The provided waypoint(s) will be used to generate a feasible trajectory which is the sampled and sent to the geometric_controller node which will send setpoints commands to MAVROS.

Example of sending a single waypoint to the navigator,

rosservice call /go_to_waypoint "point:
  x: 2.0
  y: 2.0
  z: 3.0"

You can use the /go_to_waypoints ROS service to request multi-waypoint trajectory

The velocity and acceleration constraints are defined in config/trajectory_simple_enu.yaml file.

You can also use the above ROS services in your custom ROS nodes.

The tracking performance can be tuned using the geometric controller parameters Kp_x, Kp_y, Kp_z, Kv_x, Kv_y, Kv_z in the geometric_controller.launch file. This is expected to vary according to the drone in use.