【move_base功能包运行问题总结】

move_base功能包运行问题总结

在这里记录运行move_base功能包的时候,遇到一些问题,进行记录。

使用下列launch文件来调用move_base功能包。

<?xml version="1.0"?>

<launch>
    <arg name="use_rviz" default="false" />
    <!-- for amcl -->
    <arg name="init_x" default="0.0" />
    <arg name="init_y" default="0.0" />
    <arg name="init_a" default="0.0" />
    <arg name="base" default="$(optenv TIANRACER_BASE compact)" />
    <!-- for Map server -->
    <arg name="map" default="$(find f1tenth_simulator)/maps/torino.yaml"/>


    <!-- Map server -->
    <node pkg="map_server" name="map_server" type="map_server" args="$(arg map)"/>

    <!-- Localization -->
    <!-- AMCL -->
    <include file="$(find f1tenth_navigation)/launch/amcl.launch.xml">
        <arg name="init_x" value="$(arg init_x)"/>
        <arg name="init_y" value="$(arg init_y)"/>
        <arg name="init_a" value="$(arg init_a)"/>
    </include>

    <!--  Navigation -->
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <rosparam file="$(find f1tenth_navigation)/param/move_base_params.yaml" command="load"/>
        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/global_costmap_params.yaml" command="load" />

        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/compact_teb_local_planner_params.yaml" command="load" />
        <rosparam file="$(find f1tenth_navigation)/param/teb_carlike/global_planner_params.yaml" command="load" />

        <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
        <param if="$(eval base=='compact')" name="footprint" value="[[0.34,0.1],[0.34,-0.1],[-0.05,-0.1],[-0.05,0.1]]" />
        <param if="$(eval base=='standard')" name="footprint" value="[[0.42,0.14],[0.42,-0.14],[-0.12,-0.14],[-0.12,0.14]]" />
        <param if="$(eval base=='fullsize')" name="footprint" value="[[0.8,0.27],[0.8,-0.27],[-0.2,-0.27],[-0.2,0.27]]" />
        <param name="clearing_rotation_allowed" value="false" /> Our carlike robot is not able to rotate in place
    </node>

    <!-- cmd_vel to ackermann_cmd -->
    <node pkg="f1tenth_navigation" type="cmd_vel_to_ackermann_drive.py" name="vel_to_ackermann" >
        <param name="twist_cmd_topic" value="/cmd_vel" />
        <param name="ackermann_cmd_topic" value="/drive" />
        <param if="$(eval base=='compact')" name="wheelbase" value="0.255" />
        <param if="$(eval base=='standard')" name="wheelbase" value="0.33" />
        <param if="$(eval base=='fullsize')" name="wheelbase" value="0.6" />
    </node>

    <!--  Visualisation -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find f1tenth_navigation)/teb_navigation.rviz" if="$(arg use_rviz)" />

</launch>

问题1

问题:
Couldn’t transform from base_laser_link to base_footprint, even though the message notifier is in use

解决方法:

将 amcl_params.yaml 中 base_frame_id 和车体保持一致 base_link


问题2

问题:
Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: source_frame base_footprint does not exist… canTransform returned after 0.100814 timeout was 0.1.

原因:坐标系不统一

解决方法:

  1. 找到参数文件:所调用的全局和局部地图的参数文件为global_costmap_params.yamllocal_costmap_params.yaml
    在这里插入图片描述
  2. 将两个文件中的坐标系robot_base_frame修改为base_link
    在这里插入图片描述
  3. 若调用amcl功能包,则amcl配置文件中的base_frame_id也改为base_link
    在这里插入图片描述

问题3

问题:

[ ERROR] [1669281693.716503087, 871.669000000]: Extrapolation Error: Lookup would require extrapolation -0.044000000s into the future. Requested time 871.665000000 but the latest data is at time 871.621000000, when looking up transform from frame [odom] to frame [map]

[ [ERROR] [1669281693.716542307, 871.669000000]: Global Frame: odom Plan Frame size 156: map

原因:

  1. 两个控制器之间的时间不同步。 但是我是在仿真上做的,不存在这种情况。

  2. 修改代价地图参数。

解决方法:

修改地图更新频率。将local_costmap_params.yanlglobal_costmap_params.yaml文件中的参数update_frequency修改为5.0

在这里插入图片描述

在这里插入图片描述


问题4

问题:
[ERROR] [1678257648.538376817]: Extrapolation Error: Lookup would require extrapolation into the future. Requested time 1678257648.500453419 but the latest data is at time 1678257648.498552861, when looking up transform from frame [odom] to frame [map]

[ERROR] [1678257648.538445254]: Global Frame: odom Plan Frame size 517: map

[ WARN] [1678257648.538480014]: Could not transform the global plan to the frame of the controller

在这里插入图片描述

解决方法:

查找资料后,
有人说是move_base功能包装错了版本,重新安装就可以解决。但是我装的版本没问题。
有人说是 /map 中有空地图传入,注释掉传入空地图的发布节点。但是我只有一处 map_server,并且地图没有重复。

最后看到有人说,原因是局部代价地图里程计坐标系错误local_costmap_params.yaml,将第二行global_frame: odom 改成 global_frame: map,我改完后可以成功运行了。

在这里插入图片描述


问题5

问题:

The origin for the sensor at (0.28, 0.00, 0.00) is out of map bounds. So, the costmap cannot raytrace for it.

参考:
https://answers.ros.org/question/9845/move_base-warning-sensor-out-of-bounds/

解决方法:

global_costmap_params.yaml 中的参数 rolling_window 改为 true

或者在 global_costmap_params.yaml 中添加参数 static_map: true,也可以正常运行。

此处与问题6相矛盾,后发现是地图格式的问题。使用图片导入地图时,图片格式为.pgm,不能为.png。将png格式转换为pgm后,还是会报相同的错误,原因是pgm格式有标准的形式,转换后的格式不标准,所以会报错。解决方法:pgm格式的图片可以使用slam方法规划后,使用命令保存获得,也可以使用画图工具手动绘制。

地图格式正确后,将 global_costmap_params.yaml 中的参数 rolling_window 改为 false

正确的pgm格式
在这里插入图片描述
错误的pgm格式
在这里插入图片描述


问题6

问题 :
在设置路径点后,无法规划路径,且报错:
Clearing both costmaps to unstuck robot (1.84m).
Aborting because a valid plan could not be found. Even after executing all recovery behaviors

在这里插入图片描述
若进行以下操作:

  1. 在距离当前车辆较近位置设备目标点,无报错,顺利到达。
  2. 较远位置设置目标点,报错(上图),无法到达。

这篇文章分析有原因和解决方法问题在于当机器人有旋转的动作时,所有的可选轨迹就会变很短,从而导致机器人的速度变得很小。如果提高了机器人的速度上限,可以在某种程度上增加机器人有旋转动作时的移动速度。我在提高了参数 acc_lim_xacc_lim_theta后还是没有解决上述问题。

最后自己摸索,将 global_costmap_params.yaml 中的参数 rolling_window 改为 false ,后没有报错,且目标点距离较远时也可以规划路径。

但是此处与问题5相矛盾。

猜你喜欢

转载自blog.csdn.net/qq_45878098/article/details/129403648