From b822a16142dce9da1e84a55713733fccfb113c28 Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Mon, 27 Jan 2020 13:26:27 +0100
Subject: [PATCH] Update pointcloud_to_laserscan launch file: parameters load
 from params/pointcloud_to_laserscan.yaml file

---
 launch/include/pointcloud_to_laserscan.launch | 21 ++-----------------
 params/pointcloud_to_laserscan.yaml           | 18 ++++++++++++++++
 2 files changed, 20 insertions(+), 19 deletions(-)
 create mode 100644 params/pointcloud_to_laserscan.yaml

diff --git a/launch/include/pointcloud_to_laserscan.launch b/launch/include/pointcloud_to_laserscan.launch
index bbc0542..37f6a23 100644
--- a/launch/include/pointcloud_to_laserscan.launch
+++ b/launch/include/pointcloud_to_laserscan.launch
@@ -3,6 +3,7 @@
 <launch>
 
   <arg name="ns"            default="robot"/>
+  <arg name="config_file"   default="$(find iri_ana_rosnav)/params/pointcloud_to_laserscan.yaml" />
   <arg name="scan_topic"    default="$(arg ns)/scan"/>
   <arg name="cloud_topic"   default="$(arg ns/points"/>
   <arg name="output" default="screen" />
@@ -17,25 +18,7 @@
           launch-prefix="$(arg launch_prefix)">
       <remap from="/$(arg ns)/scan"     to="$(arg scan_topic)"/>
       <remap from="/$(arg ns)/cloud_in" to="$(arg cloud_topic)"/>
-      <rosparam>
-          target_frame: "" #camera_link # Leave disabled to output scan in pointcloud frame
-          transform_tolerance: 0.01
-          min_height: -0.125
-          max_height: 0.125
-          angle_min: -3.14159 #-1.5708 # -M_PI/2
-          angle_max: 3.14159  #1.5708 # M_PI/2
-          angle_increment: 0.0087 # M_PI/360.0
-          scan_time: 0.3333
-          range_min: 0.1
-          range_max: 40.0
-          use_inf: true
-
-          # 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>
+      <rosparam file="$(arg config_file)" command="load" />
     </node>
     
   </group>
diff --git a/params/pointcloud_to_laserscan.yaml b/params/pointcloud_to_laserscan.yaml
new file mode 100644
index 0000000..c717652
--- /dev/null
+++ b/params/pointcloud_to_laserscan.yaml
@@ -0,0 +1,18 @@
+target_frame: ""
+# Leave target_frame disabled to output scan in pointcloud frame
+transform_tolerance: 0.1
+min_height: -0.1
+max_height: 0.5
+angle_min: -3.14159 #-1.5708 # -M_PI/2
+angle_max: 3.14159  #1.5708 # M_PI/2
+angle_increment: 0.0087 # M_PI/360.0
+scan_time: 0.3333
+range_min: 0.1
+range_max: 40.0
+use_inf: true
+
+# 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
\ No newline at end of file
-- 
GitLab