Table of Contents
PX4FLOW Developer Guide
- PX4FLOW Board v1.3
- HRLV-MaxSonar-EZ (MB1043)
- 16mm Lens
- Micro USB cable
Dominik Honegger, Lorenz Meier, Petri Tanskanen and Marc Pollefeys. An Open Source and Open Hardware Embedded Metric Optical Flow CMOS Camera for Indoor and Outdoor Applications, ICRA2013 (Full version)
Software / Build Source
- PC with QGroundcontrol v1.0.9 (beta) installed
- Recent PX4FLOW Firmware
cd flow make all make upload-usb
Then connect the flow sensor. It should show these steps on a successful upload:
Found board 6,0 bootloader rev 3 on /dev/ttyACM1 erase... program... verify... done, rebooting.
In case one doesn't see the aforementioned steps, the modem-manager should be removed by:
sudo apt-get remove modemmanager
User also needs to be in the plugdev group:
sudo usermod -a -G plugdev $USER
Connect PX4FLOW to QGroundcontrol:
- Connect PX4FLOW sensor over USB to PC
- Open QGroundcontrol
- Switch to Plot perspective: Perspectives/Plot
- Connect to PX4FLOW sensor: Communication/Add Link
- Link Type: Serial
- Protocol: MAVLink
- Serial Port: corresponding Port (e.g. /dev/ttyACM* or COMM*)
Now a new Unmanned System should appear and Onboard Parameters are loaded (click on “Get” if not)
Change Parameter VIDEO_ONLY to 1 and press Set.
The Widget Video Downlink shows now the Image in full resolution. Focus the lens on 1.5m. Fix the lens position and switch VIDEO_ONLY Mode off.
The PX4FLOW module outputs MAVLink packets on USB and serial port. Use QGroundControl to read data from the module.
This parameter is a feature threashold and limits the quality of patterns that are used to calculate the bottom flow. For low values (e.g. 10) almost every pattern is taken, for higher values (e.g. 100) only significant patters are taken.
This is a pattern correlation threashold for filtering bad matches. Lower means only strong correlations are accepted.
The following list gives a short explanation of the current available parameters in the PX4FLOW firmware.
|BFLOW_F_THLD||30||RW||This parameter is a feature threashold and limits the quality of patterns that are used to calculate the bottom flow. For low values (e.g. 10) almost every pattern is taken, for higher values (e.g. 100) only significant patters are taken.|
|BFLOW_V_THLD||5000||RW||This is a pattern correlation threashold for filtering bad matches. Lower means only strong correlations are accepted.|
|BFLOW_HIST_FIL||0||RW||1: Flow histogram filter is ON, 0: OFF|
|BFLOW_GYRO_COM||1||RW||1: Gyro compensation is ON, 0: OFF|
|BFLOW_LP_FIL||0||RW||1: Lowpass filter on flow output is ON, 0: OFF|
|BFLOW_W_NEW||0.3||RW||Flow lowpass filter gain|
|DEBUG||1||RW||1: Debug messages ON, 0: OFF|
|GYRO_SENS_DPS||250||RW||Gyroscope sensitivity: 250, 500, 2000 (dps)|
|GYRO_COMP_THR||0.01||RW||Gyro compensation threshold (dps): Gyro data lower than this threshold is not compensated to prevent drift|
|IMAGE_WIDTH||64||R||Image width (pixels)|
|IMAGE_HEIGHT||64||R||Image height (pixels)|
|IMAGE_L_LIGHT||0||RW||1: Image sensor low light mode ON, 0: OFF|
|IMAGE_NOISE_C||1||RW||1: Image sensor noise correction ON, 0: OFF|
|IMAGE_TEST_PAT||0||RW||1: Gray-shaded test pattern mode ON, 0: OFF|
|LENS_FOCAL_LEN||16||RW||Focal length of lens (mm)|
|POSITION||0||RW||0: Only position 0 is used (Bottom: 0, Front: 1, Top: 2, Back: 3, Right: 4, Left: 5)|
|SONAR_FILTERED||0||RW||1: Kalman filter on sonar output is ON, 0: OFF|
|SONAR_KAL_L1||0.8461||RW||Sonar Kalman gain L1|
|SONAR_KAL_L2||6.2034||RW||Sonar Kalman gain L2|
|SYS_ID||81||RW||MAVLink System ID|
|SYS_COMP_ID||50||RW||MAVLink Component ID|
|SYS_SENSOR_ID||77||RW||MAVLink Sensor ID|
|SYS_TYPE||0||RW||MAVLink System Type|
|SYS_AP_TYPE||1||RW||MAVLink Autopilot Type|
|SYS_SEND_STATE||1||RW||1: Send MAVLink Heartbeat, 0: Not|
|USART_2_BAUD||115200||R||Baudrate USART 2|
|USART_3_BAUD||115200||R||Baudrate USART 3 (Data Output)|
|USB_SEND_VIDEO||1||RW||1: Send video over USB, 0: Not|
|USB_SEND_FLOW||1||RW||1: Send flow over USB, 0: Not|
|USB_SEND_GYRO||1||RW||1: Send gyro data over USB, 0: Not|
|USB_SEND_FWD||0||RW||1: Send forwarded flow over USB, 0: Not|
|USB_SEND_DEBUG||1||RW||1: Send debug msgs over USB, 0: Not|
|VIDEO_RATE||150||RW||Time in milliseconds between images of video transmission|
|VIDEO_ONLY||0||RW||1: High resolution video mode is ON, 0: OFF|
VIDEO ONLY Mode
Set VIDEO_ONLY to 1 for high resolution mode. In this mode the camera image is transmitted at a higher resolution to ease the lens focus process. No flow values are calculated in this mode.
Low Light Mode
If IMAGE_L_LIGHT is set to 1, the sensor operates in low light mode.
Test Pattern Mode
If the parameter IMAGE_TEST_PAT is set to 1, the sensor inserts a vertical gray-shaded test pattern in the signal chain.
- Test Pattern 64×64 (VIDEO ONLY Mode is OFF)
- Test Pattern 376×240 (VIDEO ONLY Mode is ON)
- Unplug the flow sensor if plugged
- Start QGroundControl, select the PX4 startup mode go to Config → Firmware Upgrade.
- Click on SCAN (green button in the center)
- Connect the flow sensor now
- Flash the stable firmware
- Click on Advanced Config in the left menu to see the parameters
- Display the video stream with QGroundControl (Tool Widgets → Video Downlink)
- Check that there are no stripes on the stream. If you get stripes, set IMAGE_TEST_PAT to 1. It should look like the examples above. If you have stripes in the image but no stripes when this mode is enabled, right-click into the image once in both modes and save and send an image of each mode to the manufacturer's support team.
- Check that you get a clear image (its a tele / zoom lens, so the visible area will be small)
- Set the VIDEO_ONLY parameter to 1 to obtain a higher resolution image.
- Check that the image is sharp at the operating distance (the typical flight altitude)
- Please check the mailing list in case you have a similar distorted image with visible dark lines: