ubuntu20.08下获取realsense内参

2023-05-16

ubuntu20.08下使用realsense过程记录

  • 介绍
    • 一、安装SDK
      • 1.注册公钥
      • 2.将服务器添加到存储库列表中
      • 3.安装库
      • 4.安装开发者和调试包
      • 5.测试SDK
    • 二、下载realsense2_camera包
      • 1.下载包
      • 2.测试包
      • 3.激活相关话题
    • 三、查看相机内参

介绍

在ubuntu20.08中使用realsenseD435i,利用ros内工具实现realsense标定等功能,前提:

  • 已安装ros

  • USB3.0接口

一、安装SDK

1.注册公钥

终端输入:

sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE

2.将服务器添加到存储库列表中

sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u

3.安装库

sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils

4.安装开发者和调试包

sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg

5.测试SDK

连接相机至主机USB3.0接口,运行指令:

realsense-viewer

打开软件界面即成功。

二、下载realsense2_camera包

1.下载包

根据产品型号选择所需的功能包,这里由于我使用的是D435i,因此下载的是二代功能包。
二代功能包支持的相机型号见:ros官方wiki。

终端运行:

sudo apt-get install ros-$ROS_DISTRO-realsense2-camera

2.测试包

roslaunch realsense2_camera rs_camera.launch

出现报错信息如下:

[ERROR] [1662969183.404807328]: Failed to load nodelet [/camera/realsense2_camera] of type [realsense2_camera/RealSenseNodeFactory] even after refreshing the cache: Failed to load library /opt/ros/noetic/lib//librealsense2_camera.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2.50: cannot open shared object file: No such file or directory)
[ERROR] [1662969183.404832682]: The error before refreshing the cache was: Failed to load library /opt/ros/noetic/lib//librealsense2_camera.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = librealsense2.so.2.50: cannot open shared object file: No such file or directory)
[FATAL] [1662969183.405015740]: Failed to load nodelet '/camera/realsense2_camera` of type `realsense2_camera/RealSenseNodeFactory` to manager `realsense2_camera_manager'
[camera/realsense2_camera-2] process has died [pid 16922, exit code 255, cmd /opt/ros/noetic/lib/nodelet/nodelet load realsense2_camera/RealSenseNodeFactory realsense2_camera_manager __name:=realsense2_camera __log:=/home/jzd/.ros/log/163d27fa-324b-11ed-afdc-0fecde74814b/camera-realsense2_camera-2.log].
log file: /home/jzd/.ros/log/163d27fa-324b-11ed-afdc-0fecde74814b/camera-realsense2_camera-2*.log

大意是找不到realsense2_camera包,怀疑是目录没刷新。在前人文章中找了一个方法
终端执行:

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

如果出现相似的错误提示,可以试试先执行上面这两行代码。
再次尝试启动节点:

roslaunch realsense2_camera rs_camera.launch

成功启动。查看节点运行情况:

rostopic list 

输出如下:

/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressed/parameter_updates
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static

3.激活相关话题

发现在list中缺乏imu话题,需要在launch文件中手动修改相关节点为true。
相关配置在rs_camera.launch(opt/ros/noetic/share/realsense2_camera/)中修改,该文件没有写入权限,需要首先进行写权限赋予,在该文件所在目录打开终端并执行:

 chmod 777 rs_camera.launch

之后打开文件进行下列项的修改:

//打开imu
<arg name="enable_gyro"         default="true"/>
<arg name="enable_accel"        default="true"/>
//联合方式copy或linear_interpolation
<arg name="unite_imu_method"          default="linear_interpolation"/>
//时间戳同步
<arg name="enable_sync"               default="true"/>

再次查看节点运行情况:

rostopic list 

相关节点已激活:

