0
$\begingroup$

Rosanswers logo

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" / -->
  &ltinclude 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" />    
&ltrosparam 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" />
&ltrosparam 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.


Originally posted by billy on ROS Answers with karma: 1850 on 2016-07-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think it should work. In your move_base.launch, you have to have the following lines somewhere:

...
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
   ...
   <rosparam file="$(find your_package)/config/base_local_planner_params.yaml" command="load"/>
   ...
</node>
...

I write ... to notify the rest of your launch file which is not important concerning your problem.
Of course, you have to fill your yaml file as follows:

...
TrajectoryPlannerROS:
   ...
    controller_frequency: 15.0
   ...

And now, it should work properly. You can check the existence of the parameter using the command rosparam list | grep controller_frequency and you can check its value using the command rosparam get "the output of the previous command" which is supposed to return 15.0.

I hope it will help you,
lfr


Originally posted by lfr with karma: 201 on 2016-07-29

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by billy on 2016-07-29:
Thanks for providing help. The rosparam get helped me see that the line in the local planner yaml file doesn't over write the move_base parameter. I have updated the question with additional info.

Comment by lfr on 2016-08-01:
It worked successfully, /move_base/TrajectoryPlannerROS/controller_frequency had been set to 15.0. If you want to modify /move_base/controller_frequency, then add controller_frequency: 15.0 before the TrajectoryPlannerROS: line in your yaml file (and with the same indentation).

Comment by billy on 2016-08-03:
Yes. That did it. Thanks for your help! It needed to go before the TrajectoryPlannerROS: line.

Comment by lfr on 2016-08-03:
You're welcome

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.