MCPcopy Create free account
hub / github.com/Alexander-Levy/sim_bot / generate_launch_description

Function generate_launch_description

launch/diff_bot.launch.py:11–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def generate_launch_description():
12
13 # Package name
14 package_name='sim_bot'
15
16 # Launch configurations
17 world = LaunchConfiguration('world')
18 headless = LaunchConfiguration('headless')
19 rviz = LaunchConfiguration('rviz')
20 slam = LaunchConfiguration('slam')
21 nav = LaunchConfiguration('nav')
22
23 # Path to default world
24 world_path = os.path.join(get_package_share_directory(package_name),'worlds', 'test.world')
25
26 # Launch Arguments
27 declare_world = DeclareLaunchArgument(
28 name='world', default_value=world_path,
29 description='Full path to the world model file to load')
30
31 declare_headless = DeclareLaunchArgument(
32 'headless', default_value='False',
33 description='Decides if the simulation is visualized')
34
35 declare_rviz = DeclareLaunchArgument(
36 name='rviz', default_value='True',
37 description='Opens rviz is set to True')
38
39 declare_slam = DeclareLaunchArgument(
40 name='slam', default_value='True',
41 description='Activates simultaneous localization and mapping')
42
43 declare_nav = DeclareLaunchArgument(
44 name='nav', default_value='True',
45 description='Activates the navigation stack')
46
47 # Launch Robot State Publisher
48 urdf_path = os.path.join(get_package_share_directory(package_name),'description','diff_bot.urdf.xacro')
49 rsp = IncludeLaunchDescription(
50 PythonLaunchDescriptionSource([os.path.join(
51 get_package_share_directory(package_name),'launch','rsp.launch.py'
52 )]), launch_arguments={'use_sim_time': 'true', 'urdf': urdf_path}.items()
53 )
54
55 # Launch Joystick Tele Operation
56 joystick = IncludeLaunchDescription(
57 PythonLaunchDescriptionSource([os.path.join(
58 get_package_share_directory(package_name),'launch','teleop.launch.py'
59 )]), launch_arguments={'use_sim_time': 'true'}.items()
60 )
61
62 # Launch Twist Mux
63 twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux_params.yaml')
64 twist_mux = Node(
65 package="twist_mux",
66 executable="twist_mux",
67 parameters=[twist_mux_params, {'use_sim_time': True}],
68 remappings=[('/cmd_vel_out','/cmd_vel')]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected