Skip to content

Commit 4a8192a

Browse files
authored
Use get_lifecycle_id instead of get_lifecycle_state (#2053)
1 parent 79f917e commit 4a8192a

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

joint_trajectory_controller/src/joint_trajectory_controller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void JointTrajectoryController::query_state_service(
722722
{
723723
const auto logger = get_node()->get_logger();
724724
// Preconditions
725-
if (get_lifecycle_state().id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
725+
if (get_lifecycle_id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
726726
{
727727
RCLCPP_ERROR(logger, "Can't sample trajectory. Controller is not active.");
728728
response->success = false;
@@ -1360,7 +1360,7 @@ rclcpp_action::GoalResponse JointTrajectoryController::goal_received_callback(
13601360
RCLCPP_INFO(get_node()->get_logger(), "Received new action goal");
13611361

13621362
// Precondition: Running controller
1363-
if (get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
1363+
if (get_lifecycle_id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
13641364
{
13651365
RCLCPP_ERROR(
13661366
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
@@ -427,9 +427,7 @@ class TrajectoryControllerTest : public ::testing::Test
427427
{
428428
if (traj_controller_)
429429
{
430-
if (
431-
traj_controller_->get_lifecycle_state().id() ==
432-
lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
430+
if (traj_controller_->get_lifecycle_id() == lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE)
433431
{
434432
EXPECT_EQ(
435433
traj_controller_->get_node()->deactivate().id(),

motion_primitives_controllers/src/motion_primitives_forward_controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ rclcpp_action::GoalResponse MotionPrimitivesForwardController::goal_received_cal
224224
RCLCPP_INFO(get_node()->get_logger(), "Received new action goal");
225225

226226
// Precondition: Running controller
227-
if (get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
227+
if (get_lifecycle_id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
228228
{
229229
RCLCPP_ERROR(
230230
get_node()->get_logger(), "Can't accept new trajectories. Controller is not running.");

0 commit comments

Comments
 (0)