From b055c79d389f5e51a05a77f2da73aca6f2f36672 Mon Sep 17 00:00:00 2001 From: alexfneves Date: Thu, 29 Aug 2019 19:14:53 -0300 Subject: [PATCH] [ros2] Uncommenting bond option on spawn_entity (wait Ctrl+C then remove entity) (#986) * Uncommenting bond option on spawn_entity (wait Ctrl+C then remove entity) Instead of waiting for a shutdown callback to be created in rclpy, we can use the try/except to get the SIGINT signal, then delete the entity. * Message formatting Signed-off-by: Louise Poubel --- gazebo_ros/scripts/spawn_entity.py | 60 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/gazebo_ros/scripts/spawn_entity.py b/gazebo_ros/scripts/spawn_entity.py index 112752a80..e9d1a1a2c 100755 --- a/gazebo_ros/scripts/spawn_entity.py +++ b/gazebo_ros/scripts/spawn_entity.py @@ -25,7 +25,7 @@ from xml.etree import ElementTree from gazebo_msgs.msg import ModelStates -# from gazebo_msgs.srv import DeleteEntity +from gazebo_msgs.srv import DeleteEntity # from gazebo_msgs.srv import SetModelConfiguration from gazebo_msgs.srv import SpawnEntity from geometry_msgs.msg import Pose @@ -97,9 +97,8 @@ def __init__(self, args): parser.add_argument('-package_to_model', action='store_true', help='convert urdf \