-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix differential drive motion model #267
Conversation
Rotation variance computations does not distribute over rotation composition Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
I totally agree that that operation most definitely is not distributive. However, I have broader concerns regarding the But that seems to be done at the end of all the math. By then, we already calculated the second rotation using the pre-adjustment first rotation, and it's not obvious to me that that can be fixed by moving second rotation back into 1st/4th quadrant too afterwards. Not having gone through t all the math in Prob. Robotics, the definitions of
From this code we don't really have good observability to the results of this function, which would be the best way to test this. Given that the parameters are private you can only test by generating samples of the distribution and comparing it, which is not ideal. I think it's worth either
In this last scenario |
IIUC it's computing the minimum rotation angle magnitude. Because the model assumes forward motion, moving backwards means larger rotations than necessary (e.g.
I guess we could. The mean of the translation distribution would have to be negative.
Sounds reasonable. |
FWIW, we have tests that generate samples and assert distribution parameter values, no need to provide observability to the internal state.
Factoring out the critical calculation is also very reasonable, but the other option is not that bad IMO. BTW, thanks for digging in, this is great! |
Good point. Bears asking why that test in insensitive to this fix then. In that test, the translation distance is zero, so |
Right, I would imagine a new test where all parameters but |
Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Proposed changes
Going over the math a few times, it doesn't seem to me that the rotation variance computation distributes over rotation composition. Not with those nonlinear max, min, abs operations in between.
Type of change
Checklist
Additional comments
Not sure how to write a test for this. Would a formal proof (that
rotation_variance(a) * rotation_variance(b) != rotation_variance(a * b)
) do?