@@ -107,6 +107,7 @@ auto EndEffectorTrajectoryController::validate_trajectory(
107
107
trajectory.header .stamp = get_node ()->now ();
108
108
}
109
109
110
+ // NOLINTNEXTLINE(readability-use-anyofallof)
110
111
for (const auto [p1, p2] : std::views::zip (trajectory.points , trajectory.points | std::views::drop (1 ))) {
111
112
const rclcpp::Duration p1_start = p1.time_from_start ;
112
113
const rclcpp::Duration p2_start = p2.time_from_start ;
@@ -160,8 +161,8 @@ auto EndEffectorTrajectoryController::on_configure(const rclcpp_lifecycle::State
160
161
});
161
162
162
163
auto handle_goal =
163
- [this ](const rclcpp_action::GoalUUID & /* uuid*/ , std::shared_ptr<const FollowTrajectoryAction ::Goal> goal) {
164
- RCLCPP_INFO (logger_, " Received new trajectory goal" ); // NOLINT
164
+ [this ](const rclcpp_action::GoalUUID & /* uuid*/ , std::shared_ptr<const FollowTrajectory ::Goal> goal) { // NOLINT
165
+ RCLCPP_INFO (logger_, " Received new trajectory goal" ); // NOLINT
165
166
if (get_lifecycle_state ().id () == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE) {
166
167
RCLCPP_ERROR (logger_, " Can't accept new action goals. Controller is not running." ); // NOLINT
167
168
return rclcpp_action::GoalResponse::REJECT;
@@ -178,12 +179,12 @@ auto EndEffectorTrajectoryController::on_configure(const rclcpp_lifecycle::State
178
179
return rclcpp_action::GoalResponse::ACCEPT_AND_EXECUTE;
179
180
};
180
181
181
- auto handle_cancel = [this ](const std::shared_ptr<rclcpp_action::ServerGoalHandle<FollowTrajectoryAction >> gh) {
182
- RCLCPP_INFO (logger_, " Received cancel action goal" ); // NOLINT
182
+ auto handle_cancel = [this ](const std::shared_ptr<rclcpp_action::ServerGoalHandle<FollowTrajectory >> gh) { // NOLINT
183
+ RCLCPP_INFO (logger_, " Received cancel action goal" ); // NOLINT
183
184
const auto active_goal = *rt_active_goal_.readFromNonRT ();
184
185
if (active_goal && active_goal->gh_ == gh) {
185
186
RCLCPP_INFO (logger_, " Canceling active goal" ); // NOLINT
186
- auto action_result = std::make_shared<FollowTrajectoryAction ::Result>();
187
+ auto action_result = std::make_shared<FollowTrajectory ::Result>();
187
188
active_goal->setCanceled (action_result);
188
189
rt_holding_position_.writeFromNonRT (true );
189
190
rt_first_sample_.writeFromNonRT (true );
@@ -192,14 +193,14 @@ auto EndEffectorTrajectoryController::on_configure(const rclcpp_lifecycle::State
192
193
return rclcpp_action::CancelResponse::ACCEPT;
193
194
};
194
195
195
- auto handle_accepted = [this ](std::shared_ptr<rclcpp_action::ServerGoalHandle<FollowTrajectoryAction >> gh) {
196
- RCLCPP_INFO (logger_, " Received accepted action goal" ); // NOLINT
196
+ auto handle_accepted = [this ](std::shared_ptr<rclcpp_action::ServerGoalHandle<FollowTrajectory >> gh) { // NOLINT
197
+ RCLCPP_INFO (logger_, " Received accepted action goal" ); // NOLINT
197
198
rt_goal_in_progress_.writeFromNonRT (true );
198
199
const auto active_goal = *rt_active_goal_.readFromNonRT ();
199
200
if (active_goal) {
200
201
RCLCPP_INFO (logger_, " Canceling active goal" ); // NOLINT
201
- auto action_result = std::make_shared<FollowTrajectoryAction ::Result>();
202
- action_result->error_code = FollowTrajectoryAction ::Result::INVALID_GOAL;
202
+ auto action_result = std::make_shared<FollowTrajectory ::Result>();
203
+ action_result->error_code = FollowTrajectory ::Result::INVALID_GOAL;
203
204
action_result->error_string = " Current goal cancelled by a new incoming action." ;
204
205
active_goal->setCanceled (action_result);
205
206
rt_active_goal_.writeFromNonRT (RealtimeGoalHandlePtr ());
@@ -208,7 +209,7 @@ auto EndEffectorTrajectoryController::on_configure(const rclcpp_lifecycle::State
208
209
rt_goal_tolerance_.writeFromNonRT (gh->get_goal ()->goal_tolerance );
209
210
rt_path_tolerance_.writeFromNonRT (gh->get_goal ()->path_tolerance );
210
211
211
- RealtimeGoalHandlePtr rt_gh = std::make_shared<RealtimeGoalHandle>(gh);
212
+ const RealtimeGoalHandlePtr rt_gh = std::make_shared<RealtimeGoalHandle>(gh);
212
213
rt_gh->execute ();
213
214
rt_active_goal_.writeFromNonRT (rt_gh);
214
215
@@ -392,7 +393,7 @@ auto EndEffectorTrajectoryController::update(const rclcpp::Time & time, const rc
392
393
393
394
case SampleError::SAMPLE_TIME_AFTER_END: {
394
395
const double goal_tolerance = *rt_goal_tolerance_.readFromRT ();
395
- double goal_error = geodesic_error (trajectory->end_point ().value (), end_effector_state);
396
+ const double goal_error = geodesic_error (trajectory->end_point ().value (), end_effector_state);
396
397
RCLCPP_INFO (logger_, " Trajectory sample time is after trajectory end time." ); // NOLINT
397
398
if (goal_tolerance > 0.0 ) {
398
399
if (goal_error > goal_tolerance) {
@@ -416,7 +417,7 @@ auto EndEffectorTrajectoryController::update(const rclcpp::Time & time, const rc
416
417
417
418
if (active_goal) {
418
419
// write feedback to the action server
419
- auto feedback = std::make_shared<FollowTrajectoryAction ::Feedback>();
420
+ auto feedback = std::make_shared<FollowTrajectory ::Feedback>();
420
421
feedback->header .stamp = time ;
421
422
feedback->desired = reference_state;
422
423
feedback->actual = end_effector_state;
@@ -425,20 +426,20 @@ auto EndEffectorTrajectoryController::update(const rclcpp::Time & time, const rc
425
426
426
427
// check terminal conditions
427
428
if (goal_tolerance_exceeded) {
428
- auto action_result = std::make_shared<FollowTrajectoryAction ::Result>();
429
- action_result->error_code = FollowTrajectoryAction ::Result::PATH_TOLERANCE_VIOLATED;
429
+ auto action_result = std::make_shared<FollowTrajectory ::Result>();
430
+ action_result->error_code = FollowTrajectory ::Result::PATH_TOLERANCE_VIOLATED;
430
431
action_result->error_string = " Trajectory execution aborted. Goal tolerance exceeded." ;
431
432
active_goal->setAborted (action_result);
432
433
rt_holding_position_.writeFromNonRT (true );
433
434
} else if (trajectory_suceeded) {
434
- auto action_result = std::make_shared<FollowTrajectoryAction ::Result>();
435
- action_result->error_code = FollowTrajectoryAction ::Result::SUCCESSFUL;
435
+ auto action_result = std::make_shared<FollowTrajectory ::Result>();
436
+ action_result->error_code = FollowTrajectory ::Result::SUCCESSFUL;
436
437
action_result->error_string = " Trajectory execution completed successfully!" ;
437
438
active_goal->setSucceeded (action_result);
438
439
rt_holding_position_.writeFromNonRT (true );
439
440
} else if (path_tolerance_exceeded) {
440
- auto action_result = std::make_shared<FollowTrajectoryAction ::Result>();
441
- action_result->error_code = FollowTrajectoryAction ::Result::PATH_TOLERANCE_VIOLATED;
441
+ auto action_result = std::make_shared<FollowTrajectory ::Result>();
442
+ action_result->error_code = FollowTrajectory ::Result::PATH_TOLERANCE_VIOLATED;
442
443
action_result->error_string = " Trajectory execution aborted. Path tolerance exceeded." ;
443
444
active_goal->setAborted (action_result);
444
445
rt_holding_position_.writeFromNonRT (true );
0 commit comments