Pixhawk Setup for Indoor Navigation with MOCAP
This tutorial demonstrates how to setup Pixhawk for indoor navigation with MOCAP and MatMav.
MOCAP support is not supported by recent estimator added to recent PX4 frimware versions. In particular, the EKF2 estimator does not support MOCAP feed (as of writing this tutorial). However, LPE supports MOCAP feed.
NOTE: If you are using Pixhawk 1 (px4fmu-v2_default), and the latest PX4 firmware, you will not be able to switch to LPE estimator. This is because the default estimator is set to EKF2, and there is no memory room to add more. If you are using Pixhawk boards that has more flash memory, e.g. Pixhawk 2 or Pixracer, the LPE will be available and you can switch to it.
Make sure that you upload a firmware that has LPE estimator. To upload custom, or specific PX4 firmware, follow the following procedure
Make sure that you download the latest QGroundControl
Go to the page of the requested release (v1.5.1 is recommended), and download Firmware.zip. Alternativly, locate the binary file (ends with .px4), of the custom version that you built.
Open QGroundcontrol, and navigate to the Firmware tab, and upload the custome Firmware:
After the firmware upload is done, re-connect Pixhawk, then make sure that you go throught the calibration processes (choosing airframe, calinrating sensors, calibrating radio)
Make sure that LPE estimator is chosen,
Set the ATT_EXT_HDG_M to Motion capture,
Modify the LPE fusiuon parameter as follows,
For faster telemetry link, set the TELEM2 as followd (for fastest rates use 921600 option, but you can start with 57600 first),
Reboot Pixhawk, and double check that the settings you made is correct.
Now, Pixhawk is ready top accept MOCAP data. Once you stream MOCAP data, you can double check that Pixhawk is receiving the right measurments by looking at the LOCALNED topic in the MAVLINK_Inspector,