ROS实验笔记之——Intel Realsense l515激光相机的使用

news/2024/11/17 20:32:30/

最近实验室购买了Intel Realsense l515相机。本博文记录使用过程~

 驱动安装

先到官网安装驱动:https://github.com/IntelRealSense/realsense-roshttps://github.com/IntelRealSense/realsense-ros安装realsense2_camera

sudo apt-get install ros-melodic-realsense2-camera

然后运行下面命令启动相机

roslaunch realsense2_camera rs_camera.launch

看看所能出来的topic信息

/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/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/extrinsics/depth_to_color
/camera/l500_depth_sensor/parameter_descriptions
/camera/l500_depth_sensor/parameter_updates
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static

若要显示点云,可运行

roslaunch realsense2_camera rs_camera.launch filters:=pointcloud

通过rviz来可视化(主要要显示点云信息需要将frame改为camera link)

运行下面节点来将深度信息与图像align

roslaunch realsense2_camera rs_camera.launch align_depth:=true

也可以通过image view来显示

rosrun rqt_image_view rqt_image_view

 

 

SLAM测试

之前博客《ROS实验笔记之——XBOX Kinect2 的使用及基于RTAB-MAP的建图》介绍过基于Kinect2的SLAM建图,这里试试用l515的效果~

安装rtabmap

sudo apt-get install ros-melodic-rtabmap-ros
rosrun rtabmap_ros pointcloud_to_depthimage cloud:=/camera/depth/color/points camera_info:=/camera/color/camera_info image_raw:=/camera/depth/image_rect_raw image:=/camera/color/image_raw _approx:=false _fill_holes_size:=2roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" depth_topic:=/camera/depth/image_rect_raw

无法使用。。topic完全不一样。。。

点进去,发现有rtabmap的launch文件

roslaunch realsense2_camera rs_rtabmap.launch

改为下面的试试

roslaunch realsense2_camera rs_rgbd.launch

然后通过改topic名字来实现rtabmap,发现还是不可以。。。。

# ISSUE: Use unite_imu_method:="copy" if imu topics keep stopping
$ roslaunch realsense2_camera rs_camera.launch \align_depth:=true \unite_imu_method:="linear_interpolation" \enable_gyro:=true \enable_accel:=true$ rosrun imu_filter_madgwick imu_filter_node \_use_mag:=false \_publish_tf:=false \_world_frame:="enu" \/imu/data_raw:=/camera/imu \/imu/data:=/rtabmap/imu

安装

sudo apt-get install ros-melodic-imu-tools

即可~使用imu(imu_filter_madgwick - ROS Wiki)

GitHub - ccny-ros-pkg/imu_tools: ROS tools for IMU devices

然后运行

$ rosrun nodelet nodelet standalone rtabmap_ros/point_cloud_xyz \_approx_sync:=false  \/depth/image:=/camera/depth/image_rect_raw \/depth/camera_info:=/camera/depth/camera_info \_decimation:=4$ roslaunch rtabmap_ros rtabmap.launch\rtabmap_args:="\--delete_db_on_start \--Icp/VoxelSize 0.05 \--Icp/PointToPlaneRadius 0 \--Icp/PointToPlaneK 20 \--Icp/CorrespondenceRatio 0.2 \--Icp/PMOutlierRatio 0.65 \--Icp/Epsilon 0.005 \--Icp/PointToPlaneMinComplexity 0 \--Odom/ScanKeyFrameThr 0.7 \--OdomF2M/ScanMaxSize 15000 \--Optimizer/GravitySigma 0.3 \--RGBD/ProximityPathMaxNeighbors 1 \--Reg/Strategy 1" \icp_odometry:=true \scan_cloud_topic:=/cloud \subscribe_scan_cloud:=true \depth_topic:=/camera/aligned_depth_to_color/image_raw \rgb_topic:=/camera/color/image_raw \camera_info_topic:=/camera/color/camera_info \approx_sync:=false \wait_imu_to_init:=true \imu_topic:=/rtabmap/imu 

成功!感觉本质上就是学会怎么改好topic就行了,理解清楚每个topic的意义

使用如下服务可以用于从一个干净的数据库开始建图

rosservice call /rtabmap/reset

如果地图的背景变成红色,那是因为里程表丢失了。访问丢失的里程表(红色屏幕!)部分,了解为什么会发生这种情况!为了再次跟踪里程表,更换相机到红色出现前的最后一个位置,它应该能够重新计算里程表。另一种方法是重置里程表使用菜单选项““Edit->Reset odometry””(注意,一个新的地图创建每次里程表重置)。参见里程表自动复位另一种方法来处理里程表丢失(重置和继续相同的地图)。

若要加上定位,则运行

