Servers by jDrones

Questions for optical flow support on Bebop2


(Eric Dong) #1

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.

Regards,
Eric


(ppoirier) #2

@julienberaud are you still working on this ?


(julienberaud) #3

@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. https://github.com/Parrot-Developers/arduplane-disco-manifest
With this you can rebuild stuff for disco, which are compatible with the latest firmwares of Bebop2.


(Eric Dong) #4

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.

Regards,
Eric


(Eric Dong) #5

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 https://github.com/Parrot-Developers/libiio/tree/v0.5. What might be wrong here? Thank you.

Regards,
Eric


(Eric Dong) #6

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.

Regards,
Eric


(Alex) #7

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


(Eric Dong) #8

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.


(Alex) #9

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


(Eric Dong) #10

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

Regards,
Ericlibiio.a.zip (27.9 KB)


(Alex) #11

Thanks, really appreciate it!