Skip to content

Commit af8e7ac

Browse files
committed
add ekf localization
1 parent 8fe4056 commit af8e7ac

File tree

10 files changed

+1499
-14
lines changed

10 files changed

+1499
-14
lines changed

turtlebot2_bringup/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(BUILD_TESTING)
2323
endif()
2424

2525
install(
26-
DIRECTORY launch
26+
DIRECTORY launch rviz config
2727
DESTINATION share/${PROJECT_NAME}
2828
)
2929

turtlebot2_bringup/config/ekf_config.yaml

+668
Large diffs are not rendered by default.

turtlebot2_bringup/launch/turtlebot_bringup.launch.py

+28-11
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
def generate_launch_description():
1515
kobuki_package = launch_ros.substitutions.FindPackageShare(package='kobuki_node').find('kobuki_node')
1616
urg_package = launch_ros.substitutions.FindPackageShare(package='urg_node').find('urg_node')
17-
turtlebot_description_package = launch_ros.substitutions.FindPackageShare(package='turtlebot_description').find('turtlebot_description')
18-
slam_toolbox_package = launch_ros.substitutions.FindPackageShare(package='slam_toolbox').find('slam_toolbox')
17+
turtlebot2_bringup_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_bringup').find('turtlebot2_bringup')
18+
turtlebot_description_package = launch_ros.substitutions.FindPackageShare(package='turtlebot2_description').find('turtlebot2_description')
19+
20+
ekf_config_params = os.path.join(turtlebot2_bringup_package,'config/ekf_config.yaml')
1921

2022
kobuki_node_launch = launch.actions.IncludeLaunchDescription(
2123
launch.launch_description_sources.PythonLaunchDescriptionSource(
@@ -25,6 +27,15 @@ def generate_launch_description():
2527
)
2628
)
2729

