ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Navigation stack, where to set controller_frequency?

asked 2016-07-29 01:18:39 -0500

billy gravatar image

updated 2016-07-29 23:59:37 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-07-29 02:40:27 -0500

lfr gravatar image

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

edit flag offensive delete link more

Comments

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.

billy gravatar image billy  ( 2016-07-29 23:46:55 -0500 )edit

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).

lfr gravatar image lfr  ( 2016-08-01 02:03:19 -0500 )edit

Yes. That did it. Thanks for your help! It needed to go before the TrajectoryPlannerROS: line.

billy gravatar image billy  ( 2016-08-03 00:57:44 -0500 )edit

You're welcome

lfr gravatar image lfr  ( 2016-08-03 01:40:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-29 01:18:39 -0500

Seen: 2,445 times

Last updated: Jul 29 '16