Skip to content

Commit c238e6e

Browse files
Test also for the inactive controller (#762) (#763)
(cherry picked from commit 93b2f12) Co-authored-by: Christoph Fröhlich <[email protected]>
1 parent 8a9ef48 commit c238e6e

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

example_13/test/test_three_robots_launch.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,15 @@ def test_behavior(self, proc_output):
9292
"rrbot_with_sensor_joint_state_broadcaster",
9393
"rrbot_with_sensor_fts_broadcaster",
9494
]
95+
check_controllers_running(self.node, cnames, "", "active")
96+
cnames = [
97+
"rrbot_with_sensor_position_controller",
98+
"threedofbot_joint_state_broadcaster",
99+
"threedofbot_position_controller",
100+
"threedofbot_pid_gain_controller",
101+
]
102+
check_controllers_running(self.node, cnames, "", "inactive")
95103

96-
check_controllers_running(self.node, cnames)
97104
check_if_js_published(
98105
"/joint_states",
99106
[

example_15/test/test_multi_controller_manager_launch.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,20 @@ def tearDown(self):
8383
def test_node_start(self, proc_output):
8484
check_node_running(self.node, "robot_state_publisher")
8585

86-
def test_controller_running_cm1(self, proc_output):
86+
def test_controller_running(self, proc_output):
8787

8888
cnames = [
8989
"forward_position_controller",
9090
"joint_state_broadcaster",
9191
]
92-
check_controllers_running(self.node, cnames, "/rrbot_1")
93-
check_controllers_running(self.node, cnames, "/rrbot_2")
92+
check_controllers_running(self.node, cnames, "/rrbot_1", "active")
93+
check_controllers_running(self.node, cnames, "/rrbot_2", "active")
94+
95+
cnames = [
96+
"position_trajectory_controller",
97+
]
98+
check_controllers_running(self.node, cnames, "/rrbot_1", "inactive")
99+
check_controllers_running(self.node, cnames, "/rrbot_2", "inactive")
94100

95101
def test_check_if_msgs_published(self):
96102
check_if_js_published("/rrbot_1/joint_states", ["rrbot_1_joint1", "rrbot_1_joint2"])

example_15/test/test_rrbot_namespace_launch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ def test_controller_running(self, proc_output):
8989
"forward_position_controller",
9090
"joint_state_broadcaster",
9191
]
92+
check_controllers_running(self.node, cnames, "/rrbot", "active")
9293

93-
check_controllers_running(self.node, cnames, "/rrbot")
94+
check_controllers_running(
95+
self.node, ["position_trajectory_controller"], "/rrbot", "inactive"
96+
)
9497

9598
def test_check_if_msgs_published(self):
9699
check_if_js_published("/rrbot/joint_states", ["joint1", "joint2"])

0 commit comments

Comments
 (0)