-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathROS笔记-11 Navigation.txt
executable file
·66 lines (47 loc) · 2.56 KB
/
ROS笔记-11 Navigation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
导航包含节点:
move_base: path planning
amcl: localization
Navigation 仿真
$ roscore
$ roslaunch rbx1_nav fake_nav_test.launch
AMCL without using odomedry (but laser_scan_matcher instead)
http://answers.ros.org/question/30124/amcl-without-using-odomedry-but-laser_scan_matcher-instead/
amcl transforms incoming laser scans to the odometry frame (~odom_frame_id).
So there must exist a path through the tf tree
from the frame in which the laser scans are published to the odometry frame.
fake_nav_test.launch:
<launch>
<param name="use_sim_time" value="false" />
<!-- Start the ArbotiX controller -->
<include file="$(find rbx1_bringup)/launch/fake_turtlebot.launch" />
<!-- Run the map server with the desired map -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find rbx1_nav)/maps/test_map.yaml"/>
<!-- The move_base node -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" clear_params="true" output="screen">
<rosparam file="$(find rbx1_nav)/config/fake/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find rbx1_nav)/config/fake/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find rbx1_nav)/config/fake/local_costmap_params.yaml" command="load" />
<rosparam file="$(find rbx1_nav)/config/fake/global_costmap_params.yaml" command="load" />
<rosparam file="$(find rbx1_nav)/config/fake/base_local_planner_params.yaml" command="load" />
<rosparam file="$(find rbx1_nav)/config/nav_test_params.yaml" command="load" />
</node>
<!-- Run fake localization compatible with AMCL output -->
<node pkg="fake_localization" type="fake_localization" name="fake_localization" output="screen" />
<!-- For fake localization we need static transform between /odom and /map -->
<node pkg="tf" type="static_transform_publisher" name="map_odom_broadcaster" args="0 0 0 0 0 0 /map /odom 100" />
<!-- Start the navigation test -->
<node pkg="rbx1_nav" type="nav_test.py" name="nav_test" output="screen">
<param name="rest_time" value="1" />
<param name="fake_test" value="true" />
</node>
</launch>
$ rosrun rviz rviz -d `rospack find rbx1_nav`/amcl.rviz
Navigation on Real
$ roscore
robot setup
$ roslaunch rbx1_bringup turtlebot_minimal_create.launch
generate /scan
$ roslaunch rbx1_bringup turtlebot_fake_laser_freenect.launch
map_server, amcl and move_base
$ roslaunch rbx1_nav tb_nav_test.launch map:=test_map.yaml
$ rosrun rviz rviz -d `rospack find rbx1_nav`/nav_test.rviz