Skip to content

Commit f1d02f4

Browse files
committed
Add OLED display support and programming to my TurtleBot3
1 parent 33f0dd8 commit f1d02f4

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ build-*/
6060
*.gch
6161
/.project
6262
.DS_Store
63+
.vscode/
64+
log/
65+
build/
66+
install/
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
from ament_index_python.packages import get_package_share_directory
5+
from launch import LaunchDescription
6+
from launch.substitutions import Command
7+
from launch_ros.actions import Node
8+
9+
def generate_launch_description():
10+
11+
TURTLEBOT3_MODEL = os.environ.get('TURTLEBOT3_MODEL', 'burger')
12+
13+
urdf_file = os.path.join(
14+
get_package_share_directory('turtlebot3_description'),
15+
'urdf',
16+
f'turtlebot3_{TURTLEBOT3_MODEL}.urdf'
17+
)
18+
19+
rviz_config_file = os.path.join(
20+
get_package_share_directory('turtlebot3_description'),
21+
'rviz',
22+
'model.rviz'
23+
)
24+
25+
return LaunchDescription([
26+
Node(
27+
package='robot_state_publisher',
28+
executable='robot_state_publisher',
29+
output='screen',
30+
parameters=[{
31+
'robot_description': Command(['xacro ', urdf_file])
32+
}]
33+
),
34+
35+
Node(
36+
package='joint_state_publisher_gui',
37+
executable='joint_state_publisher_gui',
38+
output='screen'
39+
),
40+
41+
Node(
42+
package='rviz2',
43+
executable='rviz2',
44+
arguments=['-d', rviz_config_file],
45+
output='screen'
46+
),
47+
])

0 commit comments

Comments
 (0)