做实验需要用到动捕数据,之前配置好运行环境的电脑开不了机,只能再重新配置一遍环境,过程中遇到了些问题,记录以下供大家参考。
从 github 上获取源码,并根据自己的 ros 版本安装 vrpn_ros_client:
cd ~/catkin_ws/src
git clone https://github.com/clearpathrobotics/vrpn_client_ros.git
# ubuntu20.04--ros1--noetic
# ubuntu18.04--ros1--meloti
sudo apt-get install ros-noetic-vrpn
cd ~/catkin_ws
catkin_make
source devel/setup.bash
报错1:catkin_make 无法通过
undefined reference to `gflags::FlagRegisterer
……
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j6 -l6" failed
重新安装 gflags & glog 库
- 卸载之前的版本
sudo apt-get remove sudo apt-get remove libgoogle-glog-dev
sudo apt-get remove libgflags-dev
- 安装 gflags
git clone https://github.com/gflags/gflags.git
cd gflags && mkdir build
# 编译时打开动态库和静态库的选项,不然编译glog时会报错
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..
make # 编译
sudo make install # 安装
- 安装 glog
gitclone https://github.com/google/glog.git
cd glog && mkdir build
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..
make # 编译
sudo make install # 安装
报错2:安装完成后 catkin_make 报错找不到 glog 库
CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:85 (message):
Failed to find Ceres - Missing required Ceres dependency: glog.
因为之前卸载了 glog,所以现在需要重新安装 glog 依赖库。
sudo apt-get install libgoogle-glog-dev