Skip to content

Commit

Permalink
launchファイルにworld_name引数を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeKato committed Oct 24, 2023
1 parent a8fa1f6 commit 701f2e3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions raspimouse_gazebo/launch/raspimouse_with_emptyworld.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,27 @@ def generate_launch_description():
'lidar_frame',
default_value='laser',
description='Set lidar link name.')
declare_arg_use_rgb_camera = DeclareLaunchArgument(
'use_rgb_camera',
default_value='false',
description='Set "true" to mount rgb camera.')
declare_arg_world_name = DeclareLaunchArgument(
'world_name',
default_value='empty_world.sdf',
description='Set world name.')

env = {'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'],
'IGN_GAZEBO_RESOURCE_PATH': os.path.dirname(
get_package_share_directory('raspimouse_description'))}
get_package_share_directory('raspimouse_description')) + ':' +
os.path.join(get_package_share_directory('raspimouse_gazebo'), 'models'),
}
world_name = str(LaunchConfiguration('world_name', default='empty_world.sdf'))
print(world_name)
world_file = os.path.join(
get_package_share_directory('raspimouse_gazebo'), 'worlds', 'empty_world.sdf')
get_package_share_directory('raspimouse_gazebo'),
'worlds',
LaunchConfiguration('world_name')
)
gui_config = os.path.join(
get_package_share_directory('raspimouse_gazebo'), 'gui', 'gui.config')
ign_gazebo = ExecuteProcess(
Expand All @@ -70,6 +85,7 @@ def generate_launch_description():
description_loader.lidar = LaunchConfiguration('lidar')
description_loader.lidar_frame = LaunchConfiguration('lidar_frame')
description_loader.use_gazebo = 'true'
description_loader.use_rgb_camera = LaunchConfiguration('use_rgb_camera')
description_loader.gz_control_config_package = 'raspimouse_gazebo'
description_loader.gz_control_config_file_path = 'config/raspimouse_controllers.yaml'

Expand Down Expand Up @@ -127,6 +143,8 @@ def generate_launch_description():
SetParameter(name='use_sim_time', value=True),
declare_arg_lidar,
declare_arg_lidar_frame,
declare_arg_use_rgb_camera,
declare_arg_world_name,
ign_gazebo,
ignition_spawn_entity,
robot_state_publisher,
Expand Down

0 comments on commit 701f2e3

Please sign in to comment.