Developing forward facing optical flow in sitl

Hi all, I would like to develop a simulation in px4 using optical flow sensor which is facing forward in order to do some tracking of front images of the UAV. However, when I rotate the camera to face forward, px4 is not able to takeoff.

When I use the command: commander takeoff, it shows the error:
error message: WARN [commander] rejecting takeoff, no position lock yet. Please retry…


maybe someone can answer your question if you clarify:

  • which simulation you use
  • what kind of optical flow you use

Usually, optical flow is acquired from a downwards-facing camera for numerous reasons like approximate ground flatness.
If you want to use a SLAM/odometry-like localization, you could look into

Good luck!

Hi! Thanks for the reply!

I was using posix gazebo iris_opt_flow model for simulation.
The optical flow I was using was lidar and px4flow camera, available in px4 database.