本文共 3899 字,大约阅读时间需要 12 分钟。
转载自:
作者:神秘网友 发布时间:2020-09-23 10:34:19
在Intel nuc上配置D435i、运行VINS-Mono及问题记录
参考网址:https://blog.csdn.net/weixin_44580210/article/details/89789416
问题1: 安装测试librealsense SDK 2.0的过程中,运行到这一步,sudo apt-get install librealsense2-dkms
,弹出了一个蓝色窗口,好像是软件安全设置,原因可能跟UEFI引导项有关系,让设置了一个密码,我设置的是18822091613,之后按步骤安装,到最后一步,测试SDK:realsense-viewer
时,打开的窗口里不显示d435i相机信息,如下图: 因为整个安装过程只有上述那一步出现了问题,所以我猜可能是安装library时的问题,于是将其卸载sudo apt-get autoremove librealsense2-dkms
,卸载完之后再打开SDK,realsense-viewer
,发现竟然能显示相机了,之后我又多次试验,反复安装和卸载library,发现真的能影响相机的连接,具体的原因我现在还不清楚。
第一步:
参考网址:https://blog.csdn.net/jiangchuanhu/article/details/92795791
参考里面的第二部分:二、安装ROS Wrapper for Intel RealSense.
如下
Create a catkin workspace
mkdir -p ~/catkin_ws/srccd ~/catkin_ws/src/
#Clone the latest Intel RealSense ROS into ‘catkin_ws/src/’
git clone https://github.com/IntelRealSense/realsense-ros.gitcd realsense-ros/git checkout `git tag | sort -V | grep -P "^\d+\.\d+\.\d+" | tail -1`cd ../..
Make sure all dependent ros packages are installed. You can check .travis.yml file for reference.
sudo apt install ros-kinetic-cv-bridge ros-kinetic-image-transport ros-kinetic-tf ros-kinetic-diagnostic-updater ros-kinetic-ddynamic-reconfigurecatkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Releasecatkin_make installecho source $(pwd)/devel/setup.bash >> ~/.bashrcsource ~/.bashrc
sudo apt install ros-kinetic-rgbd-launchroslaunch realsense2_camera rs_rgbd.launch
rostopic list
rostopic echo /camera/color/camera_inforostopic echo /camera/aligned_depth_to_color/camera_info
rviz
此时,d435i的配置已经完成,剩下的就是在VINS上跑,步骤如下
参考 https://blog.csdn.net/weixin_44580210/article/details/89789416这里面的第四步:1、 修改realsense包里的rs_camera.launch文件
第一处,修改unite_imu_method如下,这里是让IMU的角速度和加速度作为一个topic输出
第二处,修改enable_sync参数为true,这里是开机相机和IMU的同步
2、修改VINS-Mono包里的realsense_color_config.yaml文件
第一处,修改订阅的topic
imu_topic: “/camera/imu”
image_topic: “/camera/color/image_raw”第二处,修改相机内参,这里先再次打开运行realsesne包,然后可以通过如下命令获取相机内参
rostopic echo /camera/color/camera_info
第三处,IMU到相机的变换矩阵,这里我根据注释的提示修改成2
estimate_extrinsic: 2 # 0 Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, don’t change it.
# 1 Have an initial guess about extrinsic parameters. We will optimize around your initial guess. # 2 Don’t know anything about extrinsic parameters. You don’t need to give R,T. We will try to calibrate it. Do some rotation movement at beginning. #If you choose 0 or 1, you should write down the following matrix.第四处,IMU参数,这里我全部修改注释给的参数
#imu parameters The more accurate parameters you provide, the better performance
acc_n: 0.2 # accelerometer measurement noise standard deviation. #0.2 gyr_n: 0.05 # gyroscope measurement noise standard deviation. #0.05 acc_w: 0.02 # accelerometer bias random work noise standard deviation. #0.02 gyr_w: 4.0e-5 # gyroscope bias random work noise standard deviation. #4.0e-5 g_norm: 9.80 # gravity magnitude第五处,是否需要在线估计同步时差,根据上述博主的建议这里选择不需要
#unsynchronization parameters
estimate_td: 0 # online estimate time offset between camera and imu td: 0.000 # initial value of time offset. unit: s. readed image clock + td = real image clock (IMU clock)第六处,相机曝光改成全局曝光
#rolling shutter parameters
rolling_shutter: 0 # 0: global shutter camera, 1: rolling shutter camera rolling_shutter_tr: 0 # unit: s. rolling shutter read out time per frame (from data sheet).roslaunch realsense2_camera rs_camera.launch roslaunch vins_estimator realsense_color.launch roslaunch vins_estimator vins_rviz.launch