Optical flow behaving badly indoors (possible rangefinder issue?)

I’m trying to fly a quadcopter autonomusly indoors using a optical flow sensor, but I’m getting quite erratic results trying to fly in Loiter. I’ve followed the guide from the docs, and I seem to get good data from the flow sensor when I’m flying in AltHold. I’m not sure the copter is using the sonar data though, flying over tables I expect the drone to gain height but it does not. Take off is heavily affected by ground effect, I’m seeing a lot of bouncing and altitude drift. I know sonar is supposed to be bad, but this is on a hardwood floor, surely it should work fine?

5 2000-01-03 16-49-30.bin (572.5 KB)

This log is of my latest flight where I ran into issues. The drone started off having a hard time initially getting off the ground, after which it drifted wildly before I got it to land. Once on the ground it started spinning up once again (throttle is at minimum at this point), and once I got my foot on the copter, the motors started spinning at high RPM until I got to the safety switch.

4 2000-01-03 16-41-16.bin (1.0 MB)

For reference, here’s a log of me flying in AltHold, working pretty well, quite stable aside from drifting a bit in both altitude and position.

What’s going on?

No, it isn’t. It’s written in the PX4Flow page that you need a separate rangefinder: PX4FLOW Optical Flow Camera Board — Copter documentation

Is it possible to enable it somehow? I’m flying in a quite sonar friendly environment.

Not with current code, but it is possible to do development to use it.

Seems like a reason as good as any to get into the code base. Thanks for the help dude!

You could check out this tutorial. Go to section “Using the Sonar on PX4FLOW as RangeFinder”

Nice man, this is exactly what I need! Thanks a ton!

Hello!, I’m new to the arducopter and I’m working on a project where I have to control a quadcopter but I wan wondering how are you sending orders to the drone cos my Idea right now was to hack a controller to be controlled by a computer but if there is a way to send orders directly to the quadcopter instead of using a control as a bridge would be faster, Is it possible to use live mavlink commands or is there something else that I should be doing?

Thanks in advance for your time.

You can set RC overrides to give fake controller input, no need to hack a

The better way is to use the global move commands, I can’t remember right
now but peruse the mavlink docs and you’ll find them. These commands assume
that you’ve set up your state estimation correctly though, so double check
that beforehand!

1 Like

Hey guys,

i am currently working on a similar project, flying a copter indoors with pixflow. The copter is supposed to fly in a factory hall with lots of obstacles like machines. I don´t want the copter gaining and loosing height while flying over obstacles, the height is supposed to be controlled manually. Is it possible to use the pixflow module with only the camera ?

As far as I know, PX4Flow’s sonar is not used for altitude control in the standard configuration, but only used for flow calculations