roslaunch rtabmap_ros rtabmap.launch\rtabmap_args:="\--delete_db_on_start \--Icp/VoxelSize 0.05 \--Icp/PointToPlaneRadius 0 \--Icp/PointToPlaneK 20 \--Icp/CorrespondenceRatio 0.2 \--Icp/PMOutlierRatio 0.65 \--Icp/Epsilon 0.005 \--Icp/PointToPlaneMinComplexity 0 \--Odom/ScanKeyFrameThr 0.7 \--OdomF2M/ScanMaxSize 15000 \--Optimizer/GravitySigma 0.3 \--RGBD/ProximityPathMaxNeighbors 1 \--Reg/Strategy 1" \icp_odometry:=true \scan_cloud_topic:=/cloud \subscribe_scan_cloud:=true \depth_topic:=/camera/aligned_depth_to_color/image_raw \rgb_topic:=/camera/color/image_raw \camera_info_topic:=/camera/color/camera_info \approx_sync:=false \wait_imu_to_init:=true \imu_topic:=/rtabmap/imu \localization:=true

基于intel realsense l515激光相机的rtabmap

用kinect效果

roslaunch kinect2_bridge kinect2_bridge.launch
roslaunch kinect2_bridge kinect2_bridge_custom_rviz_hd.launch
roslaunch rtabmap_ros rgbd_mapping_kinect2.launchroslaunch kinect2_bridge kinect2_bridge.launch pulish_tf:=truerosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link kinect2_link 100 roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rgb_topic:=/kinect2/qhd/image_color_rect depth_topic:=/kinect2/qhd/image_depth_rect camera_info_topic:=/kinect2/qhd/camera_info 

rtabmap

rtabmap

参考资料

GitHub - IntelRealSense/realsense-ros: Intel(R) RealSense(TM) ROS Wrapper for D400 series, SR300 Camera and T265 Tracking Module

Realsense L515初次使用记录_复古蓝的博客-CSDN博客

运行Intel realsense L515相机_cyx610481953的博客-CSDN博客librealsense/distribution_linux.md at master · IntelRealSense/librealsense · GitHub运行Intel realsense L515相机_cyx610481953的博客-CSDN博客

rtabmap RGB-D相机手持建图_m0_46530321的博客-CSDN博客
http://wiki.ros.org/rtabmap_ros


http://www.ppmy.cn/news/416455.html

相关文章

【RealSense】L515学习记录

Intel RealSense™ SDK 2.0的安装 1、注册服务器的公钥: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8…

Realsense L515初次使用记录

1、realsense驱动安装及ros下驱动的安装,参考网上资料,非常之多,和D435i驱动安装一样。 2、打开realsense L515相机 realsense-viewer可以看到如下效果: 3、通过ROS打开 运行:roslaunch realsense2_camera rs_cam…

Win10 RealSense L515 ORBSLAM2 配置全攻略

目录 背景简介Step 1 准备 SDKStep 2 连接设备Step 3 测试例程Step 4 配置环境Step 5 相机标定Step 6 编写入口Step 7 实地运行附录A:获取内参代码附录B:yaml 参数文件附录C:入口程序 背景简介 最近几天项目到达收尾阶段,需要在真…

html515vb,APx515 音频分析仪

APx515 可以在 3 秒时间内完成所有关键的音频参数的测?。 尽管 它的成本低?,但同样具有杰出的性能表现,与所有 APx 系?的音频分 析仪一样,典型的-106dB THDN, 24 位、1M FFT 能? (选件),支持 192k 采样?的数字接口、一键自动…

LeetCode二叉树系列——515.最每个树行中找最大值

一、题目描述: 515. 在每个树行中找最大值 难度中等265收藏分享切换为英文接收动态反馈 给定一棵二叉树的根节点 root ,请找出该二叉树中每一层的最大值。 二.题解 对二叉树不了解的,可以先看第三部分的分析 /*** Definition for a binar…

leetcode:515. 在每个树行中找最大值

题目来源 515. 在每个树行中找最大值 题目描述 题目解析 层次遍历 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val val; }* Tree…

5.3图的综合应用算法(最小生成树、最短路径生成)

一.最小生成树算法 1.概念(Minimum-Spanning-Tree)MST 生成树:针对于连通图,包含全部顶点,去掉一条边后不连通,加一条边形成环 最小生成树:带权连通无向图,边的权值之和最小的生成树(MST) 2.…

破解软件,破解软件下载

今天给大家带来一款破解软件。很多朋友问我要破解软件,说百度上找不到。今天找了半天,放出破解软件下载地址: http://pan.baidu.com/share/link?shareid2056602630&uk4231428855 PS:金山卡巴神马的都不报毒,360杀…