Closed andreadelprete closed 4 years ago
Maybe @jcarpent could help us with this. We are computing the forward dynamics with 3 different methods here. They should all give the same results, but they don't. For instance:
When I do the same in Python I get the same results, so clearly there's something wrong with the way we are using these methods in C++. Any idea what could be the problem?
Thanks to the PR of @jcarpent now the Euler simulator gives consistent results when the robot is in the air. However, this is not the case for the ExponentialSimulator. Here some results: Basically it seems that everything works except for Exp-Cholesky. But Cholesky works fine in the Euler simulator.
Moreover, what's really weird is that if I replace this line in the code with this:
dvMean_.noalias() = data_->Minv*mDv_;
(as it was done in the PR by @jcarpent ) and recompile, then I get different results also for Exp-ABA, which shouldn't be affected by this change: The line corresponding to Exp-ABA is a bit hard to spot, but it's basically overlapping with the one of Exp-Cholesky.
The only possible explanation I have for this is some memory issues. Any other idea?
hi @andreadelprete , there was a minor bug here that i fixed, could you confirm that his fixes the issue you see with Exp-Cholesky ?
I confirm that this solves the problem. However, I am still worried about the result I reported above, because I am afraid there might be some issues with the memory. I don't know how to proceed to try and find them though.
Could we do a meeting to explain me in details the issue you have in mind?
Let's close this issue for now
In theory I think that Euler and Exponential should be equivalent as long as the robot is in the air. However, according to a test I just did (with the c++ simulators) they are not. Exponential is much more accurate. I just initialize Solo12, 1 meter above the ground and let it fall with zero joint torques. These are the integration errors over time: For some reason, Euler gets a very large error in the first integration step, whereas Exponential does not. Unless there's something I am missing, I'd say this is a bug.
@hammoudbilal could you look into this? I am using the latest version of the c++ simulator in master. The python script you can use to reproduce these results is this. This script is supposed to be used for a trotting motion, but since results looked bad for trotting I've started simplifying things (in particular here and here) until I've found this issue.