文章目录
- 概要
- 安装pointcloud_to_laserscan
- 修改配置
- 运行结果
概要
在ROS中将点云(PointCloud)转换为激光扫描(LaserScan)是一个常见的任务,尤其是在某些机器人系统中,激光雷达数据被用于导航和避障,但传感器输出的是点云数据。这种转换可以通过 pointcloud_to_laserscan 包实现,该包提供了一个节点,可以将接收到的PointCloud2消息转换成LaserScan消息。
安装pointcloud_to_laserscan
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone -b lunar-devel https://github.com/ros-perception/pointcloud_to_laserscan.git
cd ..
catkin_make
修改配置
<?xml version="1.0"?>
<launch>
<!-- run pointcloud_to_laserscan node -->
<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
<remap from="cloud_in" to="/lio_sam/deskew/cloud_deskewed"/>
<rosparam>
target_frame: base_link_est # Leave disabled to output scan in pointcloud frame
transform_tolerance: 0.01
min_height: -0.5
max_height: 0.2
angle_min: -3.1415926 # -M_PI
angle_max: 3.1415926 # M_PI
angle_increment: 0.003 # M_PI/360.0
scan_time: 0.1
range_min: 0.3
range_max: 50
use_inf: true
inf_epsilon: 1.0
# Concurrency level, affects number of pointclouds queued for processing and number of threads used
# 0 : Detect number of cores
# 1 : Single threaded
# 2->inf : Parallelism level
concurrency_level: 1
</rosparam>
</node>
</launch>