Search code examples
rosslam

How to change the default number of particles in gmapping launch file?


I would like to ask is this is the correct coding to change the number of particles of the gmapping package in launch file?

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/>
  <arg name="set_base_frame" default="base_footprint"/>
  <arg name="set_odom_frame" default="odom"/>
  <arg name="set_map_frame"  default="map"/>

  <!-- Gmapping -->
  <node pkg="gmapping" type="slam_gmapping" name="turtlebot3_slam_gmapping" output="screen">
    <param name="base_frame" value="$(arg set_base_frame)"/>
    <param name="odom_frame" value="$(arg set_odom_frame)"/>
    <param name="map_frame"  value="$(arg set_map_frame)"/>
    <param name="particles"  value="100"/>
    <rosparam command="load" file="$(find turtlebot3_slam)/config/gmapping_params.yaml" />
  </node>
</launch>

Im adding <param name="particles" value="100"/> as above. Thank you.


Solution

  • Yes it is correct. The coding that you have done in the launch file is the correct code. But, you also can change the number of particles in the file="$(find turtlebot3_slam)/config/gmapping_params.yaml"