【EHub_tx1_tx2_E100】Ubuntu18.04 + ROS_ Melodic + 银牛R132深度相机(如何在该环境下打开摄像机获取rgb/深度图/点云)

13 篇文章 0 订阅
4 篇文章 0 订阅

简介:介绍银牛微电子 3D 机器视觉R132相机 在EHub_tx1_tx2_E100载板,TX1核心模块环境(Ubuntu18.04)下测试ROS驱动,打开摄像头图像和查看深度图和点云图,本文的前提条件是你的TX1里已经安装了ROS版本:Melodic。关于测试硬件EHub_tx1_tx2_E100载板请查看:EdgeBox_EHub_tx1_tx2_E100 开发板评测_机器人虎哥的博客-CSDN博客

        大家好,我是虎哥,最近都在看如何更好的实现机器人的避障,补死角的方案,查阅了好几款深度相机的方案,正好手里还有之前采购的银牛 的R132模组,有感于网上对于上手就可以简单玩起来的说明比较少,所以总结一下自己的简单测试经验,分享给大家。

官网入口是:模组-银牛微电子(无锡)有限责任公司 官网资料有限。

目录

一、 银牛 “R132“ 深度相机

1.1 关键参数:

二、WIN 下测试流程

2.1 驱动安装:

1、安装驱动 步骤

2.2 SDK及 Inuview工具 安装

2.3 Inuview工具 测试相机

1、活动流选择显示深度数据:

2、活动流选择显示RGB数据:

3、活动流选择显示IMU数据:

三、ROS 下测试流程

4.1 拷贝代码

4.2 插入模组USB至板子

4.3 安装官方程序

4.4 测试启动

4.5 RVIZ 显示IMU数据

4.6 rqt_image_view RGB、红外、深度图

4.7 RVIZ RGB、红外、深度图

四. 只启动相机驱动的LAUNCH修改

修改


一、 银牛 “R132“ 深度相机

主要配置

■ 基于IR主动有源立体深度传感器

■ 0.2-4米深度测量范围

■ 宽视场角(88°x 58°FoV)

■ RGB 摄像头传感器,与深度传感器对齐

■ 采用Inuitive的NU4000多核计算机视觉与三维图像处理器

■ 经过详尽的内外参标定的机载惯性测量单元(IMU)

■ 功率低、体积小

■ 高速USB-Type C主机接口(USB 3.0)

■ 高速MIPI CSI 2.0主机接口

■ 支持Windows、Linux和Android OSs 操作系统

■ 可在所有照明条件下工作(从夜晚到白昼)

■ 应用程序接口,使应用层的设计变得更容易

1.1 关键参数:

  详细手册获取网站入口:客户支持-银牛微电子(无锡)有限责任公司

二、WIN 下测试流程

需要资料和对应软件,需要联系厂家直接要就可以。首先在WIN端测试,需要安装驱动程序。R132是一种即插即用的USB装置,包含一个专用的驱动程序。

2.1 驱动安装:

没安装驱动程序前,将R132的USB口接入测试电脑:

1、安装驱动 步骤

双击InuDriver_3.0.7.0-1.09_Setup_X64进行驱动安装。

 一路默认next即可。

 安装完毕后,即可以再自己电脑设备管理器看到设备了。

2.2 SDK及 Inuview工具 安装

可以参考文档:腾讯文档

双击InuDev_Pro_4.16.0006.30_X64进行工具安装

 然后一路NEXT就可以。

 支持工具软件安装完毕。

2.3 Inuview工具 测试相机

打开InuView工具

 

 验证位于窗口右上角的USB连接器图标是否为蓝色。

  • 蓝色USB图标:模组已连接并正在运行

  • 灰色USB图标:模组未连接或未激活

默认显示红外数据,我们通过活动窗口流选择可以显示不同通道的数据:

 

1、活动流选择显示深度数据:

2、活动流选择显示RGB数据:

3、活动流选择显示IMU数据:

 

三、ROS 下测试流程

4.1 拷贝代码

