hokuyo_node kobuki
kinect 2D_Slam 参考链接: http://wiki.ros.org/turtlebot_navigation/Tutorials/Build%20a%20map%20with%20SLAM
hector_slam 参考连接: http://my.phirobot.com/blog/2014-06-hector_mapping_example.html
3)gmapping 制栅格地图
4)amcl 定位。roslaunch turtlebot_bringup minimal.launch
2.gmapping
roslaunch turtlebot_navigation gmapping_demo.launch注:。turtlebot的例子主要是利用kinect的深度信息模拟激光数据进行二维地图的构建。现在只需将传感器节点换成hokuyo 的节点,并配置好相应的参考系与传感信息发布数据的话题。基本上就可以整体运行起来。
ps: 这部分需要将启动的传感器3dsenser(kinect) 改成laser. hokuyo
添加文件hokuyo_2d_sensor.launch
**界面式查kobuki的电量(先运行节点):rosrun rqt_gui rqt_gui
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~roslaunch kobuki_keyop keyop.launch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</launch>
2. 文件 /home/agv/kobuki_ws/src/turtlebot/turtlebot_bringup/launch/2dsensor.launch
<launch>
<arg name="2dsensor" default="$(optenv SENSOR_2D hokuyo)"/>
<!-- rplidar, hokuyo -->
<arg name="use_filter" default="$(optenv USE_FILTER false)"/>
<include file="$(find exbotxi_bringup)/launch/includes/$(arg 2dsensor)_2d_sensor.launch.xml">
<arg if="$(arg use_filter)" name="scan_topic" value="scan_raw" />
<arg name="laser_frame" value="laser_link" />
<!-- if need change port -->
<!--arg name="laser_port" value="/dev/ttyUSB1" /-->
</include>
<include if="$(arg use_filter)" file="$(find exbotxi_bringup)/launch/includes/laser_filter.launch.xml">
<arg name="scan_in" value="scan_raw"/>
<arg name="scan_out" value="scan"/>
</include>
</launch>
3. 文件 /home/agv/kobuki_ws/src/turtlebot/turtlebot_bringup/launch/include/hokuyo_2d_sensor.launch.xml
<launch>
<arg name="scan_topic" default="/scan" />
<arg name="laser_frame" default="kobuki" />
<arg name="laser_port" default="/dev/ttyACM0" />
<node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node">
<param name="port" type="string" value="$(arg laser_port)"/>
<param name="min_ang" value="-1.7" />
<param name="max_ang" value="1.7" />
<param name="min_range" value="0.18" />
<param name="hokuyo_node/calibrate_time" value="true" />
<param name="frame_id" value="$(arg laser_frame)" />
<remap from="scan" to="$(arg scan_topic)"/>
</node>
</launch>
补充: 坐标系的问题。 1 turtlebot_world.launch <include file="$(find turtlebot_gazebo)/launch/includes/$(arg base).launch.xml"> 1.1 kobuki.launch.xml <arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot_description)/robots/$(arg base)_$(arg stacks)_$(arg 3d_sensor).urdf.xacro'" /> <param name="robot_description" command="$(arg urdf_file)" /> 1.1.1 rplidar.urdf.xacro <xacro:macro name="sensor_rplidar" params="parent"> <joint name="laser" type="fixed"> <origin xyz="0.15 0.0 0.15" rpy="0 0.0 0.0" /> <parent link="base_link" /> <child link="base_laser_link" /> </joint> 熟悉下urdf文件的的相应语法。。 坐标系的相对关系。父子坐标系 旋转与平移。