Development setup for Persee on Linux

To share my experiences: I’ve tried to set up a cross-compile environment on my Ubuntu 16.04 box. Cross-compiling basics work, but when you throw ROS in the mix it becomes a huge mess.

We don’t use graphical IDE’s, we use VIM which works equally well on the Persee. Compilation can take a long time, so cross-compilation would be a huge advantage.

The basic cross compilation toolchain requires you to have the full requirements for the target architecture. Where apt supports multiple architectures, the ROS system does not - it installs itself in /opt/ros/kinetic and will conflict with the same packages for a different architecture.

I attempted to solve this by creating a chroot environment with the amrhf architecture, using qemu and debootstrap. This does work nicely, and I ended up with a fully working cross compiler. HOWEVER, the performance of the armhf emulation is extremely inefficient. It turned out I am much better off compiling our code on the Persee itself then to build it in the chroot.

The main reason for this, I suppose, is that the chroot’s compiler also uses the armhf architecture, that is emulated using qemu. Since I’m running it on a powerful AMD64-laptop, I tried to shove in the arm-linux-gnuabihf-gcc compiler instead. It seems that the chroot will not run amd64 binaries anymore unless they are statically linked.

In terms of simplicity, the cross-compile chroot is rather easy to set up, so I’m still considering building a native AMD64 statically linked armhf compiler myself to use within the container.

Anyway, basic cross-compiling doesn’t seem like a big issue, but the more dependencies you add in (e.g. openni), the harder it gets. It would be great if Orbbec could release a basic cross compilation toolkit!

1 Like