Skip to content

Commit 30b56b6

Browse files
saikishormergify[bot]
authored andcommitted
Use get_lifecycle_id instead of get_lifecycle_state (#2053)
(cherry picked from commit 4a8192a) # Conflicts: # motion_primitives_controllers/src/motion_primitives_forward_controller.cpp
1 parent e25ef8f commit 30b56b6

File tree

3 files changed

+401
-5
lines changed

3 files changed

+401
-5
lines changed

joint_trajectory_controller/src/joint_trajectory_controller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ void JointTrajectoryController::query_state_service(
693693
{
694694
const auto logger = get_node()->get_logger();
695695
// Preconditions
696-
if (get_lifecycle_state().id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
696+
if (get_lifecycle_id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
697697
{
698698
RCLCPP_ERROR(logger, "Can't sample trajectory. Controller is not active.");
699699
response->success = false;
@@ -1269,7 +1269,7 @@ rclcpp_action::GoalResponse JointTrajectoryController::goal_received_callback(
12691269
RCLCPP_INFO(get_node()->get_logger(), "Received new action goal");
12701270

12711271
// Precondition: Running controller
1272-
if (get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
1272+
if (get_lifecycle_id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
12731273
{
12741274
RCLCPP_ERROR(
12751275
get_node()->get_logger(), "Can't accept new action goals. Controller is not running.");

joint_trajectory_controller/test/test_trajectory_controller_utils.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ class TrajectoryControllerTest : public ::testing::Test
421421
{
422422
if (traj_controller_)
423423
{
424-
if (
425-
traj_controller_->get_lifecycle_state().id() ==
426-
lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
424+
if (traj_controller_->get_lifecycle_id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
427425
{
428426
EXPECT_EQ(
429427
traj_controller_->get_node()->deactivate().id(),

0 commit comments

Comments
 (0)