Skip to content

Commit b8a7a4f

Browse files
christophfroehlichmergify[bot]
authored andcommitted
Fix the ActivateWithWrongJointsNamesFails test (#1570)
(cherry picked from commit 11ed083)
1 parent 9793557 commit b8a7a4f

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

effort_controllers/test/test_joint_group_effort_controller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ TEST_F(JointGroupEffortControllerTest, ActivateWithWrongJointsNamesFails)
8989
// activate failed, 'joint4' is not a valid joint name for the hardware
9090
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9191
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
92+
ASSERT_EQ(controller_->on_cleanup(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9293

9394
controller_->get_node()->set_parameter({"joints", std::vector<std::string>{"joint1", "joint2"}});
9495

95-
// activate failed, 'acceleration' is not a registered interface for `joint1`
96+
// activate should succeed now
9697
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
97-
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
98+
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9899
}
99100

100101
TEST_F(JointGroupEffortControllerTest, CommandSuccessTest)

position_controllers/test/test_joint_group_position_controller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ TEST_F(JointGroupPositionControllerTest, ActivateWithWrongJointsNamesFails)
8989
// activate failed, 'joint4' is not a valid joint name for the hardware
9090
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9191
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
92+
ASSERT_EQ(controller_->on_cleanup(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9293

9394
controller_->get_node()->set_parameter({"joints", std::vector<std::string>{"joint1", "joint2"}});
9495

95-
// activate failed, 'acceleration' is not a registered interface for `joint1`
96+
// activate should succeed now
9697
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
97-
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
98+
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9899
}
99100

100101
TEST_F(JointGroupPositionControllerTest, CommandSuccessTest)

velocity_controllers/test/test_joint_group_velocity_controller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ TEST_F(JointGroupVelocityControllerTest, ActivateWithWrongJointsNamesFails)
8989
// activate failed, 'joint4' is not a valid joint name for the hardware
9090
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9191
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
92+
ASSERT_EQ(controller_->on_cleanup(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9293

9394
controller_->get_node()->set_parameter({"joints", std::vector<std::string>{"joint1", "joint2"}});
9495

95-
// activate failed, 'acceleration' is not a registered interface for `joint1`
96+
// activate should succeed now
9697
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
97-
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::ERROR);
98+
ASSERT_EQ(controller_->on_activate(rclcpp_lifecycle::State()), CallbackReturn::SUCCESS);
9899
}
99100

100101
TEST_F(JointGroupVelocityControllerTest, CommandSuccessTest)

0 commit comments

Comments
 (0)