PX4光流
PX4FlOW 光流智能相机
PX4FLOW 是一款 光流 智能相机。 它的自然分辨率为 752 x 480 像素,并在400赫兹下计算4倍剪切区域的光流,使其具有很高的光敏度。
与许多鼠标传感器不同的是,它也可以在室内和室外光线较弱的条件下工作,并且不需要额外的LED照明。 它可以自由地二次开发,执行任何其它基本的、有效的低级计算机视觉任务。
168 MHz Cortex M4F CPU (128 + 64 KB RAM)
752x480 MT9V034 image sensor, L3GD20 3D Gyro
16 mm M12 lens (IR block filter)
Size 45.5 mm x 35mm
Power consumption 115mA / 5V
购买渠道
通过以下途径购买模块:
Unmanned Tech (UK)
Holybro (Germany & EU)
产品规格
MT9V034 machine vision CMOS sensor with global shutter
Optical flow processing at 4x4 binned image at 400 Hz
Superior light sensitivity with 24x24 μm super-pixels
Onboard 16bit gyroscope up to 2000°/s and 780 Hz update rate, default high precision-mode at 500°/s
Onboard sonar input and mount for Maxbotix sonar sensors. (HRLV-EZ4 recommended, SparkFun Product Link)
USB bootloader
USB serial up to 921600 baud (including live camera view with QGroundControl)
USB power option
Does fit the MatrixVision Bluefox MV mounting holes (camera center off-centered)
Pixhawk设置
In order to use the PX4Flow board, connect it to the I2C bus (on any Pixhawk series controller) and enable the driver using SENS_EN_PX4FLOW.
PX4FLOW does not work on FMUv5 (Pixhawk 4) for PX4 versions less than 1.9.0. All other PX4/PX4-Autopilot versions should work.
The steps are:
In QGroundControl:
Update the firmware on PX4Flow (in the top left menu, click on CONFIG, then on Firmware Upgrade)
Set the parameter SENS_EN_PX4FLOW and reboot (see Parameters for information on finding and setting parameters).
Connect PX4Flow I2C to the Pixhawk I2C
Once enabled, the module will be detected on boot. Flow data should be coming through at 10Hz if the autopilot is connected via USB. Flow data is transmitted over wireless channels at a lower rate.
Mounting/Orientation
The recommended mounting orientation is defined as Y on flow board pointing towards front of vehicle, as shown in the following picture.
On PX4, the orientation should be set using the parameter SENS_FLOW_ROT. The above orientation maps to SENS_FLOW_ROT=270 degrees (the default).
Make sure the PX4Flow board is well dampened.
PX4Flow emits a significant amount of electromagnetic radiation, and should be placed as far away from other electronics (in particular GPS modules) as possible (see Hardware/issues/8 for more information).
PX4 配置
The PX4Flow parameters that you may need to configure are listed below.
If you're using flow with the ECL/EFK2 estimator you will also need to set the Optical Flow > Estimators > EKF2 parameters. These enable fusing optical flow measurements for velocity calculation and also allow you to define offsets if the sensor is not centred within the vehicle.
Connecting
The PX4flow is connected to the I2C bus. If you are connecting multiple devices to the same bus you will need to set each with a unique address. The next section explains how.
PX4FLOW I2C Device address
The default I2C address of the PX4Flow is 0x42, but it can be incremented using the three solder jumpers labeled "I2C BUS ADDR". This is useful if another device has the same address.
The address increment is equal to the 3-bit value encoded by the jumpers. For example if jumper 0 and 1 are soldered and jumper 2 is unsoldered, the address is incremented by 11 + 12 + 0*4 = 3, which gives address 0x45. If all jumpers are unsoldered, the camera will be automatically discovered by the autopilot firmware.
The address range for the 8 possible choices is: 0x42 - 0x49.
There are different I2C readouts available. Details about the I2C frame and the I2C integral frame are in the driver source code.
If you modify the I2C address of the PX4Flow, make sure to start the PX4 driver with the correct address:
Focusing the Lens
In order to ensure good optical flow quality, it is important to focus the camera on the PX4Flow to the desired height of flight. To focus the camera, put an object with text on (e. g. a book) and plug in the PX4Flow into USB and run QGroundControl. Under the settings menu, select the PX4Flow and you should see a camera image. Focus the lens by unscrewing the set screw and loosening and tightening the lens to find where it is in focus.
Figure: Use a text book to focus the flow camera at the height you want to fly, typically 1-3 meters. Above 3 meters the camera should be focused at infinity and work for all higher altitudes.
Figure: The QGroundControl px4flow interface that can be used for focusing the camera
Accuracy
The ortho photo below shows that a flight on the park roads is accurately measured. This was done with a PX4FMU on a 7" quad flying at about 1.6 m altitude in manual flight. No GPS, only PX4FLOW integration of position.
Downloads
Manual and Schematics
Documentation in hardware repo: PX4/Hardware/FLOWv1
USB Driver
Linux and MacOS come with the required drivers. Windows drivers can be downloaded from: px4flow_win_drivers.zip
Papers
The flow module as been accepted as paper to the International Conference on Robotics and Automation (ICRA 2013) in Karlsruhe, Germany.
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
Libraries
The following are third party libraries that can be used to integrate the flow module in your projects.
mavros: A general MAVLink ROS interface, maintained by Vladimir Ermakov
[px-ros-pkg]](https://github.com/cvg/px-ros-pkg): A PX4FLOW ROS (Robot Operating System) interface, maintained by Lionel Heng (hengli@inf.ethz.ch).
arduino-px4flow-i2c: An Arduino library wrapping the I2C interface, maintained by Laurent Eschenauer (laurent@eschenauer.be).
连接器
USART2 (J2): Hirose DF13 6 pos (Digi-Key Link: DF13A-6P-1.25H(20))
Mates: Hirose DF13 6 pos housing (Digi-Key Link: Hirose DF13-6S-1.25C)
USART3 (J1): Hirose DF13 6 pos (Digi-Key Link: DF13A-6P-1.25H(20))
Mates: Hirose DF13 6 pos housing (Digi-Key Link: Hirose DF13-6S-1.25C)
I2C1 (J3): Hirose DF13 4 pos (Digi-Key Link: DF13A-4P-1.25H(20))
Mates: Hirose DF13 4 pos housing (Digi-Key Link: Hirose DF13-4S-1.25C)
USB (J5): Micro USB-B
Mates: Cell phone data / charger cables, e.g. Digi-Key Link: ASSMANN AK67421-0.5-R
ARM MINI JTAG (J6, //not populated per default//): 1.27 mm 10pos header (SHROUDED, for Black Magic Probe: Samtec FTSH-105-01-F-DV-K or (untested) or Harwin M50-3600542 (Digikey or Mouser)
JTAG Adapter Option #1: BlackMagic Probe. Note, may come without cables (check with vendor). If so, needs the Samtec FFSD-05-D-06.00-01-N cable (Samtec sample service or Digi-Key Link: SAM8218-ND) and a Mini-USB cable
JTAG Adapter Option #2: Digi-Key Link: ST-LINK/V2 / ST USER MANUAL, needs an ARM Mini JTAG to 20pos adapter: Digi-Key Link: 726-1193-ND
JTAG Adapter Option #3: SparkFun Link: Olimex ARM-TINY or any other OpenOCD-compatible ARM Cortex JTAG adapter, needs an ARM Mini JTAG to 20pos adapter: Digi-Key Link: 726-1193-ND
Optics
The correct optics are delivered by 3D Robotics already mounted and focused.
16 mm M12 (S-mount) lens (with IR-cut filter)
The focal length influences the maximum measurable velocity.
The internal update rate is 400 Hz.
pixelsize is 24 micro meters, a 16mm lens has therefore a focal length of 0.016 meter / 24 micro meter per pixel = 666.666 pixels
Max velocities for different focal length lenses and ground distances:
Configuration: Image Quality and Output
PX4FLOW is not designed as a camera, but does all processing on-chip. You can configure the image quality and output (the image output is only intended for focusing the lens).
General Troubleshooting
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)
PX4FLOW Developer Guide
硬件连接
PX4FLOW Board v1.3
HRLV-MaxSonar-EZ (MB1043)
16mm Lens
Micro USB cable
Software / Build Source
PC with QGroundControl installed
PX4FLOW Firmware (Firmware source code on Github: PX4/Flow)
编译
Install the PX4 toolchain. Then and clone the sources from https://github.com/PX4/Flow using git.
Then connect the flow sensor. It should show these steps on a successful upload:
故障处理
In case one doesn't see the aforementioned steps, the modem-manager should be removed by:
User also needs to be in the plugdev group:
Focus Image
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.
Data Output
The PX4FLOW module outputs MAVLink packets on USB and serial port. Use QGroundControl to read data from the module. An I2C interface for sensor data reading is offered as well. Third party libraries are available to connect and integrate PX4FLOW data in your projects.
USART3: MAVLink at 115200, 8N1 baud: OPTICAL_FLOW message, OPTICAL_FLOW_RAD, HEARTBEAT message
USB: Baud rate is not relevant (USB ignores it):
OPTICAL_FLOW
message,OPTICAL_FLOW_RAD
,HEARTBEAT
message, image.I2C1: latest Flow value (i2c_frame) and accumulated Flow (i2c_integral_frame) values since last I2C readout available for readout.
PX4FLOW Parameters
The following list gives a short explanation of the current available parameters in the PX4FLOW firmware.
Parameters are currently not written to ROM (they reset at power loss). To change them permanently build your own version of firmware using instructions in the PX4FLOW Developer Guide above. Relevant parameters can be found here.
BFLOW_F_THRD
This parameter is a feature threshold 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_THRD
This is a pattern correlation threshold for filtering bad matches. Lower means only strong correlations are accepted.
Others
模式
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.
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.
Last updated