#解压包
unzip Linux-arm64-Ubuntu18.04-ros.zip

官方目录中有安装步骤,要先执行了:

#插入模组:
1,sudo dpkg -i inudev-simplified_4.16.0006.30_arm64.deb
2,sudo dpkg -i ros-melodic-inudev-ros-nodelet_1.0.18-0bionic_arm64.deb
3,export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Inuitive/InuDev/lib
4,roslaunch /opt/ros/melodic/share/inudev_ros_nodelet/launch/inudev_ros_nodelet.launch

4.2 插入模组USB至板子

4.3 安装官方程序

cd ~/Inuchip_ws/Linux-arm64-Ubuntu18.04-ros
sudo dpkg -i inudev-simplified_4.16.0006.30_arm64.deb

sudo dpkg -i ros-melodic-inudev-ros-nodelet_1.0.18-0bionic_arm64.deb

4.4 测试启动

需要显示器界面支持,我使用nomachine 链接我的板子的。

#设置库应用路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Inuitive/InuDev/lib
#启动传感器测试驱动
roslaunch /opt/ros/melodic/share/inudev_ros_nodelet/launch/inudev_ros_nodelet.launch

        启动之后,会弹出3个窗口,这个应该是官方为了方便测试所留的。可以全部3个窗口都关掉,不影响后续测试。

        这个页面,官方预留的可以用来可视化调整一些参数看。可以全部3个窗口都关掉,不影响后续测试。

 关掉不影响后续测试。

新开一个终端:

rosnode list
    /inudev_ros_nodelet
    /link_broadcaster
    /nodelet_manager
    /rosout
    /rqt_console
    /rqt_reconfigure
 
rostopic list
    /camera/aligned_depth_to_color/image_raw
    /camera/aligned_depth_to_color/image_raw/compressed
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_updates
    /camera/aligned_depth_to_color/image_raw/compressedDepth
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_updates
    /camera/aligned_depth_to_color/image_raw/theora
    /camera/aligned_depth_to_color/image_raw/theora/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/theora/parameter_updates
    /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
    /depth/depth2pc
    /disparity/sensor_msgs/Image/Video/disparity
    /features/camera/fisheye/features
    /imu/sensor_msgs/Imu
    /inudev_ros_nodelet/parameter_descriptions
    /inudev_ros_nodelet/parameter_updates
    /nav_msgs/sensor_msgs/Path
    /nodelet_manager/bond
    /pointcloud/sensor/PointCloud2
    /rosout
    /rosout_agg
    /sensor_msgs/Image/Fisheye
    /sensor_msgs/Image/Fisheye/compressed
    /sensor_msgs/Image/Fisheye/compressed/parameter_descriptions
    /sensor_msgs/Image/Fisheye/compressed/parameter_updates
    /sensor_msgs/Image/Fisheye/compressedDepth
    /sensor_msgs/Image/Fisheye/compressedDepth/parameter_descriptions
    /sensor_msgs/Image/Fisheye/compressedDepth/parameter_updates
    /sensor_msgs/Image/Fisheye/theora
    /sensor_msgs/Image/Fisheye/theora/parameter_descriptions
    /sensor_msgs/Image/Fisheye/theora/parameter_updates
    /sensor_msgs/Image/Video/left/camera_info
    /sensor_msgs/Image/Video/left/image
    /sensor_msgs/Image/Video/right/camera_info
    /sensor_msgs/Image/Video/right/image
    /sensor_msgs/Image/camera_info
    /tf
    /vision_msgs/vision_msgs/Detections

4.5 RVIZ 显示IMU数据

# 如果刚才没有关相机节点,下面可以跳过,如果已经关闭,记得开一个终端,打开相机节点
#设置库应用路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Inuitive/InuDev/lib
#启动传感器测试驱动
roslaunch /opt/ros/melodic/share/inudev_ros_nodelet/launch/inudev_ros_nodelet.launch
在一个新的终端,可以看到IMU话题和数据

# 新开一个节点,打开RVIZ
rosrun rviz rviz

