From 852ab483efdade3e2980b641818aa9ccc93a5597 Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Fri, 2 Jul 2021 16:36:50 +0200
Subject: [PATCH] Add mapping launch and update mapping yaml parameters

---
 launch/nav_mapping.launch | 56 +++++++++++++++++++++++++++++++++++++++
 params/gmapping.yaml      | 28 +++++++++++++-------
 2 files changed, 74 insertions(+), 10 deletions(-)
 create mode 100644 launch/nav_mapping.launch

diff --git a/launch/nav_mapping.launch b/launch/nav_mapping.launch
new file mode 100644
index 0000000..e231bd5
--- /dev/null
+++ b/launch/nav_mapping.launch
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!-- -->
+<launch>
+  <arg name="name"                    default="turtlebot"/>
+  <arg name="path"                    default="$(find iri_turtlebot_launch)/params"/>
+  <arg name="move_base_params"        default="move_base_params.yaml"/>
+  <arg name="costmap_common_params"   default="common_params.yaml"/>
+  <arg name="costmap_local_params"    default="local_params.yaml"/>
+  <arg name="costmap_global_params"   default="global_params.yaml"/>
+  <arg name="map_frame_id"            default="map"/>
+  <arg name="resolution"              default="0.1"/>
+  <arg name="local_planner"           default="dwa"/>
+  <arg name="global_planner"          default="global_planner"/>
+  <arg name="rviz"                    default="true"/>
+  <arg name="rviz_file"               default="$(find iri_turtlebot_launch)/rviz/nav.rviz"/>
+  <arg name="output"                  default="screen" />
+  <arg name="launch_prefix"           default="" />
+
+  <include file="$(find iri_rosnav)/launch/nav.launch">
+    <arg name="ns"                    value="$(arg name)"/>
+    <arg name="path"                  value="$(arg path)"/>
+    <arg name="move_base_params"      value="$(arg move_base_params)"/>
+    <arg name="costmap_common_params" value="$(arg costmap_common_params)"/>
+    <arg name="costmap_local_params"  value="$(arg costmap_local_params)"/>
+    <arg name="costmap_global_params" value="$(arg costmap_global_params)"/>
+    <arg name="map_frame_id"          value="map"/>
+    <arg name="odom_frame_id"         value="odom"/>
+    <arg name="base_frame_id"         value="base_footprint"/>
+    <arg name="map_topic"             value="/$(arg name)/map"/>
+    <arg name="map_service"           value="/$(arg name)/static_map"/>
+    <arg name="odom_topic"            value="/odom"/>
+    <arg name="cmd_vel_topic"         value="/cmd_vel_mux/input/navi"/>
+    <arg name="scan_topic"            value="/scan"/>
+    <arg name="use_map"               value="true"/>
+    <arg name="use_map_server"        value="false"/> 
+    <arg name="map_name"              value="empty"/>
+    <arg name="use_amcl"              value="false"/>
+    <arg name="use_fake_loc"          value="false"/>
+    <arg name="use_gmapping"          value="true"/>
+    <arg name="gmapping_scan_topic"   value="/scan"/>
+    <arg name="gmapping_config"       value="$(find iri_turtlebot_launch)/params/gmapping.yaml"/>
+    <arg name="resolution"            value="$(arg resolution)"/>
+    <arg name="local_planner"         value="$(arg local_planner)"/>
+    <arg name="global_planner"        value="$(arg global_planner)"/>
+    <arg name="output"                value="$(arg output)" />
+    <arg name="launch_prefix"         value="$(arg launch_prefix)" />
+  </include>
+
+  <node name="rviz"
+        pkg="rviz"
+        type="rviz"
+        if="$(arg rviz)"
+        args="-d $(arg rviz_file)">
+  </node>
+
+</launch>
diff --git a/params/gmapping.yaml b/params/gmapping.yaml
index d7c5f34..8df1df3 100644
--- a/params/gmapping.yaml
+++ b/params/gmapping.yaml
@@ -1,5 +1,11 @@
-map_update_interval: 5.0
-maxUrange: 29.0
+#name: value #default_value
+
+throttle_scans: 1
+#base_frame: base_link
+#map_frame: map
+#odom_frame: odom
+map_update_interval: 1.0 #5.0
+maxUrange: 7.8 #80.0
 sigma:      0.05
 kernelSize: 1
 lstep:      0.05
@@ -8,23 +14,25 @@ iterations: 5
 lsigma:     0.075
 ogain:      3.0
 lskip: 0
+minimumScore: 0.0 #0.0
 srr: 0.1
 srt: 0.2
 str: 0.1
 stt: 0.2
-linearUpdate:      0.5
-angularUpdate:     0.5
-temporalUpdate:    10.0
+linearUpdate:      0.1 #1.0
+angularUpdate:     0.05 #0.5
+temporalUpdate:    1.0 #-1.0
 resampleThreshold: 0.5
-particles:         80
-
+particles:         80 #30
 xmin: -5.0
 ymin: -5.0
 xmax:  5.0
 ymax:  5.0
-
-delta: 0.1
+delta: 0.05 #0.05
 llsamplerange: 0.01
 llsamplestep:  0.01
 lasamplerange: 0.005
-lasamplestep:  0.005
\ No newline at end of file
+lasamplestep:  0.005
+transform_publish_period: 0.05
+occ_thresh: 0.25
+maxRange: 8.5
-- 
GitLab