Offboard position control using only optical flow and pixhawk 6x

Hi all,

I’m working on a project that requires me to use offboard control for a quadcopter indoors, and the only sensors I have available are an ARKFLOW sensor and the sensors included inside of a Pixhawk 6X. For my project, I would like to send position commands via ROS2, and I have tested this so far by starting up ROS2 on the drone and echoing the local position topic as I move it around. Whenever I do this, I see that the z-coordinate is changing based on the reading obtained from the ARKFLOW range finder; however, the x and y coordinates only change as the drone is moving, and soon reset to near 0 once I stop moving it. Are there any parameters that I can change on QGroundControl so that I can use the optical flow to also obtain horizontal position estimates?

edit: after looking through the forum and seeing posts asking similar questions, it seems like an optical flow sensor isn’t enough to use position control offboard. In that case, can I still do velocity control by publishing a TrajectorySetpoint message with only the velocity field filled out?