|
17 | 17 |
|
18 | 18 | from ament_index_python.packages import get_package_share_directory
|
19 | 19 | from launch import LaunchDescription
|
20 |
| -from launch.actions import ExecuteProcess, IncludeLaunchDescription, OpaqueFunction, RegisterEventHandler |
| 20 | +from launch.actions import ( |
| 21 | + AppendEnvironmentVariable, |
| 22 | + ExecuteProcess, |
| 23 | + IncludeLaunchDescription, |
| 24 | + OpaqueFunction, |
| 25 | + RegisterEventHandler, |
| 26 | +) |
21 | 27 | from launch.event_handlers import OnShutdown
|
22 | 28 | from launch.launch_description_sources import PythonLaunchDescriptionSource
|
23 | 29 | from launch_ros.actions import Node
|
@@ -64,6 +70,8 @@ def generate_launch_description():
|
64 | 70 | launch_arguments={"gz_args": ["-v4 -g "]}.items(),
|
65 | 71 | )
|
66 | 72 |
|
| 73 | + set_env_vars_resources = AppendEnvironmentVariable('GZ_SIM_RESOURCE_PATH',sim_dir) |
| 74 | + |
67 | 75 | start_gazebo_spawner_cmd = IncludeLaunchDescription(
|
68 | 76 | PythonLaunchDescriptionSource(
|
69 | 77 | os.path.join(sim_dir, 'launch', 'spawn_tb3.launch.py')),
|
@@ -104,6 +112,7 @@ def generate_launch_description():
|
104 | 112 | output='screen')
|
105 | 113 |
|
106 | 114 | ld = LaunchDescription()
|
| 115 | + ld.add_action(set_env_vars_resources) |
107 | 116 | ld.add_action(world_sdf_xacro)
|
108 | 117 | ld.add_action(remove_temp_sdf_file)
|
109 | 118 | ld.add_action(gazebo_server)
|
|
0 commit comments