<?xml version="1.0"?>

<launch>

    <arg name="scanner" default="scanner" />

    <!-- Publish as laserscan-->
    <node pkg="rostopic" type="rostopic" args="pub $(arg scanner)/scan sensor_msgs/LaserScan -r 10
      '{header: {frame_id: scan},
        angle_min: -1.0, angle_max: 1.0, angle_increment: 0.1,
        range_max: 10.0,
        ranges: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}'" name="scan_publisher" />

    <!-- run nodelet manager -->
    <node pkg="nodelet" type="nodelet" name="$(arg scanner)_nodelet_manager" args="manager" />

    <!-- run laserscan_to_pointcloud nodelet -->
    <node pkg="nodelet" type="nodelet" name="laserscan_to_pointcloud" args="load pointcloud_to_laserscan/laserscan_to_pointcloud_nodelet $(arg scanner)_nodelet_manager">

        <remap from="scan_in" to="$(arg scanner)/scan"/>
        <remap from="cloud" to="$(arg scanner)/cloud"/>
        <rosparam>
            target_frame: scan # Leave disabled to output pointcloud in scan frame
            transform_tolerance: 0.01

            # 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>
