DunFenTiao / pku-hri-navigation

0 stars 0 forks source link

sensor : laser #4

Open DunFenTiao opened 6 years ago

DunFenTiao commented 6 years ago

rplidar a2

安装: sudo apt-get install ros-indigo-rplidar-ros 安装

测试: Check the authority of rplidar's serial-port :

ls -l /dev |grep ttyUSB

Add the authority of write: (such as /dev/ttyUSB0) (选择没有被占用的口) sudo chmod 666 /dev/ttyUSB0

Start a rplidar node and view the scan result in rviz.

$ roslaunch rplidar_ros view_rplidar.launch

DunFenTiao commented 6 years ago

配置了rplidar的别名。 制作启动文件。(http://www.ncnynl.com/archives/201611/1095.html)(这里端口为 ttyusb1)

测试激光雷达gmapping构建地图

上网本新开端口,打开roscore

$ roscore

上网本新开端口,启动turtlebot

$ roslaunch turtlebot_bringup minimal.launch

上网本新开端口,启动gmapping,用于构建地图

$ roslaunch turtlebot_navigation rplidar_gmapping_demo.launch

工作机或上网本新开端口,启动键盘操作Turtlebot

$ roslaunch turtlebot_teleop keyboard_teleop.launch

工作机或上网本新开端口,启动rviz,实时查看建图情况

$ roslaunch turtlebot_rviz_launchers view_navigation.launch

DunFenTiao commented 6 years ago

-√ok: todo: laser的gmapping定位。 进度 : 用test amcl jy.launch测试,不通过。没有map_server。 猜测:需要调节好rbx1_nav turtlebot_navigation的关系。

DunFenTiao commented 6 years ago

gmapping ok: hector slam

DunFenTiao commented 6 years ago

bug: cannot launch node of type [move_base/move_base]: can't locate node [move_base] in package [move_base]

slove:

The problem was caused by not cleaning up a bad build in my catkin_ws directories. I deleted move_base folders from catkin_ws/devel/ lib and share, along with many other navigation related directories that should not have been there. I then could launch move_base.launch

DunFenTiao commented 6 years ago

(参考http://wiki.ros.org/turtlebot_navigation/Tutorials/indigo/Autonomously%20navigate%20in%20a%20known%20map)

打开roscore

roscore //链接底盘 roslaunch rbx1_bringup turtlebot_minimal_kokubi.launch //键盘控制 roslaunch turtlebot_teleop keyboard_teleop.launch //连接激光雷达 roslaunch turtlebot_navigation rplidar_laser.launch //已知地图定位amcl roslaunch rbx1_nav tb_demo_amcl.launch map:=map.yaml //显示仿真 rosrun rviz rviz -d rospack find rbx1_nav/nav_test.rviz

DunFenTiao commented 6 years ago

构建地图结束保存地图

上网本新开端口,建立目录,保存地图

$ mkdir -p ~/map $ rosrun map_server map_saver -f ~/map/rplidar_gmapping $ ls ~/map #查看内容,包含rplidar_gmapping.pgm rplidar_gmapping.yaml

DunFenTiao commented 6 years ago

bug : rplidar转速过慢

slove:

ttl转usb处接触不良!

DunFenTiao commented 6 years ago

跑真机,建图OK比A1效果好,边缘清晰。建图快。

bug : 雷达坐标和机器人运动坐标反了。初始化的方向是反的。

bug: amcl显示有路线,但是机器人不动

单独运行movebase Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101179 timeout was 0.1.

bug Aborting because a valid plan could not be found. Even after executing all recovery behaviors

DunFenTiao commented 6 years ago

amcl成功!

roslaunch rbx1_bringup turtlebot_minimal_kokubi.launch roslaunch rplidar_ros rplidar_laser.launch roslaunch turtlebot_navigation amcl_test1.launch map:=c114.yaml roslaunch turtlebot_rviz_launchers view_navigation.launch

-地图放在maps/下面

DunFenTiao commented 6 years ago

定点成功!

python go_specific_pointc114.py 在rviz里面选择 point publish 记录下要去的点的前两个坐标。 在go specific point.py里面修改。

实现了三点之间能互相走