From e76f2ee971e51172ca9a9ec794fbeb9e2fc3e48f Mon Sep 17 00:00:00 2001 From: Jonathan Chapple Date: Mon, 6 Jun 2022 08:18:32 -0700 Subject: [PATCH] fix inverted error code for action client take (#949) Signed-off-by: Jonathan Chapple --- rclpy/src/rclpy/_rclpy_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclpy/src/rclpy/_rclpy_action.c b/rclpy/src/rclpy/_rclpy_action.c index 3562f08ba..baab26f49 100644 --- a/rclpy/src/rclpy/_rclpy_action.c +++ b/rclpy/src/rclpy/_rclpy_action.c @@ -1127,7 +1127,7 @@ rclpy_action_take_cancel_response(PyObject * Py_UNUSED(self), PyObject * args) rcl_ret_t ret = rcl_action_take_ ## Type(action_client, taken_msg); \ if (ret != RCL_RET_OK) { \ destroy_ros_message(taken_msg); \ - if (ret != RCL_RET_ACTION_CLIENT_TAKE_FAILED) { \ + if (ret == RCL_RET_ACTION_CLIENT_TAKE_FAILED) { \ /* if take failed, just do nothing */ \ Py_RETURN_NONE; \ } \