/camera/accel/imu_info
/camera/accel/metadata
/camera/accel/sample
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressed/parameter_updates
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/camera/extrinsics/depth_to_infra1
/camera/extrinsics/depth_to_infra2
/camera/gyro/imu_info
/camera/gyro/metadata
/camera/gyro/sample
/camera/infra1/camera_info
/camera/infra1/image_rect_raw
/camera/infra1/image_rect_raw/compressed
/camera/infra1/image_rect_raw/compressed/parameter_descriptions
/camera/infra1/image_rect_raw/compressed/parameter_updates
/camera/infra1/image_rect_raw/compressedDepth
/camera/infra1/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_rect_raw/compressedDepth/parameter_updates
/camera/infra1/image_rect_raw/theora
/camera/infra1/image_rect_raw/theora/parameter_descriptions
/camera/infra1/image_rect_raw/theora/parameter_updates
/camera/infra1/metadata
/camera/infra2/camera_info
/camera/infra2/image_rect_raw
/camera/infra2/image_rect_raw/compressed
/camera/infra2/image_rect_raw/compressed/parameter_descriptions
/camera/infra2/image_rect_raw/compressed/parameter_updates
/camera/infra2/image_rect_raw/compressedDepth
/camera/infra2/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra2/image_rect_raw/compressedDepth/parameter_updates
/camera/infra2/image_rect_raw/theora
/camera/infra2/image_rect_raw/theora/parameter_descriptions
/camera/infra2/image_rect_raw/theora/parameter_updates
/camera/infra2/metadata
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static

三、查看相机内参

执行:

roslaunch realsense2_camera rs_camera.launch
rostopic echo /camera/color/camera_info

输出为:

header: 
  seq: 404
  stamp: 
    secs: 1663075673
    nsecs: 569769621
  frame_id: "camera_color_optical_frame"
