Skip to content

Instantly share code, notes, and snippets.

@rfzeg
Created February 23, 2022 19:04
Show Gist options
  • Save rfzeg/0d42e75484f4b08927b74ee3e6ce46db to your computer and use it in GitHub Desktop.
Save rfzeg/0d42e75484f4b08927b74ee3e6ce46db to your computer and use it in GitHub Desktop.
Minimal ROS2 launch file via include and launch the gazebo.launch.py file.
"""Launch Gazebo server and client via include and launch the gazebo.launch.py file."""
import os
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
pkg_gazebo_ros = get_package_share_directory('gazebo_ros')
# Gazebo launch
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py'),
)
)
return LaunchDescription([
gazebo,
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment