官方安装1 ,
官方安装2 。
sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
sudo apt-get update
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
连接USB3.0接口
realsense-viewer
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ..
安装ros包ddynamic_reconfigure
sudo apt install ros-noetic-ddynamic-reconfigure
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
发布的话题
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
rs_camera.launch更改选项
source devel/setup.bash
roslaunch realsense2_camera rs_camera.launch
新建一个终端: rostopic list
再新建一个终端,并执行: rviz
在弹出的rviz软件中,左下角有个‘Add’,然后在弹框中选择‘By topic’,
在里面选择其中一个选项的image。
sudo apt-get install python3-setuptools
sudo apt-get install python3-setuptools python3-rosinstall python3-ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev
sudo apt-get install libopencv-dev ros-noetic-vision-opencv ros-noetic-image-transport-plugins ros-noetic-cmake-modules python3-software-properties software-properties-common libpoco-dev python3-matplotlib python3-scipy python3-git python3-pip libtbb-dev libblas-dev liblapack-dev python3-catkin-tools libv4l-dev
sudo pip install python-igraph --upgrade
如果不成功,则可以直接安装:
sudo apt-get install python-igraph
sudo apt-get install python3-pyx
mkdir -p ~/kalibr_ws/src
cd ~/kalibr_ws
source /opt/ros/noetic/setup.bash
catkin init
catkin config --extend /opt/ros/noetic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
cd ~/kalibr_ws/src
git clone https://github.com/ethz-asl/Kalibr.git
cd ~/kalibr_ws
catkin build -DCMAKE_BUILD_TYPE=Release -j4
重新打开一个终端:
echo "source ~/kalibr_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
在文件夹kalibr_ws内,安装完成后,没有可执行文件,因此要将可执行文件移动到文件夹kalibr_ws中。
可执行文件在 kalibr_ws/devel/lib/kalibr 路径下,
将该路径下的所有文件复制到kalibr_ws内
./kalibr_create_target_pdf --type 'apriltag' --nx 6 --ny 6 --tsize 0.08 --tspace 0.3
mkdir -p ~/imu_catkin_ws/src
cd ~/imu_catkin_ws/src
catkin_init_workspace
cd ~/imu_catkin_ws
catkin_make
source ~/imu_catkin_ws/devel/setup.bash
source ~/.bashrc
cd ~/imu_catkin_ws/src
git clone https://github.com/gaowenliang/code_utils.git
cd ~/imu_catkin_ws/
catkin_make
/imu_catkin_ws/src/code_utils/src/sumpixel_test.cpp:2:10: fatal error: backward.hpp: 没有那个文件或目录
2 | #include "backward.hpp"
解决办法:
sudo apt-get install libdw-dev
将出错文件中的
#include “backward.hpp
替换为
#include "code_utils/backward.hpp"
/usr/local/include/ceres/internal/integer_sequence_algorithm.h:64:21: error: ‘integer_sequence’ is not a member of ‘std’
64 | struct SumImpl<std::integer_sequence<T, N, Ns...>> {
解决方法1
解决方法2
找到报错的项目的CMakeList.txt
set(CMAKE_CXX_FLAGS “-std=c++11”)
改成
set(CMAKE_CXX_STANDARD 14)
/imu_catkin_ws/src/code_utils/src/mat_io_test.cpp:33:47: error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope
33 | Mat img1 = imread( "/home/gao/IMG_1.png", CV_LOAD_IMAGE_UNCHANGED );
/imu_catkin_ws/src/code_utils/src/sumpixel_test.cpp:85:47: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
85 | Mat img1 = imread( "/home/gao/IMG_1.png", CV_LOAD_IMAGE_GRAYSCALE );
解决方法
将 CV_LOAD_IMAGE_UNCHANGED 换成 IMREAD_UNCHANGED
并在代码头文件下面添加命名空间 using namespace cv;
将 CV_LOAD_IMAGE_GRAYSCALE 换成 IMREAD_GRAYSCALE
/imu_catkin_ws/src/code_utils/src/sumpixel_test.cpp:95:35: error: ‘CV_MINMAX’ was not declared in this scope; did you mean ‘CV_MMX’?
95 | normalize( img, img2, 0, 255, CV_MINMAX );
解决方法1
原因:缺少
#include
解决:添加到对应报错的文件中
.
或解决方法2
CV_MINMAX 改成 NORM_MINMAX
cd ~/imu_catkin_ws/src/
git clone https://github.com/gaowenliang/imu_utils.git
cd ~/imu_catkin_ws/
catkin_make
echo "source ~/imu_catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
/imu_catkin_ws/src/imu_utils/src/imu_an.cpp:68:19: error: aggregate ‘std::ofstream out_t’ has incomplete type and cannot be defined
68 | std::ofstream out_t;
解决方法
添加头文件:
#include