You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: harmonic/ros2_launch_gazebo.md
+25-22Lines changed: 25 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -54,45 +54,48 @@ an option but not strictly necessary as you could decide to hardcode some of the
54
54
values or not even use all the parameters.
55
55
56
56
### Python
57
-
Python launch files provide more low-level customization and logic compared to XML launch files.
58
-
In the following example, the user can specify a world argument to launch an environment for
59
-
the Moon, Mars, or Enceladus. It additionally sets the resource path environment variable and
60
-
sets up empty arrays for topics to be bridged and remapped from Gazebo to ROS 2:
57
+
Python launch files provide more low-level customization and logic compared to XML launch files. For example, you can set environment variables and include Python specific functions and logic.
58
+
In the following example, the user can replace the example package, world, and bridged topic with their own. This is intended as a scaffolding more than something that can be run on its own.
59
+
61
60
```python
62
-
from ament_index_python.packages import get_package_share_directory
63
61
from launch import LaunchDescription
64
-
from launch.actions import (DeclareLaunchArgument, SetEnvironmentVariable,
65
-
IncludeLaunchDescription, SetLaunchConfiguration)
66
-
from launch.substitutions import PathJoinSubstitution, LaunchConfiguration, TextSubstitution
67
62
from launch_ros.actions import Node
63
+
from launch.actions import SetEnvironmentVariable, IncludeLaunchDescription
68
64
from launch.launch_description_sources import PythonLaunchDescriptionSource
65
+
from launch.substitutions import PathJoinSubstitution
66
+
from launch_ros.substitutions import FindPackageShare
0 commit comments