height: 720
width: 1280
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [926.9201049804688, 0.0, 652.867919921875, 0.0, 926.822021484375, 359.2794189453125, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [926.9201049804688, 0.0, 652.867919921875, 0.0, 0.0, 926.822021484375, 359.2794189453125, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi: 
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False
---

D:表示相机的失真系数,其参数分别是(k1, k2, t1, t2, k3)
K:内参矩阵,其参数(fx,0,cx,0,fy,cy,0,0,1)
R: 3*3的旋转矩阵,仅对双目相机有效,使左右极线平行
P: 投影矩阵,其参数分别是(fx’,0,cx’, Tx,0,fy,‘cy’,Ty,0,0,1,0)在单目相机中, T x = T y = 0 Tx=Ty=0 Tx=Ty=0

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ubuntu20.08下获取realsense内参 的相关文章

  • Ubuntu20.04+MAVROS+PX4+Gazebo保姆级安装教程

    Ubuntu20 04 43 MAVROS 43 PX4 43 Gazebo 安装PX4步骤安装MAVROS安装QGCPX4仿真 安装PX4步骤 从github上clone源码 span class token function git s
  • Ubuntu18.04安装realsense viewer

    一 下载realsense安装包 mkdir p librealsense install cd librealsense install git clone b v2 31 0 https github com IntelRealSens
  • 一行代码安装Tensorflow GPU Ubuntu20.04 Windows

    本文内容 xff1a Ubuntu20 04下使用Anaconda 配置Tensorflow GPU环境 Windows操作系统也可行 xff0c 换成Win下的anaconda安装方法即可 Why conda xff1f 使用conda安
  • intel realsense SR300 深度图像和彩色图像对齐

    深度图像和彩色图像对齐 原因 xff1a 由于RGB图像数据与深度图像数据的空间坐标系是不同的 xff0c 前者的原点是RGB摄像头 xff0c 后者的原点是红外摄像头 xff0c 因此两者会有相应的误差 没对齐之前的结果如下图所示 xff
  • Intel Realsense Tracking Camera T265上手测试与总结

    首先在官网 https www intelrealsense com zh hans get started tracking camera 上认真阅读使用教程 xff0c 让自己对 Realsense T265相机有一个初步的认识 了解过
  • Intel RealSense D435i 深度相机介绍

    参考 xff1a https www sohu com a 340984033 715754https www chiphell com thread 1945054 1 1 htmlhttps blog csdn net cherry y
  • Ubuntu20.04/Ubuntu22.04 配置VScode+Opencv+cmake(C++)

    下面介绍Ubuntu20 04下安装opencv xff0c 当然Ubuntu22 04也适用 xff0c 然后将opencv链接到VsCode 先主体按照 gt 点我 xff1a 链接1 lt 的第一点进行安装 xff0c 但是特别注意
  • realsense r200使用过程记录

    realsense r200 相机 采用的结构光 43 双目立体视觉 xff0c 使用可以使用室外场景 xff0c 但是有些注意的事项 xff0c 该款相机在sdk 方面貌似总有些bug 相比之前的测过的zed astra kinectv1
  • Virtual Box+Ubuntu20.04+ROS2 Foxy配置

    ROS从最早的正式版本Box Turtle到现在也十几年了 而ROS2出来也挺久了 xff0c 一直没机会看看 好久也没弄ROS xff0c 这几天捣鼓了捣鼓 目录 1 Virtual Box安装Ubuntu20 04 2 ROS2 Fox
  • Ubuntu18.04 Realsense D435i驱动安装与配置

    InterRealSenseD435i SDK安装 一 命令行的安装方式安装 1 注册服务器的公钥 xff1a 打开终端输入 sudo apt key adv keyserver keys gnupg net recv key C8B3A5
  • Ubuntu20.04LTS下安装Intel Realsense D435i驱动与ROS包

    文章目录 目标一 D435i简介二 环境配置三 RealSense的SDK2 0安装四 ROS包安装五 摄像机CV的ROS包节点 六 问题排查 目标 在Ubuntu20 04LTS系统下安装D435i的驱动SDK2和ROS包 xff0c 实
  • Ubuntu20.04 论文CCNet:语义分割的交叉注意力 复现

    Ubuntu20 04 论文CCNet 语义分割的交叉注意力 复现 一 安装显卡驱动 1 1 源代码 1 2 驱动安装 二 环境配置 2 1 Anaconda3下创建新环境 2 2 安装CUDA10 2 2 3 安装cuDNN 三 编译 3
  • 运行Intel realsense L515相机

    运行Intel realsense L515相机 首先去官 https www intelrealsense com sdk 2 xff0c 按照上面的提示安装各种文件 xff0c 然后输入realsense viewer出现可视化窗口 下
  • 在ubuntu20.04上配置VINS_Fusion(亲测有效,一应俱全)

    最近在做科研训练的时候配置了HKUST Aerial Robotics实验室的VINS Fusion代码项目 xff0c 经历了一些编译报错的问题 xff0c 在网上查找的时候博客内容良莠不齐 xff0c 且实质针对性意见不多 xff0c
  • realsense d435i标定imu与camera

    realsense d435i标定imu与camera 1 标定目的 realsense d435i包含两个红外相机 红外发射器 RGB相机和IMU四个模块 xff0c 显然四个传感器的空间位置是不同的 xff0c 我们在处理图像和IMU数
  • 在ubuntu20.4下安装ardupilot 4.3.6

    这次重新安装真的是遇到了好多坑啊 xff01 从github上靠过来按照之前的那篇文章流程做完之后 xff0c 还会有一些别的问题 首先是module里面的包都没有拷过来 xff0c 所以需要用git add将文件都添加过来 之后进行编译时
  • Ubuntu 18.04 ———(Intel RealSense D435i)运行VINS-Mono

    Intel RealSense D435i 一 准备工作二 修改参数rs camera launchrealsense color config yaml 参考文献 一 准备工作 1 Intel Realsense D435i Ubuntu
  • ubuntu20.04 安装 WPS 2019

    ubuntu自带的文字处理软件对来自windows下office或在WPS创建的ppt有点不兼容 xff0c 看到WPS有linux版本的 xff0c 便果断安装试一试 一 卸载原生liboffice sudo apt get remove
  • 【Ubuntu】Ubuntu20.04安装NVIDIA Container Toolkit

    基于Apollo的CUDA的docker镜像需要依赖于NVIDIA Container Toolkit xff0c 运行以下命令安装NVIDIA Container ToolKit xff1a distribution 61 etc os
  • 【ORB_SLAM】Ubuntu20.04 配置ORB_SLAM3

    本文主要记录基于Ubuntu20 04环境下 xff0c 对普通的ORB SLAM3和稠密版本的ORB SLAM3进行环境的配置 一 配置ORB SLAM3 lt 普通版本 gt 1 安装ROS开发环境 这里采用鱼香ros的一键安装 xff

随机推荐