(25) (25.5) OpenMV for optical flow

Article directory

Preface

25.5.1 Where to buy

25.5.2 Connecting to the autopilot

25.5.3 Camera settings

25.5.4 Additional instructions

25.5.5 Testing and Setup

25.5.6 Parameter description


Preface

OpenMV camera is a programmable camera that supports optical flow .


25.5.1 Where to buy

Sensors can be purchased directly from openmv.io .

25.5.2 Connecting to the autopilot

1. The camera should be installed on the bottom of the rotorcraft with the lens facing downwards. The edge of the camera with the lens should face the front of the aircraft. The picture above is incorrect because the autopilot arrow is pointing down and the sensor lens is near the top.

2. Connect the camera's P4 , VIN and GND pins to one of the autopilot 's serial ports as shown in the picture above. In the picture above, the sensor is connected to the Pixhawk 's Telem2 port.

3. Set FLOW_TYPE = 5 ( MAVLink ).

4. If using Serial2/Telem2 , set SERIAL2_PROTOCOL = 1 ( MAVLink ); if connecting to other serial ports, use the corresponding SERIALx_PROTOCOL parameter.

5. Set SERIAL2_BAUD = 115 .

Note

The official pinout for the camera can be found here .

25.5.3 Camera settings

Official setup information can be found here , but a short list is as follows:

1. Connect the OpenMV camera to the computer. On a Windows system, the camera should appear as a new COM port and a virtual drive should be created (the script will be copied to this).

2. Download, install and run the OpenMV IDE.

3. Select File, Example, 18-MAVLink , mavlink_opticalflow.py .

4. In the lower right corner, select the drive corresponding to the OpenMV camera virtual drive.

5. Select " Tools " to save the opened script to the OpenMV camera.

6. Select the tool to reset the OpenMV camera.

7. The green light on the camera should start flashing, indicating that the script is running.

25.5.4 Additional instructions

As with the PX4Flow sensor , using this sensor's autonomous modes (including Loiter and RTL ) requires a rangefinder.

FlowHold does not require the use of a rangefinder.

The sensor has been successfully tested at a height of approximately 10m .

Performance can be improved by setting sensors position parameters . For example, if the sensor is mounted 2cm forward and 5cm down from the frame's center of rotation , set FLOW_POS_X to 0.02 and FLOW_POS_Z to 0.05 .

25.5.5 Testing and Setup

For setup guidelines, see Optical Flow Sensor Testing and Setup .

Please note that the recommended EK2_FLOW_DELAY or EK3_FLOW_DELAY value for this sensor is 80 .

25.5.6 Parameter description

1. FLOW_POS_X : X position offset

Note: This parameter is for advanced users.

The optical flow sensor focus is at the X position in the subject frame . Positive X is in front of the origin.

Increment

Range

Units

0.01

-5 to 5

meters

2. FLOW_POS_Z : Z position offset

Note: This parameter is for advanced users.

The optical flow sensor focus is at the Z position in the subject frame . Positive Z means downward from the origin.

Increment

Range

Units

0.01

-5 to 5

meters

Guess you like

Origin blog.csdn.net/qq_20016593/article/details/133126518