Ask Your Question
0

Control loop missed its desired rate of 20.0000Hz... the loop actually took 0.1600 seconds

asked 2020-11-13 19:04:51 -0600

al_ca gravatar image

updated 2020-11-15 06:16:30 -0600

Hi there,

why is this happening after I send a nav goal?

<launch>

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find amcl)/rviz/amcl.rviz"/>

    <!-- Map server -->
    <arg name="map_file" default="$(find amcl)/maps/test_map.yaml"/>
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

    <node pkg="amcl" type="amcl" name="amcl">

        <!-- Publish scans from best pose at a max of 10 Hz -->
        <remap from="scan" to="scan_multi"/>
        <param name="odom_model_type" value="omni"/>
        <param name="base_frame_id" value="base_footprint"/>
        <param name="update_min_d" value="0.5"/>
        <param name="update_min_a" value="1.0"/>
        <param name="odom_alpha5" value="0.1"/>
        <param name="transform_tolerance" value="0.2" />
        <param name="gui_publish_rate" value="10.0"/>
        <param name="laser_max_beams" value="30"/>
        <param name="min_particles" value="500"/>
        <param name="max_particles" value="5000"/>
        <param name="kld_err" value="0.05"/>
        <param name="kld_z" value="0.99"/>
        <param name="odom_alpha1" value="0.2"/>
        <param name="odom_alpha2" value="0.2"/>
        <!-- translation std dev, m -->
        <param name="odom_alpha3" value="0.8"/>
        <param name="odom_alpha4" value="0.2"/>
        <param name="laser_z_hit" value="0.5"/>
        <param name="laser_z_short" value="0.05"/>
        <param name="laser_z_max" value="0.05"/>
        <param name="laser_z_rand" value="0.5"/>
        <param name="laser_sigma_hit" value="0.2"/>
        <param name="laser_lambda_short" value="0.1"/>
        <param name="laser_lambda_short" value="0.1"/>
        <param name="laser_model_type" value="likelihood_field"/>
        <!--     <param name="laser_model_type" value="beam"/> -->
        <param name="laser_likelihood_max_dist" value="2.0"/>
        <param name="update_min_d" value="0.2"/>
        <param name="update_min_a" value="0.5"/>
        <param name="odom_frame_id" value="odom"/>
        <param name="resample_interval" value="1"/>
        <param name="transform_tolerance" value="0.3"/>
        <param name="recovery_alpha_slow" value="0.0"/>
        <param name="recovery_alpha_fast" value="0.0"/>

    </node>


    <!-- Move base -->
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

       <rosparam file="$(find amcl)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
       <rosparam file="$(find amcl)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
       <rosparam file="$(find amcl)/config/local_costmap_params.yaml" command="load" />
       <rosparam file="$(find amcl)/config/global_costmap_params.yaml" command="load" />
       <rosparam file="$(find amcl)/config/trajectory_planner.yaml" command="load" />

       <remap from="cmd_vel" to="cmd_vel"/>
       <remap from="odom" to="odom"/>
       <remap from="scan" to="scan_multi"/>
       <param name="move_base/DWAPlannerROS/yaw_goal_tolerance" value="1.0"/>
       <param name="move_base/DWAPlannerROS/xy_goal_tolerance" value="1.0"/>

    </node>

</launch>

global_costmap:

global_frame: map
robot_base_frame: base_footprint
update_frequency: 5.0
publish_frequency: 2.0
width: 15
height: 15
rolling_window: true
inflation_radius: 0.1
resolution: 0.1
plugins: 
    - {name: static_layer,       type: "costmap_2d::StaticLayer"}

local_costmap:

global_frame: odom
robot_base_frame: base_footprint
update_frequency: 5
publish_frequency: 5
rolling_window: true
width: 3
height: 3
resolution: 0.1
inflation_radius: 0.1
plugins: 
    - {name: static_layer,       type: "costmap_2d::StaticLayer"}
    - {name: obstacle_layer,      type: "costmap_2d::ObstacleLayer"}

costmap_common params:

obstacle_range: 2.5
raytrace_range: 3.0
robot radius: 0.5
map_topic: map
subscribe_to_updates: true
observation_sources ...
(more)
edit retag flag offensive close merge delete

Comments

and how can I display right this XML file?

al_ca gravatar image al_ca  ( 2020-11-13 19:22:26 -0600 )edit
1

can you show your local costmap params? How big of a local map are you using? It's entirely possible that your computer indeed can't handle 20Hz, especially if using a large-ish local map.

chfritz gravatar image chfritz  ( 2020-11-13 19:59:34 -0600 )edit

Here you are, I updated my post. Where can I see the size of the map?

al_ca gravatar image al_ca  ( 2020-11-14 09:41:55 -0600 )edit

How fast does your odom come in? Laser scan?

billy gravatar image billy  ( 2020-11-14 20:25:14 -0600 )edit

I updated my question... I forgot to mention that I am running a simulation if that helps. From what I see odom is 16.847 Hz and the laser scans are 10k Hz.

al_ca gravatar image al_ca  ( 2020-11-15 06:22:16 -0600 )edit

Do you need 20Hz? If not, I would just reduce it to 10Hz (presumably in trajectory_planner).

chfritz gravatar image chfritz  ( 2020-11-15 11:04:42 -0600 )edit

I suspect you mean the data rate is 10kHz, but what is scan rate? How many laser scan messages published in ROS a second?

billy gravatar image billy  ( 2020-11-15 17:05:04 -0600 )edit

There is no parameter to set the trajectory planner freequency DWAPlannerROS: path_distance_bias: 80.0 TrajectoryPlannerROS: max_vel_x: 0.4 min_vel_x: -0.4 max_vel_theta: 10.0 min_vel_theta: -7.0 min_in_place_vel_theta: 10 acc_lim_theta: 2.5 acc_lim_x: 2.5 acc_lim_y: 2.5 holonomic_robot: false

jj_in gravatar image jj_in  ( 2020-11-17 07:44:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-20 12:36:13 -0600

al_ca gravatar image

I fixed the problem by increasing the values of sim_time and a little bit of sim_granularity the parameters of the TrajectoryPlannerROS. I am not sure how this fixed my problem... but I suppose it lowered the computational cost.

Thank you all of you for your time to help me

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-13 19:04:51 -0600

Seen: 65 times

Last updated: Nov 20