Pixhawk - Pitt-RAS/iarc7_common GitHub Wiki
Introduction
IARC 2017-2018 uses a Pixhawk 1 with custom firmware.
Configuration
Parameter Backup and Restoration
QGroundControl allows parameters to be backed up to a .params file from the parameters menu. However restoration can take as many as 3 to 4 attempts. This PX4 Firmware issue discusses and mentions that its fixed which doesn't appear to be true. See the relevant QGroundControl issue that says it isn't fixed yet.
Parameter files contain airframe data and such so in case of system failure a backup can be restored.
Setting up a Pixhawk
Below is a step by step of how PX4 is configured.
Note: Pressing the "apply and restart" button from the airframes selection resets the airframe even if you didn't change it and you have to start calibration over.
General Settings
-
Airframe: Generic Quadrotor X
-
Autopilot Orientation: ROTATION_ROLL_180
-
Accelerometer, Gyro, Mag calibration done as normal
-
Radio done as usual
-
Flight Mode: Kill-CH7, Offboard-CH6, Mode-CH9, FM1-Stab, FM2-Stab, FM6-Acro
Channel 9 is used for offboard because the Switch A (CH6) on the Taranis is finicky so it wouldn't always select flight modes properly.
Custom Arming Settings
The intent of these settings are to allow arming without the safety switch as that requires somebody to stick their arm into the drone and move arming and disarming to a switch. Disarming with the throttle+yaw combination takes too long to disarm and is a safety concern.
- CBRK_USB_CHK: 197848 - So that USB can be connected when Arming
- CBRK_IO_CHK: 197848 - So that the safety switch is not needed
- COM_RC_ARM_HYST: 30000 - Takes 30 seconds to arm with the throttle+yaw. Intent is to disable this mode of arming.
- RC_MAP_ARM_SW: CH5 - Use CH5 to arm and disarm the quadrotor
- RC_ARMSWITCH_TH: 0.25 - Default, threshold for arming with the switch.
Custom EKF settings
The magnetometer needs to be disabled since flight occurs in an indoor environment. The barometer also needs to be disabled.
- EKF2_MAG_TYPE: 3 - Disables magnetometer check this actually works in source code
- EKF2_HGT_MODE: 2 - enable range sensor Currently off because of V0.1
Mavros
Mavros installation instructions
Easy to copy and paste commands
sudo apt-get install ros-indigo-mavros &&
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh &&
chmod +x install_geographiclib_datasets.sh &&
sudo ./install_geographiclib_datasets.sh;
NEW Parameter Settings
- SYS_MC_EST_GROUP=1
- ATT_EXT_HDG_M=1
- uncheck "fuse baro" in LPE_FUSION
- LPE_VIS_XY and LPE_VIS_Z adjust for variance