Setup Instructions
Mounting
Below is the recommended mounting orientation. The connectors on the board should point towards the back of the vehicle with the sensors facing downwards.
The above mounting is the default value (0) of the parameter SENS_FLOW_ROT. If you want to mount in a different orientation, change this parameter accordingly.
PX4 Configuration
Agam FloRange Sensor is a CAN based device. The CAN device needs to be powered for certain parameters to show up. So, the recommended way is to power the device through USB port from Autopilot or external battery and then open QGroundControl.
Enable the UAVCAN driver by setting parameter UAVCAN_ENABLE to
2
for dynamic node allocation (or3
if using DroneCAN ESCs)Connect Agam Florange Sensor to CAN port
Set the following parameters
Enable EKF2_OF_CTRL
To optionally disable GPS aiding, set EKF2_GPS_CTRL to
0
Set EKF2_RNG_CTRL to Enable(Conditional mode). This enables the range finder to be used during low speed (< EKF2_RNG_A_VMAX) and low altitude (< EKF2_RNG_A_HMAX) operation, eg takeoff and landing, where baro interference from rotor wash is excessive and can corrupt EKF state estimates. It is intended to be used where a vertical takeoff and landing is performed, and horizontal flight does not occur until above EKF2_RNG_A_HMAX.
Enable UAVCAN_SUB_FLOW
Enable UAVCAN_SUB_RNG
Set UAVCAN_RNG_MIN to
0.08
(minimum range is 80mm)Set UAVCAN_RNG_MAX to
30
(max range is 30m)Set EKF2_RNG_A_HMAX to
10
Set EKF2_RNG_QLTY_T to
0.2
Set SENS_FLOW_MINHGT to
0.1
Set SENS_FLOW_MAXHGT to
30
Set SENS_FLOW_MAXR to
7.4
to match the PAW3902 maximum angular flow rateThe sensor can be mounted anywhere on the frame, but you will need to specify the focal point position, relative to the vehicle's center of gravity, during PX4 configuration. The below parameters can be set to account for the offset of the Agam FloRange Sensor from the vehicle center of gravity.
When optical flow is the only source of horizontal position/velocity, then lowering the gain for controller response to horizontal position error MPC_XY_P (e.g. to 0.5) is recommended to reduce oscillations.
Reboot
After connecting the sensor to the autopilot, connect the autopilot using QGroundControl. Open the MAVLink Inspector screen for DISTANCE_SENSOR. If the sensor is OK, you can see that the current_distance number is non-zero.


Refer the latest PX4 Optical Flow sensor setup in the link below:
https://docs.px4.io/main/en/sensor/optical_flow.html
Ardupilot Configuration
Connect Agam Florange to CAN port. Set the following parameters:
Set FLOW_TYPE = 6
Set CAN_P1_DRIVER = 1
Set CAN_D1_PROTOCOL = 1
To use the onboard lidar:
Set RNGFND1_TYPE = 24
Set RNGFND1_MAX = 3000
EK3_SRC_OPTIONS = 0
EK3_FLOW_DELAY
EK3_SRC1_POSXY = 0 (use optical flow)
EK3_SRC1_VELXY = 5
EK3_SRC1_POSZ = 1
EK3_SRC1_VELZ = 0
EK3_SRC1_YAW = 1
The sensor can be mounted anywhere on the frame, but you will need to specify the focal point position, relative to the vehicle's center of gravity, during PX4 configuration. The below parameters can be set to account for the offset of the Agam FloRange Sensor from the vehicle center of gravity.
FLOW_POS_X, FLOW_POS_Y, FLOW_POS_Z
Last updated