Questions for optical flow support on Bebop2

Hello everyone, may I know if the optical flow support on Bebop2 is verified to be working?

As I checked the source code, found that the sonar reading function needs the libiio library, which needs separate cross compilation to link against the ArduPilot project. But I am now having trouble to cross compile a simple helloworld to run on the Bebop2 target. Guess it is a toolchain problem and I am using the armhf toolchain. Appreciate any kind suggestions on this.


@julienberaud are you still working on this ?

@ppoirier From time to time, on my spare time. So in order to be able to build for bebop2 it needs to have a recent firmware (upgrade it from freeflight), then it should be compatible with armhf. @Eric_Dong what do you mean by “having trouble to cross-compile a simple hello world” ?
For libiio, I can take a look at giving you a version that works on bebop2. You may take a look at the disco open source builder directory on Parrot Dev github. Disco and Bebop are equivalent in terms of build and processor.
With this you can rebuild stuff for disco, which are compatible with the latest firmwares of Bebop2.

1 Like

Thank you @ppoirier and @julienberaud.

Hi Julien, for the simple hello world, I was planning to test the armhf toolchain compilation to compile the packages like libiio and lttng used on Bebop2. Just don’t quite understand why the helloworld does not work, though it uses the same toolchain as the ArduPilot build. The libc version comes with the armhf toolchain is not compatible with the bebop2 onboard Linux? But ArduPilot can compile and run without any problems on Bebop2 with the same toolchain.

Do appreciate if you can point out a version of libiio that can work with Bebop2 firmware.


Hello @julienberaud, after static compilation, the simple hello world can run on Bebop2. I also managed to cross compile the libiio and libxml2 and link statically with ardupilot. Then set the RNGFND_TYPE=9 to use Bebop range finder. However, the program got crashed and further debugging found in the function “AP_RangeFinder_Bebop::_configure_capture”, where iio_create_local_context() failed.
The libiio is from What might be wrong here? Thank you.


Hello, I recompile the libiio package “WITH_LOCAL_BACKEND” support, then the iio worked like a charm to configure and read from the range finder from Bebop2. Thanks.


@Eric_Dong, did you compile the iio on a Linux machine?
Can you post the exact commands how did you do it?

Hello, Alex.
Basically you need to download the cross tool chain for Bebop, then cross compile libz, LibXml2 and libiio. I can pass you the libiio.a. Then you link statically to ardupilot and should work.

Thank you, libiio.a would be highly appreciated.
I knew the rough work-flow, just became stuck with the correct cmake commands setups.

Hello, attached the libiio.a. Hope it works.

Regards, (27.9 KB)

Thanks, really appreciate it!


Hi~ Eric,
I want to enable Bebop2 sonar,
I have compile libiio, than I try to put libiio.a-> /data/ftp/internal_000/ardupilot/
and set mission planner rngfnd_type : 9 Bebop
But can’t read the value of sonar …
can you tell me how to do it ,Thanks~