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
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 @Myzhar
While I testing my code I infact discovered that the issue was in opencv and not in the zedsdk.
I’m using opencv for tag detection and there are some parameters that i might set wrongly. I will not have a deep look at that.
But I’m still confused on what is the best practice when you have 2 zeds and a fusion module. Should I implement a logic the make sure that the 2 zed loops are not running at the same time like I saw in some of your template? Or can they run in parallel with no issue?
And what about the other functions? Right now we setup a single thread handling all the functions that we need from the zed object, sharing the result with other threads to elaborate. For example the localization, depht and object recognition.
Is it okay instead to share the zed object, calling the function to retrive the different information from the other threads at different Hz? Is it safe or do I need it to protect it with some mutex?