1 intel realsense t265驱动安装
https://blog.youkuaiyun.com/crp997576280/article/details/109544456
2 Rtabmap 安装
https://blog.youkuaiyun.com/zxl970921/article/details/114982558
已是最新版
3 源码安装intel RealSense ROS
https://blog.youkuaiyun.com/a17381562089/article/details/115345082
参考d435相机:https://blog.youkuaiyun.com/u012926144/article/details/80761342
过程中出现
Add the installation prefix of "ddynamic_reconfigure" to CMAKE_PREFIX_PATH
or set "ddynamic_reconfigure_DIR" to a directory containing one of the
above files. If "ddynamic_reconfigure" provides a separate development
package or SDK, be sure it has been installed.
错误,则安装库
sudo apt-get install ros-melodic-ddynamic-reconfigure
# 二进制安装所缺库,其中melodic对应ubuntu18.04,其余ubuntu版本同理换成对应的即可。
按照流程即可启动demo_t265.launch,启动rviz的画面。
4 相机画面标定
官方教程http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration
启动标定程序改为:
rosrun camera_calibration cameracalibrator.py --approximate 0.1 --size 10x6 --square 0.0016 right:=/camera/fisheye2/image_raw left:=/camera/fisheye1/image_raw
如何标定:https://blog.youkuaiyun.com/weixin_41010198/article/details/114843647
标定过程中遇到问题:
**** Calibrating ****
mono fisheye calibration...
mono fisheye calibration...
stereo fisheye calibration...
OpenCV Error: Assertion failed (svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) < thresh_cond) in CalibrateExtrinsics, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/fisheye.cpp, line 1427
Traceback (most recent call last):
File "/home/zsx/catkin_ws/src/image_pipeline-melodic/camera_calibration/src/camera_calibration/camera_calibrator.py", line 269, in on_mouse
self.c.do_calibration()
File "/home/zsx/catkin_ws/src/image_pipeline-melodic/camera_calibration/src/camera_calibration/calibrator.py", line 1401, in do_calibration
self.cal_fromcorners(self.good_corners)
File "/home/zsx/catkin_ws/src/image_pipeline-melodic/camera_calibration/src/camera_calibration/calibrator.py", line 1173, in cal_fromcorners
flags = flags)
cv2.error: /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/calib3d/src/fisheye.cpp:1427: error: (-215) svd.w.at<double>(0) / svd.w.at<double>((int)svd.w.total() - 1) < thresh_cond in function CalibrateExtrinsics
导致只有标定Calibrate是亮的,Save和Commit是暗的。无法完成标定过程。
鉴于已有未标定即可扫描成功的先例,跳过标定步骤。
5相机画面校正
启动校正:2个相机分别矫校正,订阅话题为相机原画
roslaunch image_undistort undistort_t265_1.launch //校正fisheye1
roslaunch image_undistort undistort_t265_2.launch //校正fisheye2
用wiki上的官方校正过程进行扫描,地形完整性较差,疑似校正有问题。因此参考下面的文章。
也没有跑通。
官方论坛中有相关问题Official RTAB-Map Forum - Slam using Intel RealSense tracking camera - T265,但是因为Rtabmap软件无法选中t265相机,不能借助软件进行标定和校正。可能是因为相机驱动或者rtabmap软件版本不是最新,考虑更新。经查验,驱动和软件版本都已为最新版本,可能是缺少依赖。
按照此网站http://wiki.ros.org/rosdep检查依赖,出现rosdep install AMAZING_PACKAGEX
找不到的问题,搁置。
6 输出至Rtabmap进行三维扫描
启动扫描:订阅话题为矫正值
roslaunch rtabmap_ros rtabmap.launch \
stereo:=true \
left_image_topic:=/camera/fisheye1_rect/image\
right_image_topic:=/camera/fisheye2_rect/image \
left_camera_info_topic:=/camera/fisheye1/camera_info \
right_camera_info_topic:=/camera/fisheye2/camera_info \
7 结果
未记录结果。最终成像颗粒较大,效果欠佳。
可能原因是没有执行标定,或者可以在.yaml中调整某个参数使成像的颗粒变小。