Navigation stack, where to set controller_frequency?
I feel silly asking this, but where do I set the controller frequency for move_base when using the navigation stack?
I have the navigation stack running and robot can be commanded from one place to another. It's not elegant or smooth so now I am trying to tune it.
The default value for controller_frequency is 20.0 but I'd like to set it to lower as I don't even get odometry at 20Hz, much less the lidar data. It makes no sense to send commands faster than odom comes in. I get the warning "Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.2001 seconds"
For test I have tried "controller_frequency: 15.0" in the move_base.launch and the base_local_planner_params.yaml files, but still get warning that control loop doesn't achieve 20.0Hz, so I know the setting at 15.0 isn't working.
Don't get me wrong, I do not care about the warning, but the warning makes it clear that the way I am trying to set it isn't working. Once I figure out how to set it I will find the exact value that works best.
UPDATE after ifr's comment. The parameter I added to the base_local_planner_params file does get created but doesn't impact the move_base controller frequency.
With the launch running there are three different controller_frequencys:
linux@linux-Latitude-D630:~$ rosparam get /amcl/controller_frequency 13 linux@linux-Latitude-D630:~$ rosparam get /move_base/TrajectoryPlannerROS/controller_frequency 15.0 linux@linux-Latitude-D630:~$ rosparam get /move_base/controller_frequency 20.0 linux@linux-Latitude-D630:~$
Below is the params and launch file.
<launch> <master auto="start"/> <!-- Run the map server --> <!-- node name="map_server" pkg="map_server" type="map_server" args="$(find my_robot_name_2dnav)/map.pgm map_resolution"/ --> <arg name="map_file" default="$(find my_robot_name_2dnav)/map.yaml"/> <!-- Run the map server --> <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" /> <!--- Run AMCL --> <!-- include file="$(find amcl)/examples/amcl_diff.launch" / --> <include file="$(find my_robot_name_2dnav)/amcl_diff.launch" /> <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"> <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" /> <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap"/> <rosparam file="$(find my_robot_name_2dnav)/local_costmap_params.yaml" command="load" /> <rosparam file="$(find my_robot_name_2dnav)/global_costmap_params.yaml" command="load" /> <rosparam file="$(find my_robot_name_2dnav)/base_local_planner_params.yaml" command="load" /> </node> </launch>
local_base_planner_params file
TrajectoryPlannerROS: max_vel_x: 0.1 min_vel_x: 0.005 max_vel_theta: 0.8 min_in_place_vel_theta: 0.05 acc_lim_theta: 3.2 acc_lim_x: 2.5 acc_lim_y: 2.5 escape_vel: -0.1 holonomic_robot: false latch_xy_goal_tolerance: false meter_scoring: true pdist_scale: 0.8 gdist_scale: 0.8 occdist_scale: 0.01 heading_lookahead: 0.5 heading_scoring: false heading_scoring_timestep: 0.8 dwa: false publish_cost_grid_pc: true global_frame_id: odom oscillation_reset_dist: 0.05 prune_plan: true controller_frequency: 15.0
Any help is appreciated.