Px4Flow for Indoor navigation in offboard mode and NO optitrack

I want to fly a quadrotor indoors and i DO NOT want to use Optitrack system.
I indend to just maintain the altitude indoors and pass in roll, pitch and yaw attitude commands to pixhawk.

Following is the system I have:

  1. Pixhawk1
  2. Optical Flow sensor Px4Flow
  3. Laser Range finder.

I have enabled the following parameters in the px4 firmware:

  1. EKF2_AID_MASK “Set to optical Flow”
  2. EKF2_HGT_MODE “Range Sensor”
  3. EKF2_RNG_AID “1 (Range aid enabled)”

When I try to test it with POSITION mode under these conditions, pixhawk rejects POSITION mode.
I am not sure if POSITION mode is the best for testing this setup manually. If this is not the correct approach, I will really appreciate if someone can help with pointing out the correct parameter setting for pixhawk.

Eventually, I want to test the drone in OFFBOARD mode. For OFFBOARD control, I use mavros. I have already tested the platform with the external vision system (optitrack mocap). And I was able to do the waypoint navigation, etc. in the offboard mode with MOCAP feedback. Now, I want to do it without MOCAP.

Thank you in advance.

@adipandas Optical flow will not be enough to estimate the position, as optical flow measurements are related to the velocity of the vehicle. The position estimate will tend to drift over time.

In order to get a good position estimate, you need to have a measurement that gives you the position of your system.

If you don’t want to use a beacon system such as Mocap, you can try adding a camera to your drone and try to estimate the postion of the vehicle with visual (intertial) odometry using projects such as ROVIO

1 Like

Thank you for the quick response.
I understand that it is not enough to integrate position from optical flow readings. I just want it to hold the constant altitude in OFFBOARD mode.

I initially actually followed this: https://github.com/PX4/Firmware/issues/10408#issue-356608841

I am unsure about @mhkabir reply for this issue though. For this fix, initially I thought of just rebuilding the whole code by replacing the Firmware/src/lib/ecl
I tried to build the code myself. But was not able to do it.