Skip to content

Commit c9a7199

Browse files
Fix the ActivateWithWrongJointsNamesFails test (backport #1570) (#1571)
Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
1 parent 9793557 commit c9a7199

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)