1 ROS tested with Melodic
sudo apt-get install -y ros-melodic-navigation
sudo apt-get install -y ros-melodic-robot-localization
sudo apt-get install -y ros-melodic-robot-state-publisher
2 gtsam (Georgia Tech Smoothing and Mapping library)
wget -O ~/Downloads/gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip
cd ~/Downloads/ && unzip gtsam.zip -d ~/Downloads/
cd ~/Downloads/gtsam-4.0.2/
mkdir build && cd build
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
sudo make install -j6
or
sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sudo apt update
sudo apt install libgtsam-dev libgtsam-unstable-dev
3 下载和编译LIO-SAM
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LIO-SAM.git
cd ..
catkin_make
运行LIO-SAM
roslaunch lio_sam run.launch
rosbag play park.bag
4下载和编译ouster_example
sudo apt install build-essential cmake libglfw3-dev libglew-dev libeigen3-dev libjsoncpp-dev libtclap-dev
sudo apt install ros-melodic-ros-core ros-melodic-pcl-ros ros-melodic-tf2-geometry-msgs ros-melodic-rviz
cd ~/catkin_ws/src
git clone https://github.com/ouster-lidar/ouster_example.git
cd ..
cmake -DCMAKE_BUILD_TYPE=Release
运行ouster
roslaunch ouster_ros ouster.launch
5 报错实例
[lio_sam_imuPreintegration-2] process has died [pid 18568, exit code 127, cmd /home/uav/MappingSrc/devel/lib/lio_sam/lio_sam_imuPreintegration __name:=lio_sam_imuPreintegration __log:=/home/uav/.ros/log/a65082e4-a798-11ec-b3d5-02428e571c30/lio_sam_imuPreintegration-2.log].
实际问题是库文件libmetis.so 的位置。它是一个运行时库,但是当应用程序查找它时,它的位置不在预期的目录中。在通过运行命令sudo make install -j8安装库gtsam 时,文件libmetis.so安装在/usr/local/lib/的默认位置,但是当我们启动 ros 工作区时,运行时库查看位置/opt/ros/melodic/库/
cd /usr/local/lib/
sudo cp libmetis.so /opt/ros/melodic/lib/
再次运行,一切正常。
运行时报错 [lio_sam_mapOptmization-5] process has died [pid 260348, exit code -11
解决: gtsam编译时带上这个参数,cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
- 运行时报错 error while loading shared libraries: libmetis-gtsam.so: cannot open shared object file: No such file or directory
解决: sudo ln -s /usr/local/lib/libmetis-gtsam.so /usr/lib/libmetis-gtsam.so
- 保存地图数据
savePCDDirectory: “/Downloads/LOAM/” 注意!!代码会删除这个路径重新创建,不要用已有的路径哦,最好改一下代码把删除路径的逻辑去掉。
修改_TIMEOUT_SIGINT值,默认15s,改为60s。
sudo gedit /opt/ros/noetic/lib/python3/dist-packages/roslaunch/nodeprocess.py 4. Rviz展示
如果点云的点很大,窗口缩小一下试试。
|