Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ros2] Port spawn model to ROS2 #948

Merged
merged 8 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 0 additions & 233 deletions .ros1_unported/gazebo_ros/scripts/spawn_model

This file was deleted.

Empty file.
52 changes: 0 additions & 52 deletions .ros1_unported/gazebo_ros/src/gazebo_ros/gazebo_interface.py

This file was deleted.

6 changes: 6 additions & 0 deletions gazebo_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ install(
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

install(
PROGRAMS
scripts/spawn_entity.py
DESTINATION lib/${PROJECT_NAME}/
)

install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
Expand Down
42 changes: 42 additions & 0 deletions gazebo_ros/launch/spawn_entity_demo.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Demo for spawn_entity.

Launches Gazebo and spawns a model
"""

from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir
from launch_ros.actions import Node


def generate_launch_description():
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/gazebo.launch.py']),
)

# GAZEBO_MODEL_PATH has to be correctly set for Gazebo to be able to find the model
spawn_entity = Node(package='gazebo_ros', node_executable='spawn_entity.py',
arguments=['-entity', 'demo', '-database', 'double_pendulum_with_base'],
output='screen')

return LaunchDescription([
gazebo,

spawn_entity,
])
1 change: 1 addition & 0 deletions gazebo_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<depend>gazebo_dev</depend>
<depend>gazebo_msgs</depend>
<depend>rclcpp</depend>
<depend>rclpy</depend>
<depend>std_srvs</depend>
<depend>tinyxml_vendor</depend>

Expand Down
Loading