zhanghaijason
OK here are the steps to enable PMW3901 on MindPX/Mindracer, pretty simple actually.
Assume you have cloned PX4 master source code into your local.
Step 1
Locate file "boards/airmind/mindpx-v2/src/board_config.h", use any text editor to find the line:
#define PX4_SPI_BUS_BARO PX4_SPI_BUS_SENSORS
and add the below line right under it:
#define PX4_SPI_BUS_EXTERNAL PX4_SPI_BUS_EXT
then find the line:
#define PX4_SPIDEV_EXT0 PX4_MK_SPI_SEL(PX4_SPI_BUS_EXT, 1)
and add this line right under it:
#define PX4_SPIDEV_EXTERNAL PX4_SPIDEV_EXT0
Step 2
Locate file "boards/airmind/mindpx-v2/default.cmake", find the line:
optical_flow/px4flow
comment out this line by add '#' at the beginning of it:
#optical_flow/px4flow
then find the line before:
#optical_flow
enable this line by remove the '#' at the beginning:
optical_flow
Step 3
Compile and upload the new firmware:
make airmind_mindpx-v2_default upload
Connect pmw3901 and connect the mindracer to QGC.
Enable EKF2_AID_MASK, and SENS_EN_PMW3901 parameter in QGC and reboot.
If everything are executed correctly, You should be able to see optical flow in MAVLink inspector now.