File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
turtlebot3_bringup/launch Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -60,3 +60,7 @@ build-*/
6060* .gch
6161/.project
6262.DS_Store
63+ .vscode /
64+ log /
65+ build /
66+ install /
Original file line number Diff line number Diff line change 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+ ])
You can’t perform that action at this time.
0 commit comments