Rviz中点击左下角Add添加rviz_imu_plugin,可以看见有坐标系出现,如果没有需要安装 (sudo apt-get install ros-melodic-imu-tools 安装imu功能包)

 这个时候你再动相机,圆锥箭头就开始动了。

可以保留这个RVIZ配置:

4.6 rqt_image_view RGB、红外、深度图

上面已经打开了测试节点,此处行开一个终端,启动rqt_image_view

rosrun rqt_image_view rqt_image_view 

RGB图:

 红外图:

 一看深度信息图,就会报错:

 暂时没有搞清楚怎么回事。

4.7 RVIZ RGB、红外、深度图

# 如果刚才没有关相机节点,下面可以跳过,如果已经关闭,记得开一个终端,打开相机节点
#设置库应用路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Inuitive/InuDev/lib
#启动传感器测试驱动
roslaunch /opt/ros/melodic/share/inudev_ros_nodelet/launch/inudev_ros_nodelet.launch
# 新开一个节点,打开RVIZ
rosrun rviz rviz

 

测试过程中记录了一下CPU的占用情况

四. 只启动相机驱动的LAUNCH修改

        每次启动官方的脚本文件,都需要进行关闭那些窗口的操作,实际我们使用,应该也很少开启那些窗口,我们可以选择自己写一个脚本本间来实现。

#启动传感器测试驱动
roslaunch /opt/ros/melodic/share/inudev_ros_nodelet/launch/inudev_ros_nodelet.launch

launch/inudev_ros_nodelet.launch 文件的原始内容:

<launch>
  <arg name="Service_ID"        default=""            />
  <arg name="tf_prefix"                 default=""                />
  <arg name="stereo_namespace"          default="stereo"          />
  <arg name="xyz_namespace"             default="cloudify"        />
  <arg name="manager"                   default="nodelet_manager" />
​
  <!-- "screen" or "log" -->
  <arg name="output"                    default="log"             />
​
  <arg name="verbose"                   default="true"            />
  
  <arg name="run_stereo_image_proc"     default="0"               />
​
  <arg name="run_disparity_to_depth"    default="0"               />
​
  <!-- controls display of InuSW vide/disparity output -->
  <arg name="run_image_view_video"      default="0"               />
​
  <!-- controls display of ROS video->disparity processing display -->
  <arg name="run_image_view_disparity"  default="0"               />
​
  <arg name="run_image_view_depth"      default="0"               />
​
  <arg name="run_image_view_fisheye"    default="0"               />
​
  <arg name="run_image_view_RGB"        default="0"               />
​
  <arg name="run_rqt_image_view"        default="0"               />
  <arg name="run_rviz"                  default="0"               />
​
  <arg name="run_depth2xyz"             default="0"               />
​
  <arg name="run_configure"             default="1"               />
​
  <!-- controls loading disparity processing as nodelet (this now works) -->
  <arg name="disparity_nodelet"         default="0"                 />
​
  <!-- controls disabling loading of unused image transports. -->
  <arg name="disable_unused_transports" default="1"                 />
​
  <!-- =================================== NO CONFIGURATION OPTIOS BELOW THIS POINT =================================== -->
​
  <rosparam file="$(find inudev_ros_nodelet)/cfg/InuRosParams$(arg Service_ID).yaml" />
​
  <!-- Topic remapping according to service ID -->
  <remap from="/camera/aligned_depth_to_color/image_raw" to="/camera/aligned_depth_to_color/image_raw$(arg Service_ID)" />
  <remap from="/camera/color/image_raw"                  to="/camera/color/image_raw$(arg Service_ID)"                  />
  <remap from="/sensor_msgs/Image/Video/right/image"     to="/sensor_msgs/Image/Video/right/image$(arg Service_ID)"     />
  <remap from="/sensor_msgs/Image/Video/left/image"      to="/sensor_msgs/Image/Video/left/image$(arg Service_ID)"      />
  <remap from="/sensor_msgs/Image/Video/disparity"       to="/sensor_msgs/Image/Video/disparity2$(arg Service_ID)"      />
  <remap from="/sensor/PointCloud"                       to="/sensor/PointCloud$(arg Service_ID)"                       />
  <remap from="/sensor_msgs/Image/Fisheye"               to="/sensor_msgs/Image/Fisheye$(arg Service_ID)"               />
  <remap from="/sensor_msgs/Path"                        to="/sensor_msgs/Path$(arg Service_ID)"                        />
  <remap from="/sensor_msgs/Imu"                         to="/sensor_msgs/Imu$(arg Service_ID)"                         />
  <remap from="/vision_msgs/Detections"                  to="/vision_msgs/Detections$(arg Service_ID)"                  />
  <remap from="/camera/fisheye/features"                 to="/camera/fisheye/features$(arg Service_ID)"                 />
