nasa-jpl/fastcat

FTS: Potential bug in signal extraction logic

alex-brinkman opened this issue · 1 comments

For N!=M in the NxM calibration matrix, there appears to be a bug in the code for the signal extraction.

The number of signals(M) can exceed N=(FC_FTS_N_DIMS=6). In the following logic the UpdateSignal() call is only looped over N times so this would be an issue for non-square calibration matricies.

for (int ii = 0; ii < FC_FTS_N_DIMS; ii++) {

  for (int ii = 0; ii < FC_FTS_N_DIMS; ii++) {
    if (!UpdateSignal(signals_[ii])) {
      ERROR("Could not extract signal");
      return false;
    }
    wrench_[ii] = 0;

    for (size_t jj = 0; jj < signals_.size(); jj++) {
      wrench_[ii] += calibration_[ii][jj] * signals_[jj].value;
    }
  }

To implement a fix, write a new test case that shows non-square calibration matrix in a new YAML file and prove this is not working as expected. Implement the fix, then show the test case is passing.

fixed with #94