ROS机器人高效编程(原书第3版)封面

在做第六章 导航功能包集进阶的实验:

执行下列命令:

$ roslaunch chapter6_tutorials chapter6_configuration_gazebo.launch
$ roslaunch chapter6_tutorials move_base.launch

 出现警告:

[ WARN] [1482245396.760593833]: Control loop missed its desired rate  of 20.0000Hz… the loop actually took 0.0665 seconds 
[ WARN] [1482245396.767846009]: Control loop missed its desired rate of 20.0000Hz… the loop actually took 0.0834 seconds

原因分析:

网上的解释是配置文件配置过高,机器cpu能力不足,配置文件并未改过。可能有个默认的Control loop missed its desired rate 为20Hz,那就把这个参数改小吧。

解决方案:

在move_base.launch 文件中添加参数赋值:

添加了这两句参数赋值,设置与电脑性能相称的参数值:

    <param name="controller_frequency" value="10.0"/> 
    <param name="controller_patiente" value="15.0"/>

move_base.launch 文件完整内容:

<?xml version="1.0"?>

<launch>

  <!-- Run the map server -->
   <node name="map_server" pkg="map_server" type="map_server" args="$(find chapter6_tutorials)/maps/map.yaml" output="screen"/>

  <include file="$(find amcl)/examples/amcl_diff.launch" >
  </include> 

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="controller_frequency" value="10.0"/> 
    <param name="controller_patiente" value="15.0"/>
    <rosparam file="$(find chapter6_tutorials)/launch/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find chapter6_tutorials)/launch/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find chapter6_tutorials)/launch/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find chapter6_tutorials)/launch/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find chapter6_tutorials)/launch/base_local_planner_params.yaml" command="load" />
  </node>
   <node name="rviz" pkg="rviz" type="rviz" args="-d $(find chapter6_tutorials)/launch/navigation.rviz" /> 

</launch>

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