Firefly Eindhoven - Localization - Verax

From Control Systems Technology Group
Jump to navigation Jump to search

Working principle

1) Hardware system: LEDs, fisheye camera, jetson, find LEDs 2) Describe general PnP problem: locate camera with n camera points

3) Introduction to the OPnP algorithm and general steps, including step to Groebner basis solver

Implementation

Since a regular implementation on either the GPU or CPU of the MATLAB code by making use of MATLAB's embedded C/GPU coder does not meet the performance requirements, the software has to be ported to a lower level language that makes use of GPU accelerated libraries to fully utilize the Jetsons hardware. Since Rogier lacked the expertise to port the code and did not have time to fully look into this, Daan and Johan were tasked with porting the MATLAB code and achieve an update rate of approximately 30 Hz.

Linear algebra

The automatically generated OPnP algorithm (thus an implementation of the Groebner basis solver) has two main function calls that limit its performance:

  • The solving of a linear system [math]\displaystyle{ Ax = b }[/math] with dimensions of A (

Parts that are required for the Groebner basis solver: matrix inversion/solving linear system and eigenvector solver

Software

This section describes the different software approaches we tried to increase the performance of the algorithm on the Jetson in chronological order.

  1. GPU coder. Rogier requested a trial of the experimental Matlab GPU Coder to generate CUDA code from the matlab implementation. The resulting performance was terrible, most likely due to the fact that the GPU Coder is not yet very well optimized and that some parts of the code that are more efficient to run on the CPU. Unfortunately the resulting code was also very messy and we could not reuse parts of it.
  2. C coder. We used Matlab's CPU coder to generate C code instead from the matlab implementation. This outperformed the GPU implementation even though the GPU of the Jetson is significantly more powerful than the CPU, but it was still far from optimal as we were not using the GPU at all and only a single CPU core.
  3. CUSolver for solving the linear system.
  4. Paper with CUDA pseudocode
  5. Armadillo with MAGMA