From 43a12f0288f4d5ed3275e9c1e7021bc79883df54 Mon Sep 17 00:00:00 2001 From: Stefan Scherzinger Date: Thu, 21 Sep 2023 17:52:49 +0200 Subject: [PATCH] Fix integration script for Iron --- .../integration_tests/integration_tests.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cartesian_controller_tests/integration_tests/integration_tests.py b/cartesian_controller_tests/integration_tests/integration_tests.py index fa14caee..6c20b2ba 100755 --- a/cartesian_controller_tests/integration_tests/integration_tests.py +++ b/cartesian_controller_tests/integration_tests/integration_tests.py @@ -18,6 +18,9 @@ from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import WrenchStamped +import os + +distro = os.environ['ROS_DISTRO'] def generate_test_description(): @@ -181,13 +184,20 @@ def check_state(self, controller, state): def start_controller(self, controller): """ Start the given controller """ req = SwitchController.Request() - req.start_controllers = [controller] + if distro == 'iron': + req.activate_controllers = [controller] + else: + req.start_controllers = [controller] + self.perform_switch(req) def stop_controller(self, controller): """ Stop the given controller """ req = SwitchController.Request() - req.stop_controllers = [controller] + if distro == 'iron': + req.deactivate_controllers = [controller] + else: + req.stop_controllers = [controller] self.perform_switch(req) def perform_switch(self, req):