Giter Club home page Giter Club logo

pva_tracker's Introduction

Introduction

This package contains a tracker that receives position, velocity, and acceleration commands and turns the commands to attitude and thrust setpoints. These setpoints will be sent to Mavros to control a PX4 drone. So Mavros should be started before using this tracker.

NOTE: Before you use the tracker for a real drone, the parameter hover_thrust_factor_min, hover_thrust_factor_max, "flight_time_minute and stand_by_time_minute in cfg/pid.cfg should be set to a right value.

  • "flight_time_minute" and "stand_by_time_minute" are the maximum flight time and maximum stand-by time (when the drone is disarmed but the onboard computer is running.)

  • "hover_thrust_factor_min" and "hover_thrust_factor_max" correspond to the hover thrust factor when the battery is fully charged and almost empty. Our hover thrust is px4's hover thrust / 9.8.

Compile

Clone to your ROS workspace and run

catkin_make

or

catkin build

Usage

Nodes Introduction

Two nodes for the tracker:

  • tracker: receive position, velocity, and acceleration commands and publish attitude and thrust commands. The topic name is /pva_setpoint. The message type is trajectory_msgs::JointTrajectoryPoint, where the fourth element in the position vector is yaw setpoint.

  • tracker_sim_auto_arm_takeoff: Use this node only in simulation. This node will arm and take off the drone automatically and wait for the same commands as the tracker node uses.

Two nodes to generate hover commands or simple trajectories. These two nodes only work when one of the above nodes has been started.

  • hover_test: record the position when the drone is set to OFFBOARD mode and hover.

  • control_test: generates trajectories with four stages when the drone is armed and set to offboard mode:

    1. Takeoff
    2. Get to a point (R, -R) by minimum jerk planner
    3. Accelerate to v and get to point (R, 0)
    4. Continuously fly as a circle with radius R, Speed v.

Run

1.Run the tracker by:

rosrun pva_tracker tracker

or (only in simulation)

rosrun pva_tracker tracker_sim_auto_arm_takeoff

Then you can run your planner to generate pva commands.

2.If you want to test basic hovering performance in OFFBOARD mode, launch by

roslaunch pva_tracker hover_test.launch

Then fly your drone to a desired position and switch to OFFBOARD mode. If the parameters are good, the drone will hover at the position. The yaw direction depends on a parameter you set in the launch file. The default yaw is zero.

3.If you want to test auto takeoff and draw a circle with the control_test node, launch by

roslaunch pva_tracker take_off_and_draw_circle.launch

Parameters like circle radius and flight speed can be set in the launch file.

Tune PID parameters:

The default parameters are stored in cfg/pid.cfg. You can tune the parameter using a rqt tool:

rosrun rqt_reconfigure rqt_reconfigure 

When you change any parameter with the rqt_reconfigure, the changing takes effect immediately. Therefore, Never change any parameter when the drone is flying.

Changes through rqt_reconfigure will not be saved when ROS is shut down. Therefore, save the parameters as a yaml file so that you can reload the parameters with rqt_reconfigure next time. When you have finished parameter tuning, you can change the default parameters in cfg/pid.cfg. Changes to cfg/pid.cfg require recompilation and restarting ROS to take effect.

pva_tracker's People

Contributors

g-ch avatar

Stargazers

YangPH avatar  avatar Dennis Benders avatar Shaohang Han avatar Siyuan Wu avatar Moji Shi avatar Hai Zhu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.