From 5237ccf590b3e83d8871366d6c77bcc35a328312 Mon Sep 17 00:00:00 2001 From: thomashamain Date: Mon, 17 Jun 2019 23:45:53 +0300 Subject: [PATCH] doc : optical_flow.md i'm affraid i did not translate correctly the part at line 92: the speed will be controlled such as Optical Flow "values"? do not exceed 50% of the "given parameter"? --- docs/en/optical_flow.md | 101 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 docs/en/optical_flow.md diff --git a/docs/en/optical_flow.md b/docs/en/optical_flow.md new file mode 100644 index 00000000..18f29c0e --- /dev/null +++ b/docs/en/optical_flow.md @@ -0,0 +1,101 @@ +# Use of Optical Flow + +Running the technology "Optical Flow" offers the possibility of POSCTL flight mode, and autonomous flight operating on a camera pointed downwards that detects changes of ground texture. + +## Enabling + +> **Hint** It is recommanded to use [special PX4 firmware for Clever](firmware.md#прошивка-для-клевера). + +The use of a rangefinder is essential. [Connect and setup laser-ranging sensor VL53L1X](laser.md), according to the manual. + +Enable Optical Flow in the file `~/catkin_ws/src/clever/clever/launch/clever.launch`: + +```xml + +``` + +Optical Flow publishes data in `mavros/px4flow/raw/send` topic. In the topic `optical_flow/debug` is also published a vizualization, that can be viewed with [web_video_server](web_video_server.md). + +> **Info** Correct connexion and [setup](camera.md) of the camera module is needed for proper functioning. + +## Setup of the flight controler + +When using **EKF2** (parameter `SYS_MC_EST_GROUP` = `ekf2`): + +* `EKF2_AID_MASK` – flag 'use optical flow' is on. +* `EKF2_OF_DELAY` – 0. +* `EKF2_OF_QMIN` – 10. +* `EKF2_OF_N_MIN` – 0.05. +* `EKF2_OF_N_MAX` - 0.2. +* `SENS_FLOW_ROT` – No rotation. +* `SENS_FLOW_MAXHGT` – 4.0 (for the rangefinder VL53L1X) +* `SENS_FLOW_MINHGT` – 0.01 (for the rangefinder VL53L1X) +* Optional: `EKF2_HGT_MODE` – range sensor (cf. [rangefinder setup](laser.md)). + +When using **LPE** (parameter `SYS_MC_EST_GROUP` = `local_position_estimator, attitude_estimator_q`): + +* `LPE_FUSION` – flags 'fuse optical flow' and 'flow gyro compensation' are on. +* `LPE_FLW_QMIN` – 10. +* `LPE_FLW_SCALE` – 1.0. +* `LPE_FLW_R` – 0.1. +* `LPE_FLW_RR` – 0.0. +* `SENS_FLOW_ROT` – No rotation. +* `SENS_FLOW_MAXHGT` – 4.0 (for the rangefinder VL53L1X) +* `SENS_FLOW_MINHGT` – 0.01 (for the rangefinder VL53L1X) +* Optional: `LPE_FUSION` – falg 'pub agl as lpos down' is on (сf. [rangefinder setup](laser.md). + +[The `selfcheck.py` utility](selfcheck.md) will help you verify that all settings are corectly set. + +## POSCTL flight + +Setup POSCTL to be one of PX4 flight modes and then select POSCTL. + +## Autonomous flight + +The module [simple_offboard](simple_offboard.mb) enables autonomous flight. + +Example of take off and leveling at 1.5m above the ground: + +```python +navigate(z=1.5, frame_id='body', auto_arm=True) +``` + +Flying forward for 1m: + +```python +navigate(x=1.5, frame_id='body') +``` + +[Navigation using ArUco-markers](aruco_marker) and [using VPE] are available when using Optical Flow. + +## Additional settings + + + +If the copter has an unstable position using VPE, try to increase the *P* coefficient of speed PID controler - parameters are `MPC_XY_VEL_P` and `MPC_Z_VEL_P`. + +If the copter has an unstable height, try increasing `MPC_Z_VEL_P` coefficient or getting better hover throttle - `MPC_THR_HOVER`. + +If the copter is consistently yawing, try: + +* recalibrate gyroscopes; +* recalibrate magnetometer; +* different values for `EKF2_MAG_TYPE` parameter, that indicates how data from the magnetometer is used in EKF2; +* changing values of `EKF2_MAG_NOISE`, `EKF2_GYR_NOISE`, `EKF2_GYR_B_NOISE` parameters. + +If the copter's height is deviating, try: + +* increasing the value of `MPC_Z_VEL_P` coefficient; +* change the value of `MPC_THR_HOVER` parameter; +* add `MPC_ALT_MODE` = 2 (Terrain following). + +When using Optical Flow, the maximal horizontal speed is farther limited. This is an indirect influence of the parameter `SENS_FLOW_MAXR` (maximal reliable "angular speed" of the optical flow). In normal flight mode, the speed will be controlled such as Optical Flow values do not exceed 50% of the given parameter. + +## Errors + +If errors of `EKF INTERNAL CHECKS` occur, try to restart EKF2. To do so, enter in the MAVLink-console : в MAVLink-консоли: + +```nsh +ekf2 stop +ekf2 start +``` \ No newline at end of file