4747from launch_testing .actions import ReadyToTest
4848from std_srvs .srv import Trigger
4949from std_msgs .msg import String as StringMsg
50+ from ur_dashboard_msgs .msg import RobotMode
5051from ur_dashboard_msgs .srv import (
5152 GetLoadedProgram ,
5253 GetProgramState ,
@@ -179,7 +180,7 @@ def init_robot(self):
179180 self .service_clients ["/controller_manager/list_controllers" ] = waitForService (
180181 self .node ,
181182 "/controller_manager/list_controllers" ,
182- ListControllers () ,
183+ ListControllers ,
183184 timeout = TIMEOUT_WAIT_SERVICE_INITIAL ,
184185 )
185186
@@ -196,6 +197,14 @@ def setUp(self):
196197 self .call_service ("/dashboard_client/power_on" , empty_req )
197198 self .call_service ("/dashboard_client/brake_release" , empty_req )
198199
200+ time .sleep (1 )
201+ robot_mode_resp = self .call_service (
202+ "/dashboard_client/get_robot_mode" , GetRobotMode .Request ()
203+ )
204+ self .assertEqual (robot_mode_resp .robot_mode .mode , RobotMode .RUNNING )
205+ self .call_service ("/dashboard_client/stop" , empty_req )
206+ time .sleep (1 )
207+
199208 io_controller_running = False
200209
201210 while not io_controller_running :
@@ -255,7 +264,7 @@ def set_digout_checked(self, pin, state):
255264
256265 def check_pin_states (self , pins , states ):
257266 pin_states = [not x for x in states ]
258- end_time = time .time () + 5
267+ end_time = time .time () + 50
259268 while pin_states != states and time .time () < end_time :
260269 rclpy .spin_once (self .node , timeout_sec = 0.1 )
261270 if self .io_msg is not None :
0 commit comments