1.realsense
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev
sudo apt-get install git wget cmake build-essential
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
git clone https://github.com/IntelRealSense/librealsense.git
./scripts/setup_udev_rules.sh
mkdir build && cd build
cmake ../
sudo make uninstall && make clean && make && sudo make install
测试安装结果
realsense-viewer
注意,这里查看usb usb2.0基本不行,检查usb口或者usb线
ROS 部分
sudo apt-get install ros-melodic-realsense2-camera
sudo apt-get install ros-melodic-realsense2-description
sudo apt-get install ros-noetic-realsense2-camera
sudo apt-get install ros-noetic-realsense2-description
测试编译结果:
roslaunch realsense2_camera demo_pointcloud.launch
jetson
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md
from realsense ROS github get realsense version and install
error
symbol lookup error: /home/zzs/software/realsense_ws/devel/lib//librealsense2_camera.so: undefined symbol: _ZN2cv3MatC1Ev
1. find_package( OpenCV REQUIRED )
2. include_directories(
include
${realsense2_INCLUDE_DIR}
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
3. target_link_libraries(${PROJECT_NAME}
${realsense2_LIBRARY}
${catkin_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${OpenCV_LIBRARIES}
)
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md
2.orbslam编译
git clone https://github.com/electech6/ORB_SLAM3_detailed_comments.git
安装 EIGEN 3.3.4
# install tools
sudo apt update
sudo apt install git cmake gcc g++
# install EIGEN3.3.4
sudo apt-get install libeigen3-dev
安装 Pangolin 0.6
# install pangolin0.6
## 安装依赖
sudo apt install libglew-dev libpython2.7-dev
## 获得pangolin的稳定版本安装包
https://github.com/stevenlovegrove/Pangolin/releases/tag/v0.6
## 编译安装
mkdir build
cd build
cmake ..
make
sudo make install # 安装后pangolin将在/usr/local/include/中找到
## 测试
cd build/examples/HelloPangolin
./HelloPangolin # 运行此示例,效果显示是一个红绿蓝立方体,表示即为安装成功
编译 ORB-SLAM3 非 ROS 版本
- 编译 Thirdparty/DBoW2
修改 CMakeLists.txt(支持 OpenCV4):
# find_package(OpenCV 3.2 QUIET)
# if(NOT OpenCV_FOUND)
# find_package(OpenCV 3.0 QUIET)
# if(NOT OpenCV_FOUND)
# message(FATAL_ERROR "OpenCV > 3.0 not found.")
# endif()
# endif()
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
find_package(OpenCV 4 REQUIRED)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 4.4 not found.")
endif()
然后编译:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
- 编译 Thirdparty/Sophus
cd Thirdparty/Sophus
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
- 解压 /ORB_SLAM3/Vocabulary/ORBvoc.txt.tar.gz
# 在/ORB_SLAM3下开终端
cd Vocabulary
tar -xf ORBvoc.txt.tar.gz
cd ..
- 编译ORB_SLAM3
# 参考 Thirdparty/DBoW2 修改 CMakeLists.txt,支持OpenCV4
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
pcl报错
如果使用pcl1.8版本
参考链接:Ubuntu20.04安装PCL1.8.0编译错误(全网最全~)_pcl::sampleconsensusmodelellipse2d-CSDN博客
首先进行下载:Releases · PointCloudLibrary/pcl · GitHub
这里我们选择1.8.0版本
进入根目录进行编译:
mkdir build
cd build
cmake ..
make -j12
error1:boost::math::isnan
解决:在vlp_grabber.h文件中加入#include<boost/math/special_functions/fpclassify.hpp>
error 2:#include <boost/uuid/sha1.hpp>
原因:sha1.hpp的路径不对(查找自己电脑上sha1.hpp的路径)
解决:在pcl_visualizer.cpp中将#include <boost/uuid/sha1.hpp>改为#include <boost/uuid/detail/sha1.hpp>
error 3:error: invalid initialization of reference of type ‘const std::vector<float>&’ from expression of type ‘const boost::shared_ptr<std::vector<float> >’
144 | return (plane_coeff_d_);
解决:在plane_coefficient_comparator.h中的return (plane_coeff_d_)修改为
return (* plane_coeff_d_)
error 4:/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_resetStreamHC'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_setStreamDecode'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe_continue'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_compress_HC_continue'
解决:/pcl/build/kdtree/CMakeFiles/pcl_kdtree.dir/下的link.txt里在末尾写上:-llz4
error 5:error: no matching function for call to ‘boost::uuids::random_generator_pure::random_generator_pure(boost::random::mt19937*)’ 77 | boost::uuids::random_generator OutofcoreOctreeDiskContainer<PointT>::uuid_gen_ (&rand_gen_);
解决:注释octree_disk_container.hpp中的76、77行:
error 6(我加了会报错):/home/young/pcl-1.8.0/features/include/pcl/features/integral_image_normal.h:254: undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::initData()'
解决:在octree_disk_container.hpp加入#include <pcl/features/normal_3d.h>
error 7:/bin/ld: ../lib/libpcl_recognition.so.1.8.0: undefined reference to `pcl::BOARDLocalReferenceFrameEstimation<pcl::PointXYZRGBA, pcl::Normal, pcl::ReferenceFrame>::computeFeature(pcl::PointCloud<pcl::ReferenceFrame>&)'
解决:在pcl-1.8.0/features/include/pcl/features/board.h加#include <pcl/features/board.h>
最终在cmakelist中加入
set(PCL_DIR /usr/local/share/pcl-1.8/)
3.坐标树及节点分析
相机tf
建图tf图
建图节点图
导航tf
导航node