ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Fri, 04 Dec 2015 06:11:51 -0600estimate covariance of a matrixhttps://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/Hi, im implementing regularized particle filter. My particle has coordinate x,y,z. All particles would make up a matrix n by 3 matrix . i wonder is there any existing code to find covariance matrix of a matrix in c++ somewhere in ros . This is easily done by matlab but c++ is too complicated
Thu, 03 Dec 2015 00:02:13 -0600https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/Answer by jarvisschultz for <p>Hi, im implementing regularized particle filter. My particle has coordinate x,y,z. All particles would make up a matrix n by 3 matrix . i wonder is there any existing code to find covariance matrix of a matrix in c++ somewhere in ros . This is easily done by matlab but c++ is too complicated </p>
https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?answer=221927#post-id-221927I'm unaware of a "ROS" way of doing this, but if you are using C++, I'd recommend using [Eigen](http://eigen.tuxfamily.org/). It is easily installed and used extensively by many ROS packages. If you're using a ROS Indigo or Jade, you'll need to depend on the [cmake_modules](http://wiki.ros.org/cmake_modules) package to get catkin to build your code (see [these instructions](https://github.com/ros/cmake_modules/blob/0.3-devel/README.md#usage)).
If you're using Eigen, there are easy ways to calculate covariance using built-in Eigen matrix functions. For a few examples, see [this Stack Overflow post](http://stackoverflow.com/questions/15138634/eigen-is-there-an-inbuilt-way-to-calculate-sample-covariance).Thu, 03 Dec 2015 09:26:03 -0600https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?answer=221927#post-id-221927Comment by dmngu9 for <p>I'm unaware of a "ROS" way of doing this, but if you are using C++, I'd recommend using <a href="http://eigen.tuxfamily.org/">Eigen</a>. It is easily installed and used extensively by many ROS packages. If you're using a ROS Indigo or Jade, you'll need to depend on the <a href="http://wiki.ros.org/cmake_modules">cmake_modules</a> package to get catkin to build your code (see <a href="https://github.com/ros/cmake_modules/blob/0.3-devel/README.md#usage">these instructions</a>).</p>
<p>If you're using Eigen, there are easy ways to calculate covariance using built-in Eigen matrix functions. For a few examples, see <a href="http://stackoverflow.com/questions/15138634/eigen-is-there-an-inbuilt-way-to-calculate-sample-covariance">this Stack Overflow post</a>.</p>
https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?comment=221939#post-id-221939thanks so much, the library is good but it is still so slow as the matrix is big, is there anyway to speed it upThu, 03 Dec 2015 18:46:23 -0600https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?comment=221939#post-id-221939Comment by Mehdi. for <p>I'm unaware of a "ROS" way of doing this, but if you are using C++, I'd recommend using <a href="http://eigen.tuxfamily.org/">Eigen</a>. It is easily installed and used extensively by many ROS packages. If you're using a ROS Indigo or Jade, you'll need to depend on the <a href="http://wiki.ros.org/cmake_modules">cmake_modules</a> package to get catkin to build your code (see <a href="https://github.com/ros/cmake_modules/blob/0.3-devel/README.md#usage">these instructions</a>).</p>
<p>If you're using Eigen, there are easy ways to calculate covariance using built-in Eigen matrix functions. For a few examples, see <a href="http://stackoverflow.com/questions/15138634/eigen-is-there-an-inbuilt-way-to-calculate-sample-covariance">this Stack Overflow post</a>.</p>
https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?comment=221969#post-id-221969@dmngu9 so you want to say that it is much slower in Eigen than in Matlab? sounds suspiciousFri, 04 Dec 2015 06:11:51 -0600https://answers.ros.org/question/221909/estimate-covariance-of-a-matrix/?comment=221969#post-id-221969