Skip to content

Commit

Permalink
world_name引数を正常に使用できるように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeKato committed Oct 24, 2023
1 parent 701f2e3 commit 77dee4d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions raspimouse_gazebo/launch/raspimouse_with_emptyworld.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,18 @@ def generate_launch_description():
description='Set "true" to mount rgb camera.')
declare_arg_world_name = DeclareLaunchArgument(
'world_name',
default_value='empty_world.sdf',
default_value=get_package_share_directory('raspimouse_gazebo')+'/worlds/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')) + ':' +
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',
LaunchConfiguration('world_name')
)
gui_config = os.path.join(
get_package_share_directory('raspimouse_gazebo'), 'gui', 'gui.config')
ign_gazebo = ExecuteProcess(
cmd=['ign gazebo -r', world_file, '--gui-config', gui_config],
cmd=['ign gazebo -r', LaunchConfiguration('world_name'), '--gui-config', gui_config],
output='screen',
additional_env=env,
shell=True
Expand Down

0 comments on commit 77dee4d

Please sign in to comment.