Add covariance#3
Conversation
|
I'll squash the commits after your review. For the positive definite test/check on the covariance matrix I cannot compared against 0 because of numerical issues with Eigen eigensolver for self-adjoint matrices. I've also tried the Cholesky decomposition, and it's only slightly more robuts. With Matlab |
There was a problem hiding this comment.
This fails (ie vl = 0) if T is an int (not that that is likely). Any reason not to do (vr + vl) / T(2)?
There was a problem hiding this comment.
T must be double/float or a dual number like Jet<double/float, N>. It should never be int, but I'm not sure how to avoid that.
I use T(0.5) as it was done before, no difference with dividing by T(2).
There was a problem hiding this comment.
Depending how strongly you feel, you can use static_assert to prevent the template being instantiated with inappropriate types, eg:
#include <boost/type_traits.hpp>
static_assert(!boost::is_floating_point<T>::value, "The pose components must be specified as float values.");
(Note that the type_traits module has been brought into the STL for c++11.)
There was a problem hiding this comment.
Good one.
Since C++11 is not allowed upstream, I've used BOOST_ASSERT_MSG instead of static_assert tough.
There was a problem hiding this comment.
I think you're looking for BOOST_STATIC_ASSERT_MSG for compile time
There was a problem hiding this comment.
Yes, that's true. Fixed.
It seems that with Boost the message isn't shown, and instead a quite strange compilation error is shown. This doesn't happen with static_assert (C++11) tough. See the two links for comparison purposes here.
I've decided to keep the check (using Boost, since C++11 isn't recommended in ROS as I understand from REP3), since the case when this happens is uncommon and at least the error points to the line with the static assert.
|
BTW, after Now there are many more tests, in the sense that for the basic controller test also the covariance is tested. |
59b9987 to
26c96fd
Compare
There was a problem hiding this comment.
@mikepurvis Should I use a Clearpath Robotics copyright for the new files I've created here? If that's the case, could you provide me a link to an example?
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks.
I'll make it 80-column width tough.
|
@paulbovbel Any comments before I start squashing commits and merging? |
8a9688f to
2acc3f7
Compare
There was a problem hiding this comment.
@mikepurvis Do you know if this is actually needed when cmake_modules is already a build depend, following this?
There was a problem hiding this comment.
I believe so. cmake_modules only gets you the ability to find_package it, but you still need the package itself to be present on the system.
2acc3f7 to
bdd558a
Compare
This is needed to compute the covariance properly
bdd558a to
d2d3886
Compare
1. Moving along x axis covariance grows faster on y axis 2. Moving along y axis covariance grows faster on x axes
Check that the following propagation equations are satisfied: (x, y) = (x, y) + R(yaw) * (v_x, v_y) * dt yaw = yaw + v_yaw * dt (normalized)
d2d3886 to
93b1076
Compare
|
I've just squashed the commits. If there are no additional comments, I'll merge this. |
Add pose and twist covariance.
Also add tests for the covariance and the twist fixed in #2.
Also roslint has been added and several warnings fixed.