Pseudo-Inverse calculation for high-dimensional rectangular matrices in PX4 sitl

Hi everyone,

I am working on optimal control for transition flight of a tailsitter aircraft, which involves generating large matrices. The dimensions of these matrices depend on the number of node points used to represent the trajectory.
While performing pseudo-inverse of these matrices, I found that I can only compute the inverse for square matrices with a dimension of 24 or less. In case of larger matrices, the code compiles correctly, but crashes at the inverse calculation line in the code.
Here is the error message I got:

Connection closed by client.
/home/shubh/testing_orig/PX4-Autopilot/Tools/sitl_run.sh: line 229: 192660 Segmentation fault (core dumped) “/home/shubh/testing_orig/PX4-Autopilot/build/px4_sitl_default/bin/px4” “/home/shubh/testing_orig/PX4-Autopilot/build/px4_sitl_default”/etc -s etc/init.d-posix/rcS -t “/home/shubh/testing_orig/PX4-Autopilot”/test_data

I have also tried adding Eigen library to calculate the inverse, but the issue persists. It looks like a memory limitation.

  1. Is there any parameter that constraints the size of the matrix for inverse calculation?
  2. How can I compute the inverse/pseudo-inverse of high-dimensional matrix?

Any help would be much appreciated!