30+
ekf_node = launch_ros.actions.Node(
31+
package='robot_localization',
32+
executable='ekf_node',
33+
output='screen',
34+
parameters=[ekf_config_params]
35+
# ,
36+
# remappings=[("odometry/filtered", "odom")]
37+
)
38+
2839
urg_node = launch.actions.IncludeLaunchDescription(
2940
launch.launch_description_sources.PythonLaunchDescriptionSource(
3041
os.path.join(
@@ -52,21 +63,27 @@ def generate_launch_description():
5263
executable='rviz2',
5364
name='rviz2',
5465
output='screen',
55-
arguments=['-d',os.path.join(turtlebot_description_package,'rviz/urdf_config.rviz')]
66+
arguments=['-d',os.path.join(turtlebot2_bringup_package,'rviz/bringup.rviz')],
67+
condition=launch.conditions.IfCondition(launch.substitutions.LaunchConfiguration("open_rviz"))
5668
)
5769

58-
slam_toolbox_launch = launch.actions.IncludeLaunchDescription(
59-
launch.launch_description_sources.PythonLaunchDescriptionSource(
60-
os.path.join(
61-
slam_toolbox_package,
62-
'launch/online_async_launch.py')
63-
)
64-
)
70+
# mapping_launch = launch.actions.IncludeLaunchDescription(
71+
# launch.launch_description_sources.PythonLaunchDescriptionSource(
72+
# os.path.join(
73+
# slam_toolbox_package,
74+
# 'launch/online_async_launch.py')
75+
# )
76+
# )
77+
6578
return launch.LaunchDescription([
79+
launch.actions.DeclareLaunchArgument(
80+
'open_rviz',
81+
default_value='false',
82+
description='open rviz'),
6683
kobuki_node_launch,
6784
urg_node,
6885
robot_state_publisher_node,
6986
joint_state_publisher_node,
7087
rviz_node,
71-
slam_toolbox_launch
88+
ekf_node
7289
])

turtlebot2_bringup/package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<exec_depend>urg_node</exec_depend>
1818
<exec_depend>robot_state_publisher</exec_depend>
1919
<exec_depend>rviz2</exec_depend>
20-
20+
<exec_depend>robot_localization</exec_depend>
2121

2222
<export>
2323
<build_type>ament_cmake</build_type>
2424
</export>
25-
</package>
25+
</package>

turtlebot2_bringup/rviz/bringup.rviz

+299
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
Panels:
2+
- Class: rviz_common/Displays
3+
Help Height: 78
4+
Name: Displays
5+
Property Tree Widget:
6+
Expanded:
7+
- /Global Options1
8+
- /Status1
9+
- /TF1
10+
Splitter Ratio: 0.5
11+
Tree Height: 518
12+
Visualization Manager:
13+
Class: ""
14+
Displays:
15+
- Alpha: 0.5
16+
Cell Size: 1
17+
Class: rviz_default_plugins/Grid
18+
Color: 160; 160; 164
19+
Enabled: true
20+
Line Style:
21+
Line Width: 0.029999999329447746
22+
Value: Lines
23+
Name: Grid
24+
Normal Cell Count: 0
25+
Offset:
26+
X: 0
27+
Y: 0
28+
Z: 0
29+
Plane: XY
30+
Plane Cell Count: 10
31+
Reference Frame: <Fixed Frame>
32+
Value: true
33+
- Alpha: 0.6000000238418579
34+
Class: rviz_default_plugins/RobotModel
35+
Collision Enabled: false
36+
Description File: ""
37+
Description Source: Topic
38+
Description Topic:
39+
Depth: 5
40+
Durability Policy: Volatile
41+
History Policy: Keep Last
42+
Reliability Policy: Reliable
43+
Value: /robot_description
44+
Enabled: true
45+
Links:
46+
All Links Enabled: true
47+
Expand Joint Details: false
48+
Expand Link Details: false
49+
Expand Tree: false
50+
Link Tree Style: Links in Alphabetic Order
51+
base_footprint:
52+
Alpha: 1
53+
Show Axes: false
54+
Show Trail: false
55+
base_link:
56+
Alpha: 1
57+
Show Axes: false
58+
Show Trail: false
59+
Value: true
60+
caster_back_link:
61+
Alpha: 1
62+
Show Axes: false
63+
Show Trail: false
64+
Value: true
65+
caster_front_link:
66+
Alpha: 1
67+
Show Axes: false
68+
Show Trail: false
69+
Value: true
70+
cliff_sensor_front_link:
71+
Alpha: 1
72+
Show Axes: false
73+
Show Trail: false
74+
cliff_sensor_left_link:
75+
Alpha: 1
76+
Show Axes: false
77+
Show Trail: false
78+
cliff_sensor_right_link:
79+
Alpha: 1
80+
Show Axes: false
81+
Show Trail: false
82+
gyro_link:
83+
Alpha: 1
84+
Show Axes: false
85+
Show Trail: false
86+
laser:
87+
Alpha: 1
88+
Show Axes: false
89+
Show Trail: false
90+
Value: true
91+
plate_bottom_link:
92+
Alpha: 1
93+
Show Axes: false
94+
Show Trail: false
95+
Value: true
96+
plate_middle_link:
97+
Alpha: 1
98+
Show Axes: false
99+
Show Trail: false
100+
Value: true
101+
plate_top_link:
102+
Alpha: 1
103+
Show Axes: false
104+
Show Trail: false
105+
Value: true
106+
pole_bottom_0_link:
107+
Alpha: 1
108+
Show Axes: false
109+
Show Trail: false
110+
Value: true
111+
pole_bottom_1_link:
112+
Alpha: 1
113+
Show Axes: false
114+
Show Trail: false
115+
Value: true
116+
pole_bottom_2_link:
117+
Alpha: 1
118+
Show Axes: false
119+
Show Trail: false
120+
Value: true
121+
pole_bottom_3_link:
122+
Alpha: 1
123+
Show Axes: false
124+
Show Trail: false
125+
Value: true
126+
pole_bottom_4_link:
127+
Alpha: 1
128+
Show Axes: false
129+
Show Trail: false
130+
Value: true
131+
pole_bottom_5_link:
132+
Alpha: 1
133+
Show Axes: false
134+
Show Trail: false
135+
Value: true
136+
pole_kinect_0_link:
137+
Alpha: 1
138+
Show Axes: false
139+
Show Trail: false
140+
Value: true
141+
pole_kinect_1_link:
142+
Alpha: 1
143+
Show Axes: false
144+
Show Trail: false
145+
Value: true
146+
pole_middle_0_link:
147+
Alpha: 1
148+
Show Axes: false
149+
Show Trail: false
150+
Value: true
151+
pole_middle_1_link:
152+
Alpha: 1
153+
Show Axes: false
154+
Show Trail: false
155+
Value: true
156+
pole_middle_2_link:
157+
Alpha: 1
158+
Show Axes: false
159+
Show Trail: false
160+
Value: true
161+
pole_middle_3_link:
162+
Alpha: 1
163+
Show Axes: false
164+
Show Trail: false
165+
Value: true
166+
pole_top_0_link:
167+
Alpha: 1
168+
Show Axes: false
169+
Show Trail: false
170+
Value: true
171+
pole_top_1_link:
172+
Alpha: 1
173+
Show Axes: false
174+
Show Trail: false
175+
Value: true
176+
pole_top_2_link:
177+
Alpha: 1
178+
Show Axes: false
179+
Show Trail: false
180+
Value: true
181+
pole_top_3_link:
182+
Alpha: 1
183+
Show Axes: false
184+
Show Trail: false
185+
Value: true
186+
wheel_left_link:
187+
Alpha: 1
188+
Show Axes: false
189+
Show Trail: false
190+
Value: true
191+
wheel_right_link:
192+
Alpha: 1
193+
Show Axes: false
194+
Show Trail: false
195+
Value: true
196+
Name: RobotModel
197+
TF Prefix: ""
198+
Update Interval: 0
199+
Value: true
200+
Visual Enabled: true
201+
- Class: rviz_default_plugins/TF
202+
Enabled: false
203+
Frame Timeout: 15
204+
Frames:
205+
All Enabled: true
206+
Marker Scale: 0.30000001192092896
207+
Name: TF
208+
Show Arrows: true
209+
Show Axes: true
210+
Show Names: true
211+
Tree:
212+
{}
213+
Update Interval: 0
214+
Value: false
215+
- Alpha: 1
216+
Autocompute Intensity Bounds: true
217+
Autocompute Value Bounds:
218+
Max Value: 10
219+
Min Value: -10
220+
Value: true
221+
Axis: Z
222+
Channel Name: intensity
223+
Class: rviz_default_plugins/LaserScan
224+
Color: 255; 255; 255
225+
Color Transformer: Intensity
226+
Decay Time: 0
227+
Enabled: true
228+
Invert Rainbow: false
229+
Max Color: 255; 255; 255
230+
Max Intensity: 4096
231+
Min Color: 0; 0; 0
232+
Min Intensity: 0
233+
Name: LaserScan
234+
Position Transformer: XYZ
235+
Selectable: true
236+
Size (Pixels): 3
237+
Size (m): 0.009999999776482582
238+
Style: Flat Squares
239+
Topic:
240+
Depth: 5
241+
Durability Policy: Volatile
242+
Filter size: 10
243+
History Policy: Keep Last
244+
Reliability Policy: Reliable
245+
Value: /scan
246+
Use Fixed Frame: true
247+
Use rainbow: true
248+
Value: true
249+
Enabled: true
250+
Global Options:
251+
Background Color: 48; 48; 48
252+
Fixed Frame: base_link
253+
Frame Rate: 30
254+
Name: root
255+
Tools:
256+
- Class: rviz_default_plugins/Interact
257+
Hide Inactive Objects: true
258+
- Class: rviz_default_plugins/MoveCamera
259+
- Class: rviz_default_plugins/Select
260+
- Class: rviz_default_plugins/FocusCamera
261+
- Class: rviz_default_plugins/Measure
262+
Line color: 128; 128; 0
263+
Transformation:
264+
Current:
265+
Class: rviz_default_plugins/TF
266+
Value: true
267+
Views:
268+
Current:
269+
Class: rviz_default_plugins/Orbit
270+
Distance: 6.156769275665283
271+
Enable Stereo Rendering:
272+
Stereo Eye Separation: 0.05999999865889549
273+
Stereo Focal Distance: 1
274+
Swap Stereo Eyes: false
275+
Value: false
276+
Focal Point:
277+
X: 0
278+
Y: 0
279+
Z: 0
280+
Focal Shape Fixed Size: true
281+
Focal Shape Size: 0.05000000074505806
282+
Invert Z Axis: false
283+
Name: Current View
284+
Near Clip Distance: 0.009999999776482582
285+
Pitch: 0.7853981852531433
286+
Target Frame: <Fixed Frame>
287+
Value: Orbit (rviz)
288+
Yaw: 0.7853981852531433
289+
Saved: ~
290+
Window Geometry:
291+
Displays:
292+
collapsed: false
293+
Height: 747
294+
Hide Left Dock: false
295+
Hide Right Dock: false
296+
QMainWindow State: 000000ff00000000fd00000001000000000000015600000291fc0200000001fb000000100044006900730070006c006100790073010000003d00000291000000c900ffffff000003ca0000029100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
297+
Width: 1318
298+
X: 110
299+
Y: 65

0 commit comments

Comments
 (0)