在学习14讲的时候第4讲安装sophus函数,使用书籍自带的3rd party的时候有错误
error: lvalue required as left operand of assignment
网上搜索碰到了靠谱的答案:
/home/xxx/Documents/vslam/slambook/slambook/3rdparty/Sophus/sophus/so2.cpp: In constructor ‘Sophus::SO2::SO2()’:
/home/xxx/Documents/vslam/slambook/slambook/3rdparty/Sophus/sophus/so2.cpp:32:26:
error: lvalue required as left operand of assignment
unit_complex_.real() = 1.;
^~
/home/xxx/Documents/vslam/slambook/slambook/3rdparty/Sophus/sophus/so2.cpp:33:26:
error: lvalue required as left operand of assignment
unit_complex_.imag() = 0.;
打开 Sophus/sophus/so2.cpp文件。
将:
SO2::SO2()
{
unit_complex_.real() = 1.;
unit_complex_.imag() = 0.;
}
改成:
SO2::SO2()
{
unit_complex_.real(1.);
unit_complex_.imag(0.);
}
这里主要是一个赋值的问题
原文链接:https://blog.youkuaiyun.com/Robot_Starscream/article/details/88132050