树莓派+hokuyo激光+gmapping+navigation
来源:互联网 发布:60魔兽世界数据库 编辑:程序博客网 时间:2024/05/18 09:03
树莓派+hokuyo激光+gmapping+navigation
准备工作:
下载turtlebot_apps、hokuyo_node包,并编译到自己创建的工作空间。
1.添加hokuyo激光设备规则文件
激光插入树莓派,查看hokuyo激光的pid和vid:
$lsusb
可以看到有一行为:
bus 001 Device 024 : ID 15d1:0000
如果看不出自己激光的pid和vid,那就拔掉激光,再运行lsusb,看下少了哪行东东,少的那行就是激光的pid和vid。
那么15d1:0000就是要看的东东
然后创建规则文件,输入如下命令新建一个激光的规则:
$cd /etc/udev/rules.d
$sudo vi /50-hokuyo.rules
在新建的50-hokuyo.rules文件中输入如下内容:
KERNEL=“ttyACM[0-9]*”, ACTION=="add", ATTRS{idVendor}=="15d1", MODE="0666", GROUP="dialout", SYMLINK+="hokuyo"
保存退出,(如果觉得vi不好用的话,可现在桌面建个文档,再cp过去也可以)
增加当前用户对串口的默认访问权限:
$sudo usermod -a -G dialout 用户名(我的用户名为zhy)
使规则生效:
$sudo server udev reload
$sudo server udev restart
这时插上激光,则
$ls /dev
会发现多出一个hokuyo的设备名,如果没看到则重启一下。
2.在turtlebot_navigation/laser目录下写一个启动激光的launch文件,文件命名为hokuyo_laser.launch
内容为:
<launch>
<node name="hokuyo" pkg="hokuyo_node" type="hokuyo_node" respawn="false" output="screen">
<!-- Starts up faster, but timestamps will be inaccurate. -->
<param name="calibrate_time" type="bool" value="false"/>
<!-- Set the port to connect to here -->
<param name="port" type="string" value="/dev/hokuyo"/>
<param name="frame_id" type="string" value="laser"/>
<param name="intensity" type="bool" value="false"/>
</node>
<node name="base_to_laser" pkg="tf" type="static_transform_publisher" args="0.11 0.00 0.23 0 0.0 0.0base_link laser 100"/>
</launch>
3.添加建图功能
修改turtlebot_navigation/launch/gmapping_demo.launch文件,修改后的内容如下:
<launch>
<!--laser driver-->
<include file="$(find turtlebot_navigation)/laser/hokuyo_laser.launch" />
<!-- Gmapping -->
<arg name="custom_gmapping_launch_file" default="$(find turtlebot_navigation)/launch/includes/gmapping/gmapping.launch.xml"/>
<include file="$(arg custom_gmapping_launch_file)"/>
<!-- Move base -->
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
</launch>
3.添加导航功能
修改turtlebot_navigation/launch/amcl_demo.launch文件,修改后的内容如下:
<launch>
<!--laser driver-->
<include file="$(find turtlebot_navigation)/laser/hokuyo_laser.launch" />
<!-- Map server -->
<arg name="map_file" default="/home/zhy/map.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<!-- AMCL -->
<arg name="custom_amcl_launch_file" default="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml"/>
<arg name="initial_pose_x" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
<arg name="initial_pose_y" default="0.0"/> <!-- Use 17.0 for willow's map in simulation -->
<arg name="initial_pose_a" default="0.0"/>
<include file="$(arg custom_amcl_launch_file)">
<arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
<arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
<arg name="initial_pose_a" value="$(arg initial_pose_a)"/>
</include>
<!-- Move base -->
<include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml">
</include>
</launch>
4.启动建图
启动底盘:
$roslaunch turtlebot_bringup minimal.launch
启动gmapping:
$roslaunch turtlebot_navigation gmapping_demo.launch
启动rviz
$roslaunch turtlebot_rviz_launchers view_navigation.launch
保存地图:
$rosrun map_server map_saver -f /home/zhy/map
4.启动导航
将上面那些都关掉
启动底盘:
$roslaunch turtlebot_bringup minimal.launch
启动nav:
$roslaunch turtlebot_navigation amcl_demo.launch
启动rviz
$roslaunch turtlebot_rviz_launchers view_navigation.launch
- 树莓派+hokuyo激光+gmapping+navigation
- turtlebot gmapping with Hokuyo
- ROS配置HOKUYO激光
- 激光测距仪hokuyo-ug01与ros
- Cartographer连接激光-hokuyo UTM-30LX
- (ros/navigation/gmapping)导航/建地图
- (ros/navigation/gmapping)导航/建地图
- (ros/navigation/gmapping)导航/建地图
- 用数据集跑激光slam,gmapping/karto
- Gmapping、hector、Cartographer三种激光SLAM算法简单对比
- gmapping
- 树莓派采集HOKUYO激光雷达数据
- hokuyo 01LX激光传感器驱动程序的安装和创建地图时出现的问题
- 2D-slam 激光slam: 开源代码的比较HectorSLAM Gmapping KartoSLAM CoreSLAM LagoSLAM
- 2D-slam 激光slam: 开源代码的比较HectorSLAM Gmapping KartoSLAM CoreSLAM LagoSLAM
- 2D-slam 激光slam: 开源代码的比较HectorSLAM Gmapping KartoSLAM CoreSLAM LagoSLAM
- turtlebot(hydro)学习笔记四:turtlebot上hokuyo UTM-30LX激光扫描仪的添加及导航
- ros的navigation之———gmapping应用详解(in ros)
- 一张图搞定Android开发学习路线
- 线段树入门
- python-TypeError: write() argument must be str, not numpy.float64
- JPush极光推送Java服务器端实例
- Array与ArrayBuffer的区别
- 树莓派+hokuyo激光+gmapping+navigation
- connect by
- Single Number 系列
- 大数据—工具箱
- Oracle自学之基本语法
- 64位Ubuntu安装海思交叉编译工具后用不了的解决办法
- centos7 cmake 安装
- GitHub入门(3)PHPstorm git配置
- 一个项目经理的贪嗔痴