Feeding MOCAP Data to Pixhawk
Intro
This tutorial shows you how to feed MOCAP data to Pixhawk that is connected to an ODROID, or an onboard linux computer. This will allow Pixhawk to have indoor position and heading information for position stabilization.
Hardware Requirements
- Pixhawk or simial controller that runs PX4 firmware
- ODROID (we will assume XU4)
- Serial connection, to connect ODROID to Pixhawk. You can use USB/FTDI cable. If you are using Pixhawk 2, then connect the serial cable to TELEM2 port. If you are using MindPX flight controller, just use a USB to micro-USB cable.
- OptiTrack PC
- WiFi router (5Ghz is recommended)
Software Requirements
Linux Ubuntu 16 installed on ODROID XU4. A minimal image is recommended for faster executions.
A ready image for your eyes is available in (https://www.dropbox.com/s/bllrihqe9k8rtn9/ubuntu16_minimal_ros_kinetic_mavros.img?dl=0). This image has all the required software that is needed in this tutorial. You can use Etcher (https://etcher.io/) to flash your eMMC card with the provided `.img` fileMake sure that you expand your eMMC card after you flash a new image in order to use the full space of the eMMC card.ROS Kinetic installed on ODROID XU4. The above image already includes this
- MAVROS package: (binary installation). Again, the above image includes this
- Install
vrpn_client_ros
package. You can use the following command to install the package (assuming ROS Kinetic is used).
Again, this is included in the provided imagesudo apt-get install ros-kinetic-vrpn-client-ros -y
Now, you need to set your flight controller firmware PX4, to accept mocap data. PX4 has two state estimators, EKF2(default) an extended Kalman filter, and LPE.
LPE estimator supports mocap data directly. EKF2, however, (at the time of writing this tutorial) does not support directly. Instead, it can accept mocap data as vision-based data. We will explain how to setup both estimator to use mocap data. Go to next sub sections for more details.