​
  <group if="$(arg disable_unused_transports)" >
​
    <include file="$(find inudev_ros_nodelet)/launch/inudev_ros_nodelet_transport_disable.launch" ns="sensor_msgs/Image/Depth" />
    <include file="$(find inudev_ros_nodelet)/launch/inudev_ros_nodelet_transport_disable.launch" ns="sensor_msgs/Image/Webcam" />
​
    <include file="$(find inudev_ros_nodelet)/launch/inudev_ros_nodelet_all_transports_disable.launch" >
      <arg name="side" value="left" />
    </include>
​
    <include file="$(find inudev_ros_nodelet)/launch/inudev_ros_nodelet_all_transports_disable.launch" >
      <arg name="side" value="right" />
    </include>
​
  </group>
​
  <!-- create a console if output is *not* screen -->
  <node if="$(eval arg('output')!='screen')" pkg="rqt_console" type="rqt_console" name="rqt_console" />
​
  <!-- nodelet manager -->
  <node pkg="nodelet" type="nodelet" name="$(arg manager)" args="manager" output="$(arg output)" />
​
  <!-- this is Inuitive's ROS nodelet -->
  <node pkg="nodelet" type="nodelet" name="inudev_ros_nodelet$(arg Service_ID)" args="load inudev_ros_nodelet/CInuDevRosNodelet $(arg manager) TEST" output="$(arg output)" required="true">
    <param name="verbose" value="false" />
    <param name="log_pointcloud" value="false" />
  </node>
​
  <!-- view ROS info -->
  <node pkg="rqt_gui" type="rqt_gui" name="rqt_gui" />
​
  <!-- Static Transform Publisher -->
  <node pkg="tf" type="static_transform_publisher" name="link_broadcaster$(arg Service_ID)" args="0.0 0.0 0.0 0 0 0 /map /camera_link$(arg Service_ID) 100" />
​
  <node if="$(arg run_rqt_image_view)" pkg="rqt_image_view" type="rqt_image_view" name="rqt_image_view" output="$(arg output)" />
​
  <!-- display InuSW disparity output -->
  <node if="$(arg run_image_view_video)" pkg="image_view" type="stereo_view" name="image_view" args="_approximate_sync:=True" output="$(arg output)">
    <param name="~window_name" value="Video" />
    <remap from="stereo" to="/sensor_msgs/Image/Video" />
    <param name="queue_size" value="5" />
  </node>
​
  <!-- Display of ROS video->disparity processing output -->
  <node if="$(arg run_image_view_disparity)" pkg="image_view" type="stereo_view" name="disparity_view" output="$(arg output)">
    <param name="~window_name" value="Disparity" />
    <remap from="stereo" to="$(arg stereo_namespace)" />
    <remap from="image" to="image_color" />
  </node>
​
  <node if="$(arg run_image_view_depth)" pkg="image_view" type="image_view" name="depth_view" respawn="true" respawn_delay="30" output="$(arg output)">
    <param name="~window_name" value="Depth" />
    <remap from="image" to="/sensor_msgs/Image/Depth" />
  </node>
​
  <node if="$(arg run_image_view_fisheye)" pkg="image_view" type="image_view" name="fisheye_view" respawn="true" respawn_delay="30" output="$(arg output)">
    <param name="~window_name" value="Fisheye" />
    <remap from="image" to="/sensor_msgs/Image/Fisheye" />
  </node>
