SC-LeGO-LOAM 编译安装(简易安装版)

SC-LeGO-LOAM 编译安装

软件包中有自定的 ROS 消息,cloud_msgs/cloud_info,通过单独包 cloud_msgs 实现

但是在编译 LeGO-LOAM 时,总是找不到这个“cloud_msgs/cloud_info

SC-LeGO-LOAM 的代码结构并不复杂,直接用 cs_create_pkg 重新创建包,将 cloud_info 放到 msg 文件夹下

其余的修改:

1、在 CMakeLists.txt 中添加引用的包

cmake_minimum_required(VERSION 2.8.3)
project(sc_lego_loam)

find_package(catkin_simple REQUIRED)

#uncomment next line to use OpenCV library
#find_package(OpenCV REQUIRED)

#uncomment the next 2 lines to use the point-cloud library
#find_package(PCL 1.7 REQUIRED)
#include_directories(${PCL_INCLUDE_DIRS})

#uncomment the following 4 lines to use the Eigen library
#find_package(cmake_modules REQUIRED)
#find_package(Eigen3 REQUIRED)
#include_directories(${EIGEN3_INCLUDE_DIR})
#add_definitions(${EIGEN_DEFINITIONS})

find_package (Eigen3 3.3 REQUIRED NO_MODULE)
find_package(GTSAM REQUIRED QUIET)
find_package(PCL REQUIRED QUIET)
find_package(OpenCV REQUIRED QUIET)

include_directories(
	include
	${PCL_INCLUDE_DIRS}
	${OpenCV_INCLUDE_DIRS}
	${GTSAM_INCLUDE_DIR}
)

link_directories(
	include
	${OpenCV_LIBRARY_DIRS}
	${PCL_LIBRARY_DIRS}
	${GTSAM_LIBRARY_DIRS}
)

catkin_simple()

# example boost usage
# find_package(Boost REQUIRED COMPONENTS system thread)

# C++0x support - not quite the same as final C++11!
# use carefully;  can interfere with point-cloud library
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(CMAKE_CXX_STANDARD 14)

# Libraries: uncomment the following and edit arguments to create a new library
# cs_add_library(my_lib src/my_lib.cpp)   

# Executables: uncomment the following and edit arguments to compile new nodes
# may add more of these lines for more nodes from the same package
# cs_add_executable(example src/example.cpp)

#the following is required, if desire to link a node in this package with a library created in this same package
# edit the arguments to reference the named node and named library within this package
# target_link_library(example my_lib)

cs_add_executable(imageProjection src/imageProjection.cpp)
target_link_libraries(imageProjection ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})

cs_add_executable(featureAssociation src/featureAssociation.cpp)
target_link_libraries(featureAssociation ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})

cs_add_executable(mapOptmization 
    src/mapOptmization.cpp
    src/Scancontext.cpp
)
target_link_libraries(mapOptmization 
    ${PCL_LIBRARIES} 
    ${OpenCV_LIBRARIES} 
    gtsam
    Eigen3::Eigen
)

cs_add_executable(transformFusion src/transformFusion.cpp)
target_link_libraries(transformFusion ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})

cs_install()
cs_export()

2、将各个文件中 cloud_msgs/cloud_info 均改为 sc_lego_loam/cloud_info

sc_lego_loam::cloud_info segInfo;
std_msgs::Header cloudHeader;

修改完成后可顺利编译,项目已托管至 Gitee

https://gitee.com/MonsterAKALei/SC_LeGO-LOAM.git

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Prejudices

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值