使用pointcloud_to_laserscan包实现三维转二维

有效解决catkin_make报错,roslaunch找不到包的问题

1,安装pointcloud_to_laserscan包

cd ~/catkin_ws/src
git clone https://github.com/BluewhaleRobot/pointcloud_to_laserscan.git

cd ~/catkin_ws
catkin_make

2,创建launch文件

cd ~/catkin_ws/src/pointcloud_to_laserscan/launch
gedit point_to_scan.launch

在打开的文本中输入如下:

<?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="/rslidar_points"/>
        
        <rosparam>
            # target_frame: rslidar # Leave disabled to output scan in pointcloud frame
            transform_tolerance: 0.01
            min_height: -0.4
            max_height: 1.0

            angle_min: -3.1415926 # -M_PI
            angle_max: 3.1415926 # M_PI
            angle_increment: 0.003 # 0.17degree
            scan_time: 0.1
            range_min: 0.2
            range_max: 100
            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>

这里需要注意的是这句代码:<remap from="cloud_in" to="/rslidar_points"/>。因为激光雷达节点发布的信息是/rslidar_points,因此需要将pointcloud_to_laserscan的订阅信息从默认的cloud_in改为/rslidar_points。
3,启动pointcloud_to_laserscan节点

roslaunch pointcloud_to_laserscan point_to_scan.launch

如果roslaunch不到节点,则:

rospack find pointcloud_to_laser 

然后接可以了,亲测有效!!!!!!!!!!!!

  • 2
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值