From 49274359f01538cfe23c3365307485a307099327 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 6 Dec 2023 13:02:11 +0000 Subject: [PATCH] Call activate() of traj_contr_ --- .../src/joint_trajectory_controller.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/joint_trajectory_controller/src/joint_trajectory_controller.cpp b/joint_trajectory_controller/src/joint_trajectory_controller.cpp index f75eb2f976..cfa3b107f3 100644 --- a/joint_trajectory_controller/src/joint_trajectory_controller.cpp +++ b/joint_trajectory_controller/src/joint_trajectory_controller.cpp @@ -220,7 +220,7 @@ controller_interface::return_type JointTrajectoryController::update( } if (traj_contr_) { - // set start time of trajectory to traj_contr_ + // switch RT buffer of traj_contr_ traj_contr_->start(); } } @@ -1041,9 +1041,11 @@ controller_interface::CallbackReturn JointTrajectoryController::on_activate( cmd_timeout_ = 0.0; } - if (traj_contr_) + // activate traj_contr_, e.g., update gains + if (traj_contr_ && traj_contr_->activate() == false) { - traj_contr_->activate(); + RCLCPP_ERROR(get_node()->get_logger(), "Error during trajectory controller activation."); + return CallbackReturn::ERROR; } return CallbackReturn::SUCCESS;