对于ROS小车导航算法基本原理和使用方法,可以看笔记http://t.csdn.cn/NUWHt
1 启动小车导航节点:turn_on_wheeltec_robot navigation.launch
<launch>
<!-- 开启机器人底层相关节点 同时开启导航功能-->
<include file="$(find turn_on_wheeltec_robot)/launch/turn_on_wheeltec_robot.launch">
<arg name="navigation" default="true"/>
</include>
<!-- turn on lidar开启雷达 -->
<include file="$(find turn_on_wheeltec_robot)/launch/wheeltec_lidar.launch" />
<!-- 设置需要用于导航的地图 -->
<arg name="map_file" default="$(find turn_on_wheeltec_robot)/map/WHEELTEC.yaml"/>
<node name="map_server_for_test" pkg="map_server" type="map_server" args="$(arg map_file)">
</node>
<!-- 开启用于导航的自适应蒙特卡洛定位amcl-->
<include file="$(find turn_on_wheeltec_robot)/launch/include/amcl.launch" />
<!-- MarkerArray功能节点> -->
<node name='send_mark' pkg="turn_on_wheeltec_robot" type="send_mark.py">
</node>
</launch>
在launch文件中打开了以下launch文件:
1 turn_on_wheeltec_robot.launch
该文件启动了小车下位机电机控制节点,小车urdf文件及TF坐标,扩张卡尔曼滤波算法(robot_pose_ekf.launch 用于处理里程计信号),和建图导航算法
2 wheeltec_lidar.launch
该文件启动激光雷达相关功能
3 /map/WHEELTEC.yaml
该文件为地图的yaml文件,在小车建图中创建,这里我们默认打开文件名WHEELTEC,如果要切换导航地图可以在这里修改文件名
4 amcl.launch
该文件启动amcl定位算法,在launch/include 文件夹里的amcl.launch文件:
<launch>
<!-- <arg name="set_initpose" default="true"> -->
<!-- 使用map的topic而不是map文件-->
<arg name="use_map_topic" default="false"/>
<!-- 不可以使用PointCloud,只能使用LaserScan -->
<arg name="scan_topic" default="scan"/>
<arg name="map_topic" default="/map"/>
<node pkg="amcl" type="amcl" name="amcl" clear_params="true">
<!-- <rosparam command="load" file="$(find turn_on_wheeltec_robot)/map/WHEELTEC_end.yaml" />-->
<param name="use_map_topic" value="$(arg use_map_topic)"/>
<!-- 使用rtabmap分布的Map,连接TF树 -->
<remap from="/map" to="/$(arg map_topic)"/>
<!-- Publish scans from best pose at a max of 10 Hz -->
<param name="odom_model_type" value="omni-corrected"/>
<!-- <param name="odom_model_type" value="omnid"/> -->
<!-- <param name="odom_model_type" value="diff"/> -->
<!-- <param name="odom_model_type" value="diff-corrected"/> -->
<param name="odom_alpha5" value="0.1"/>
<param name="gui_publish_rate" value