eigen

Turtlebot2 rgbdslam_v2环境配置

好久不见. 提交于 2020-02-02 14:07:18
Turtlebot2 rgbdslam_v2环境配置 创建一个工作空间,编译一遍 下载rgbdslam_v2代码包 安装g2o的依赖 创建eigen工作空间 创建g2o工作空间 配置g2o代码包中的CMakeLists.txt文件 编译g2o工作空间 下载PCL1.8(点云库:Point Cloud Library) 配置PCL,使其支持C++2011 编译PCL 配置rgbdslam_v2 编译rgbdslam_v2 环境测试 查看地图 有关博客参考: 创建一个工作空间,编译一遍 $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws $ catkin_make 下载rgbdslam_v2代码包 $ cd ~/catkin_ws/src $ wget -q http://github.com/felixendres/rgbdslam_v2/archive/kinetic.zip $ unzip kinetic.zip (把解压出来的文件名更改为rgbdslam_v2) $ sudo cp -a ~/catkin_ws/src/rgbdslam_v2 /opt/ros/kinetic/share 安装g2o的依赖 $ sudo apt-get install libsuitesparse-dev 创建eigen工作空间 $ mkdir ~/src $

Coefficient-wise custom functions in Eigen

南笙酒味 提交于 2020-02-01 18:13:20
问题 I have a do_magic method which takes a double and adds 42 to it. I'd like to apply this method to each coefficient of a Eigen::Matrix or Eigen::Array (that means, I wouldn't mind if it's only possible with one of both types). Is this possible? Like this: Eigen::MatrixXd m(2, 2); m << 1,2,1,2; m.applyCoefficientWise(do_magic); // m is now 43, 44, 43, 44 回答1: You can use unaryExpr, though this returns a new view onto the matrix, rather than allowing you to modify the elements in place. Copying

Coefficient-wise custom functions in Eigen

余生长醉 提交于 2020-02-01 18:12:29
问题 I have a do_magic method which takes a double and adds 42 to it. I'd like to apply this method to each coefficient of a Eigen::Matrix or Eigen::Array (that means, I wouldn't mind if it's only possible with one of both types). Is this possible? Like this: Eigen::MatrixXd m(2, 2); m << 1,2,1,2; m.applyCoefficientWise(do_magic); // m is now 43, 44, 43, 44 回答1: You can use unaryExpr, though this returns a new view onto the matrix, rather than allowing you to modify the elements in place. Copying

Serializing Eigen::Matrix using Cereal library

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-01 04:26:45
问题 UPDATED : I managed to get it to work after I googled around and read the doxygen comments in code. Problem was that I missed the cast before using resize() method and also not using std::ios::binary for the streams. If you want to do something similar, better check the answer by Azoth. I am trying to serialize Eigen::Matrix type using Cereal. This is what I have (loosely based on https://gist.github.com/mtao/5798888 and the the types in cereal/types ): #include <cereal/cereal.hpp> #include

Efficient matrix transpose matrix multiplication in Eigen

半城伤御伤魂 提交于 2020-01-30 05:42:09
问题 I have access to a number of matrix libraries, but for this project I am using Eigen, due to its compile time definition and its inclusion of SVD. Now, I am doing the following operation: Eigen::Matrix<double,M,N> A; // populated in the code Eigen::Matrix<double,N,N> B = A.transpose() * A; As I understand, this makes a copy of A and forms the transpose, which is multiplied by A again. This operation is being performed on relatively small matrices (M=20-30,N=3), but many millions of times per

解决fatal error: Eigen/Dense: No such file or directory错误

青春壹個敷衍的年華 提交于 2020-01-29 04:34:11
解决fatal error: Eigen/Dense: No such file or directory错误 今天将别人的一段Qt+VS的代码拷贝过来,以前没用过cmake,需要重新配置工程的包含目录、库目录和引用目录。将Qt的各目录配置好后,发现没用配置诶跟库,所以下载并配置了eigen库,参考文章: VS+eigen配置 然后发现仍不能使用eigen库,并提示 fatal error: Eigen/Dense: No such file or directory 之后我便右击项目,打开项目“属性”,将“平台”改为"X64",编译通过。 难道eigen库是64位的? 来源: CSDN 作者: Morning Sun 链接: https://blog.csdn.net/m0_37974885/article/details/103737233

Eigen: type deduction in template specialization of base-class

瘦欲@ 提交于 2020-01-28 10:58:32
问题 I trying do write a C++ template-class which should be able to deal with "simple" types and with "Eigen::MatrixBase"-like types via the same interface. I manage to get thie desired behavior with two different simple types, but struggle to squeeze the Eigen-syntax into my minimal-example... Maybe someone can give me an advice? While looking around, this comes close to what i wanna have -- without Eigen. This looks similar as well. #ifndef __MINIMAL_H__ #define __MINIMAL_H__ #include <Eigen

Eigen: type deduction in template specialization of base-class

送分小仙女□ 提交于 2020-01-28 10:57:49
问题 I trying do write a C++ template-class which should be able to deal with "simple" types and with "Eigen::MatrixBase"-like types via the same interface. I manage to get thie desired behavior with two different simple types, but struggle to squeeze the Eigen-syntax into my minimal-example... Maybe someone can give me an advice? While looking around, this comes close to what i wanna have -- without Eigen. This looks similar as well. #ifndef __MINIMAL_H__ #define __MINIMAL_H__ #include <Eigen

Eigen max matrix size for 32 bit applications

拥有回忆 提交于 2020-01-24 10:24:09
问题 So, I'm finding the Eigen package crashes when I try to declare a matrix larger than 10000x10000. I need to declare a matrix like this.. about 13000x13000 elements reliably. I ran a test like: for( int tortureEigen = 1 ; tortureEigen < 50000 ; tortureEigen++ ) { printf( "Torturing Eigen with %dx%d..\n", tortureEigen, tortureEigen ) ; Eigen::MatrixXd m( tortureEigen, tortureEigen ) ; } Crashes on my machine (6 GB RAM) at 14008 elements. I'm kind of disappointed! I thought Eigen was like MATLAB

How to extract a subvector (of an Eigen::Vector) from a vector of indices in Eigen?

两盒软妹~` 提交于 2020-01-23 05:14:09
问题 Suppose I have Eigen::VectorXd x; //{1,2,3,4,5,6,7,8} and Eigen::VectorXd ind_vec; //{0,2,4,5} Is there a way an easy way to extract the ind_vec elements of x? Something like: x.extract(ind_vec) returning {1, 3, 5, 6} 回答1: Since the current answer was not satisfactory for me, I googled a bit and I found this tutorial in the Eigen documentation. #include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::ArrayXf v(6); v << 1, 2, 3, 4, 5, 6; cout << "v.head(3) =" << endl