スキップしてメイン コンテンツに移動

LIO-SAM install (ROS1 noetic)

https://github.com/TixiaoShan/LIO-SAM.git


Reference

https://github.com/TixiaoShan/LIO-SAM/issues/206


1) Install GTSAM following readme
 

2) Configure the utility.h to use #include <opencv2/opencv.hpp> instead of #include <opencv/cv.h>
 

Move #include <opencv2/opencv.hpp> after the pcl headers

 

3) Configure CMakeLists.txt to use set(CMAKE_CXX_FLAGS "-std=c++14") instead of set(CMAKE_CXX_FLAGS "-std=c++11")
 

4) Launch

 

5)  Save PCD

 

0. install to need the ros package
sudo apt-get install -y ros-noetic-navigation
sudo apt-get install -y ros-noetic-robot-localization
sudo apt-get install -y ros-noetic-robot-state-publisher

 

1. Install GTSAM following readme

https://gtsam.org/get_started/

Add PPA for the latest GTSAM 4.x stable release

sip2@sip2-2021:~$ sudo add-apt-repository ppa:borglab/gtsam-release-4.0
sip2@sip2-2021:~$ sudo apt update
sip2@sip2-2021:~$ sudo apt install libgtsam-dev libgtsam-unstable-dev

 

2. Configure the utility.h to use #include <opencv2/opencv.hpp> instead of #include <opencv/cv.h>

 

sip2@sip2-2021:~$ mkdir -p ~/catkin_lio_sam/src
sip2@sip2-2021:~$ cd ~/catkin_lio_sam/src
sip2@sip2-2021:~/catkin_lio_sam/src$ git clone https://github.com/TixiaoShan/LIO-SAM.git
Cloning into 'LIO-SAM'...
remote: Enumerating objects: 792, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 792 (delta 11), reused 14 (delta 6), pack-reused 763
Receiving objects: 100% (792/792), 127.84 MiB | 12.49 MiB/s, done.
Resolving deltas: 100% (442/442), done. 

 

before utility.h

#pragma once
#ifndef _UTILITY_LIDAR_ODOMETRY_H_
#define _UTILITY_LIDAR_ODOMETRY_H_
#define PCL_NO_PRECOMPILE

#include <ros/ros.h>

#include <std_msgs/Header.h>
#include <std_msgs/Float64MultiArray.h>
#include <sensor_msgs/Imu.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/NavSatFix.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/Path.h>
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>

#include <opencv/cv.h> // delete

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/search/impl/search.hpp>
#include <pcl/range_image/range_image.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/common/common.h>
#include <pcl/common/transforms.h>
#include <pcl/registration/icp.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/crop_box.h>
#include <pcl_conversions/pcl_conversions.h>

 

 after utility.h

#pragma once
#ifndef _UTILITY_LIDAR_ODOMETRY_H_
#define _UTILITY_LIDAR_ODOMETRY_H_
#define PCL_NO_PRECOMPILE

#include <ros/ros.h>

#include <std_msgs/Header.h>
#include <std_msgs/Float64MultiArray.h>
#include <sensor_msgs/Imu.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/NavSatFix.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/Path.h>
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/search/impl/search.hpp>
#include <pcl/range_image/range_image.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/common/common.h>
#include <pcl/common/transforms.h>
#include <pcl/registration/icp.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/crop_box.h>
#include <pcl_conversions/pcl_conversions.h>

#include <opencv2/opencv.hpp>    //insert


3. Configure CMakeLists.txt to use set(CMAKE_CXX_FLAGS "-std=c++14") instead of set(CMAKE_CXX_FLAGS "-std=c++11")

before

cmake_minimum_required(VERSION 2.8.3)
project(lio_sam)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread")

 

after

cmake_minimum_required(VERSION 2.8.3)
project(lio_sam)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++14")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread")


sip2@sip2-2021:~/catkin_lio_sam$ catkin_make -j1

[100%] Generating EusLisp manifest code for lio_sam
[100%] Built target lio_sam_generate_messages_eus
Scanning dependencies of target lio_sam_generate_messages
[100%] Built target lio_sam_generate_messages


4. Launch

sip2@sip2-2021:~/catkin_lio_sam$ source devel/setup.bash
sip2@sip2-2021:~/catkin_lio_sam$ roslaunch lio_sam run.launch
[ INFO] [1663207863.351423722]: ----> Feature Extraction Started.
[ INFO] [1663207863.360245612]: ----> Image Projection Started.
[ INFO] [1663207863.371944484]: ----> Map Optimization Started.
[ INFO] [1663207863.375593675]: ----> IMU Preintegration Started.

sip2@sip2-2021:~/Downloads$ rosbag play park_dataset.bag -r 3
[ INFO] [1663207943.222557262]: Opening park_dataset.bag

Waiting 0.2 seconds after advertising topics... done.

Hit space to toggle paused, or 's' to step.
 [RUNNING]  Bag Time: 1593996836.773328   Duration: 560.557628 / 560.563894               7.32  




5. Save PCD 

rosservice call [service] [resolution] [destination]

sip2@sip2-2021:~/catkin_lio_sam$ source devel/setup.bash
sip2@sip2-2021:~/catkin_lio_sam$ rosservice call /lio_sam/save_map 0.2 "/Downloads/LOAM/"
success: True

Saving map to pcd files ...
Save destination: /home/sip2/Downloads/LOAM/
rm: cannot remove '/home/sip2/Downloads/LOAM/': No such file or directory
Processing feature cloud 658 of 659 ...

Save resolution: 0.2
****************************************************
Saving map to pcd files completed




コメント

このブログの人気の投稿

[참고] ROS kinetic에서 WebCam 사용하기 (Ubuntu 16.04)

Reference: 1. https://github.com/bosch-ros-pkg/usb_cam/issues/53  2. http://zumashi.blogspot.jp/2016/12/ros-kinetic-usb-cam.html  3. http://cafe.naver.com/openrt/5963 위의 사이트들을 참고하여 ROS Kinetic에서 Logitech WebCam C270의 동작을 확인했습니다. $ cd ~/catkin_ws/src $ git clone https://github.com/bosch-ros-pkg/usb-cam.git $ cd .. $ catkin_make WebCam test $ roscore $ rosrun usb_cam usb_cam_node $ rosrun image_view image_view image:=/usb_cam/image_raw $ rosrun rviz rviz 1) By display type>rviz>image 2) Image topic: /usb_cam/image_raw --> 왼쪽 하단과 같이 WebCam이 잘 동작하는 것을 확인했습니다.

[vscode] TImeout waiting for debugger connection

이제까지 잘 동작하던 비주얼 스튜디오 코드가 위와 같은 에러 메세지를 내면서 갑자기 디버깅이 안되서 인터넷을 검색한 결과.. vscode의 User Setting에서 검색창에 python.terminal.activateEnvironment을 입력하여 true로 설정되어 있는 값을 false로 변환하면 된다. 

日常の話

今年の夏は本当に暑かったですね。それで、我らもなるべく室内で活動しました。図書館で絵本を読んでいる長男さん。 カラオケ大会〜〜 漫画を読んでいた長女 長男はおもちゃで遊んでました。 魚べいで外食 橋コンテストで出品する作品を作る次女 長男が大好きなマインクラフトレゴ。官舎の壁は長男の落書きで大変な状態です。 お父さん、お母さんが作って下さった美味しい料理 お父さんのハヤシライスは美味しい! 頑張って運動している長男 親切に教えてくれた先生たち、ありがとうございました。 JAXA来年までメイン建物が運営しません!ご参考までに〜〜 長女と長男、図書室の中で〜〜