Error in evaluating the ResidualBlock

Hi!I’m using 2 zedX i’m my configuration, one in the front of the vehicle and one in the back. In the last couple of days i’m getting the error “Error in evaluating the ResidualBlock.”

The full result here:
residual_block.cc:129

Error in evaluating the ResidualBlock.

There are two possible reasons. Either the CostFunction did not evaluate and fill allresidual and jacobians that were requested or there was a non-finite value (nan/infinite)generated during the or jacobian computation.

Residual Block size: 1 parameter blocks x 2 residuals

For each parameter block, the value of the parameters are printed in the first columnand the value of the jacobian under the corresponding residual. If a ParameterBlock washeld constant then the corresponding jacobian is printed as ‘Not Computed’. If an entryof the Jacobian/residual array was requested but was not written to by user code, it isindicated by ‘Uninitialized’. This is an error. Residuals or Jacobian values evaluatingto Inf or NaN is also an error.

Residuals: nan nan

Parameter Block 0, size: 7

 nan |         -nan         -nan
 nan |         -nan         -nan 

 nan |         -nan         -nan 

-0.0181003 | -nan -nan
8.6312e-05 | nan nan
-0.00403365 | nan nan
0.999828 | 0 0

Can you help me?

Hi @Ste2038
Please provide more details.

What software emits this error?
Do you have the source code?
Is it your software?

This does not seem to be Stereolabs’ code…

Hi!
I’m using a custom Cpp software with ZEDSDK. The project is big and I cannot share it. But to test this problem I stripped everything and left 2 camera opening from SN, then start publishing for a fusion module, and starts two threads to cycle the camera grab. Only the position tracking is enabled on both. During the tests I noticed that if I enable only the front camera, it works everytime first time. If I enable only the back camera or both, the first time I run the code it doesn’t work, the second time it works. Only a few times it takes more than 2.

The factor that seems to make it more and more often is how the 2 camera are triggered.
I saw an example from stereolabs’ github, that right now i cannot find, that was using a trigger to make sure that both cameras finished the cycle before unlocking the main fusion thread, but in my case, it was randomly blocking in that while. Taking off the while, the camera was not stopping anymore, but sometimes gives that error.

I don’t know where that error is coming from if its not a zedsdk problem. I’ll try to make a new project with just this part to test and go deeper in the problem.

Note: I’ve tryied swapping the 2 camera SN, the problem’s keeps being the named “rear” camera, so it’s not an hardware problem, but in the code, the 2 camera are the same apart for the name

Hi @Ste2038
this seems a multi-thread synchronization issue.
It’s not possible to understand the cause of the problem without analyzing the code.