-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworld.launch.py
More file actions
36 lines (30 loc) · 1.17 KB
/
world.launch.py
File metadata and controls
36 lines (30 loc) · 1.17 KB
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
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution, LaunchConfiguration
import os
import xacro
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')
share_dir = get_package_share_directory('diff_bot_description')
use_sim_time_cmd = DeclareLaunchArgument(
name='use_sim_time',
default_value='True',
description='use simulation clock if set to true'
)
gz_launcher = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py')),
launch_arguments={'gz_args': PathJoinSubstitution([
share_dir,
'worlds',
f'custom_warehouse3.sdf -r'
])}.items(),
)
return LaunchDescription([
use_sim_time_cmd,
gz_launcher
])