​
  <node if="$(arg run_image_view_RGB)" pkg="image_view" type="image_view" name="RGB_view" respawn="true" respawn_delay="30" output="$(arg output)">
    <param name="~window_name" value="RGB" />
    <remap from="image" to="/camera/color/image_raw" />
  </node>
​
  <node if="$(arg run_depth2xyz)" pkg="nodelet" type="nodelet" name="cloudify" args="load depth_image_proc/point_cloud_xyz $(arg manager)" output="$(arg output)">
     <remap from="sensor_msgs/Image" to="/sensor_msgs/Image/Depth" />
     <remap from="sensor_msgs/CameraInfo" to="/sensor_msgs/Image/camera_info" />
  </node>
​
  <node if="$(arg run_rviz)" pkg="rviz" type="rviz" name="rviz" />
​
  <group if="$(arg run_stereo_image_proc)" >
​
    <!--
      video to disparity processing
​
      We repawn, as stereo_image_proc will exit if the topics it expects are not being published. Note it will
      also not publish on its own, anless it's topics are subscribed to.
​
    -->
​
    <remap from="/$(arg stereo_namespace)/left/image_raw" to="/sensor_msgs/Image/Video/left/image" />
    <remap from="/$(arg stereo_namespace)/right/image_raw" to="/sensor_msgs/Image/Video/right/image" />
    <remap from="/$(arg stereo_namespace)/left/camera_info" to="/sensor_msgs/Image/Video/left/camera_info" />
    <remap from="/$(arg stereo_namespace)/right/camera_info" to="/sensor_msgs/Image/Video/right/camera_info" />
​
    <!--
        stereo image processing
     -->
​
    <node unless="$(arg disparity_nodelet)" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc" output="$(arg output)" ns="$(arg stereo_namespace)" respawn="true" respawn_delay="30" />
​
    <node if="$(arg disparity_nodelet)" pkg="nodelet" type="nodelet" name="stereo_image_proc" output="$(arg output)" ns="$(arg stereo_namespace)" respawn="true" respawn_delay="30" args="load stereo_image_proc/disparity $(arg manager) --bond" />
​
  </group>
​
  <node if="$(arg run_configure)" pkg="rqt_reconfigure" type="rqt_reconfigure" name="rqt_reconfigure" />
​
</launch>

修改

 修改后,启动试试:

 纠错,疑问,交流: 911946883@qq.com

  • 9
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论
rslidar_msg是一个ROS2环境下的雷达packet消息定义工程。要编译rslidar_msg,你可以按照以下步骤进行操作: 1. 首先,确保你已经成功编译了rslidar_sdk。你可以使用以下命令编译rslidar_sdk: ``` colcon build --packages-select rslidar_sdk ``` 2. 接下来,你需要在ROS2环境下同步rslidar_msg。你可以使用以下命令从网上同步rslidar_msg: ``` cd ~/RS_Helios_eloquentws/src git clone https://github.com/RoboSense-LiDAR/rslidar_msg ``` 3. 然后,你需要初始化和更新rslidar_sdk的子模块。你可以使用以下命令完成这一步骤: ``` cd rslidar_sdk git submodule init git submodule update ``` 4. 最后,你可以在RS_Helios_eloquentws目录下编译整个工程,包括rslidar-sdk和rslidar-msg。你可以使用以下命令完成编译: ``` cd ~/RS_Helios_eloquentws colcon build --packages-select rslidar-sdk rslidar-msg ``` 这样,你就可以成功编译rslidar_msg了。 #### 引用[.reference_title] - *1* [ROS2驱动速腾16线激光雷达](https://blog.csdn.net/weixin_56641176/article/details/131022156)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [【EHub_tx1_A200】Ubuntu18.04 + ROS-Melodic/ROS2-Elequent + 速腾 RS-Helios_16P雷达 评测](https://blog.csdn.net/cau_weiyuhu/article/details/130892684)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

机器人虎哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值