从scout_mini_navigation.launch出发进行修改,新建realworld.launch
<?xml version="1.0"?>
<launch>
<!-- use robot pose ekf to provide odometry-->
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<rosparam file="$(find scout_gazebo_sim)/param/amcl_params_diff.yaml" command="load" />
<param name="initial_pose_x" value="0"/>
<param name="initial_pose_y" value="0"/>
<param name="initial_pose_a" value="0"/>
</node>
<node pkg="map_server" type="map_server" name="map_server" args="$(find scout_gazebo_sim)/maps/workstastion.yaml" output="screen">
<param name="frame_id" value="map"/>
</node>
<!-- ************** Navigation *************** -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find scout_gazebo_sim)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find scout_gazebo_sim)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find scout_gazebo_sim)/param/local_costmap_params.yaml" command="load" />
<rosparam file="$(find scout_gazebo_sim)/param/global_costmap_params.yaml" command="load" />
<rosparam file="$(find scout_gazebo_sim)/param/planner.yaml" command="load" />
<param name="base_global_planner" value="global_planner/GlobalPlanner" />
<param name="planner_frequency" value="1.0" />
<param name="planner_patience" value="5.0" />
<param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS" />
<param name="controller_frequency" value="5.0" />
<param name="controller_patience" value="15.0" />
<param name="clearing_rotation_allowed" value="true" />
</node>
<!-- **************** Visualisation **************** -->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find scout_description)/rviz/scout_mini_navigation.rviz"/>
</launch>
分别启动底盘、激光雷达、pointcloud_to_laserscan,然后执行roslaunch scout_gazebo_sim realworld.launch命令,报错如下:
Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist. canTransform: source_frame base_link does not exist.. canTransform returned after 0.101055 timeout was 0.1.
[ WARN] [1734526538.146109970]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist. canTransform: source_frame base_link does not exist.. canTransform returned after 0.100187 timeout was 0.1.
[ WARN] [1734526539.081725641]: No laser scan received (and thus no pose updates have been published) for 1734526539.081694 seconds. Verify that data is being published on the /scan topic.
尝试查看rqt_graph
缺少odom信息,尝试打开tf_tree,报错no tf xxxx
目前想到的解决方法1:tf转换关系不对,或者是缺少odom信息,先尝试打开tf-tree,
添加以下语句,并注意语法和坐标系
<node pkg="tf" type="static_transform_publisher" name="map_base_transform"
args="0 0 0 0 0 0 map base_footprint 100"/>
解决方法2:忘了提供 2D 姿势或者加载的地图不对,重新建立工位的栅格(已验证,该方法无效)
解决方法3:因为之前删掉了launch文件中的robot_pose_ekf功能包部分,尝试将其重新加入
问题2:打开rviz,提示For frame [velodyne]: Fixed Frame [map] does not exist
将fixed frame替换成velodyne,Laserscan可以正常显示,但是map会报错
问题3:加入robot_pose_ekf功能包后,启动launch文件,报错如下:
[ERROR] [1587284286.565322789]: filter time older than odom message buffer
[ERROR] [1587284286.581064157]: Covariance specified for measurement on topic wheelodom is zero
使用rostopic echo /odom命令查看,确实covariance全为0
header:
seq: 100578
stamp:
secs: 1734536796
nsecs: 248238382
frame_id: "odom"
child_frame_id: "base_link"
pose:
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
twist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---