From 0b28567022744ae40d88ad98c97af233ae2743c2 Mon Sep 17 00:00:00 2001 From: mahp Date: Mon, 28 Aug 2023 15:40:56 +0200 Subject: [PATCH] More formatting --- ur_robot_driver/test/dashboard_client.py | 1 - ur_robot_driver/test/robot_driver.py | 7 ++++--- ur_robot_driver/test/urscript_interface.py | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ur_robot_driver/test/dashboard_client.py b/ur_robot_driver/test/dashboard_client.py index cf8ed3901..67afd2d87 100755 --- a/ur_robot_driver/test/dashboard_client.py +++ b/ur_robot_driver/test/dashboard_client.py @@ -90,7 +90,6 @@ def generate_test_description(): robot_ip = LaunchConfiguration("robot_ip") launch_ursim = LaunchConfiguration("launch_ursim") - dashboard_client = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( diff --git a/ur_robot_driver/test/robot_driver.py b/ur_robot_driver/test/robot_driver.py index 762a89ac0..71718e763 100755 --- a/ur_robot_driver/test/robot_driver.py +++ b/ur_robot_driver/test/robot_driver.py @@ -165,8 +165,8 @@ def generate_test_description(tf_prefix): driver_starter = RegisterEventHandler( OnProcessExit(target_action=wait_dashboard_server, on_exit=robot_driver), condition=IfCondition(launch_ursim), - ) - + ) + robot_driver_no_wait = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( @@ -192,6 +192,7 @@ def generate_test_description(tf_prefix): + [ReadyToTest(), wait_dashboard_server, ursim, driver_starter, robot_driver_no_wait] ) + class RobotDriverTest(unittest.TestCase): @classmethod def setUpClass(cls): @@ -499,7 +500,6 @@ def get_result(self, action_name, goal_response, timeout): else: raise Exception(f"Exception while calling action: {future_res.exception()}") - def waitForController( self, controller_name, controller_status="active", timeout=TIMEOUT_WAIT_SERVICE ): @@ -519,6 +519,7 @@ def waitForController( f"Controller {controller_name} did not reach controller state {controller_status} within timeout of {timeout}" ) + def waitForService(node, srv_name, srv_type, timeout=TIMEOUT_WAIT_SERVICE): client = node.create_client(srv_type, srv_name) if client.wait_for_service(timeout) is False: diff --git a/ur_robot_driver/test/urscript_interface.py b/ur_robot_driver/test/urscript_interface.py index acb4a5a14..7d29d1996 100755 --- a/ur_robot_driver/test/urscript_interface.py +++ b/ur_robot_driver/test/urscript_interface.py @@ -153,7 +153,7 @@ def generate_test_description(): OnProcessExit(target_action=wait_dashboard_server, on_exit=robot_driver), condition=IfCondition(launch_ursim), ) - + robot_driver_no_wait = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution( @@ -170,14 +170,15 @@ def generate_test_description(): "launch_dashboard_client": "false", "start_joint_controller": "false", }.items(), - condition=UnlessCondition(launch_ursim) + condition=UnlessCondition(launch_ursim), ) return LaunchDescription( - declared_arguments + declared_arguments + [ReadyToTest(), wait_dashboard_server, ursim, driver_starter, robot_driver_no_wait] ) + class URScriptInterfaceTest(unittest.TestCase): @classmethod def setUpClass(cls):