一、安装编译Sophus库
1、下载非模板类的Sophus。
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
2、编译CMake工程。
mkdir build
cd build
cmake ..
make
3、编译过程解决方案
make时出现如下错误:
解决方案:
Sophus/Sophus/so2.cpp文件下:
SO2::SO2()
{
unit_complex_.real() = 1.;
unit_complex_.imag() = 0.;
}
改为:
SO2::SO2()
{
unit_complex_.real(1.);
unit_complex_.imag(0.);
}
4、编译代码
在ch4/useSophus/build下编译代码:
cmake ..
make
./useSophus
代码:
参考高博十四讲Github链接
程序输出结果:
关注点赞,好运多多~