/px4_quad_controllers

This repository contains pixhawk based controller codes for autonomous tracking of a minimum snap trajectory using an intel aero drone

Primary LanguagePython

px4 controllers

Components

  1. mRo Pixhawk Barebones
  2. TF mini
  3. PX4 Flow No SONAR
  4. Power Module (Optional)
  5. Pixhawk Cables
  6. Spektrum Rx DSMX
  7. Emax Motors RS2306
  8. Cobra 30A ESC
  9. Cobra ESC Programmer
  10. Matek PDB
  11. microSD Card

Hardware Setup

  1. ArduCopter Stack Flashing 1.1. 3.6.7 Pixhawk 1 Stable firmware
  2. Mounting the Flight Controller
  3. TFmini setup on arducopter
  4. PX4Flow Setup
  5. Mandatory Hardware Configuration
  6. DISARM Switch Setup Set CH7
  7. Motor Configuration Use QuadX
  8. Fly Manually

Offboard Control Setup

  1. MavROS Binary Installation
  2. Launch mavros 2.1. roslaunch mavros px4.launch 2.2. rosrun mavros mavsys rate --all 10 2.3. rosrun mavros mavparam set SYSID_MYGCS 1
  3. Run RCOveride node which publishes to the topic : /mavros/rc/override. RCOveride node should publihs message with same rc array size as mavros/rc/in. If you publish 0, that channel will not be overidden, but if you publish any other positive value, it will be overidden. After override, echo 'mavros/rc/in' to confirm that the RC override is working.

This repository contains controllers which can be used in unison with mavros and the px4 stack in order to achieve minimum snap trajectory tracking. The position feedback will be done using the vicon system.

Authors: Ashwin Varghese Kuruttukulam
Maintainer: Ashwin Varghese Kuruttukulam Affiliation: Perception and Robotics Group, Unversity of Maryland

Installation Instructions (Ubuntu)

  1. Install the repository and its dependencies (with rosinstall):
sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
  1. Set up a catkin workspace (if not already done):
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
cd src 
git clone https://github.com/ashwinvk94/px4_quad_controllers
catkin_make

Notes

Always start mavros before using any of the functionalities of this repo. On the intel aero drone, this can be done by running the following command on a terminal:

rosrun mavros mavros_node _fcu_url:=tcp://127.0.0.1:5760 _system_id:=2

Also, you can ssh into the aero drone using the following command: ''' ssh aero@192.168.8.1 ''' where "Aero" is the user_name of the computer

Usage

To the run the attitude+thrust controller inbuilt in the px4 firmware simply launch attitude_thrust_controller using the command: ''' roslaunch px4_quad_controllers attitude_thrust_controller.launch '''

This will start publishing the the attitude and thrust setpoints to the the topic "/mavros/setpoint_raw/attitude"
Now if you move the flight mode to "OFFBOARD" mode, then it will go that the attitudes and thrust set as per the rosparams. Default values are (0,0,0,0).