Skip to content

Commit d78bb6a

Browse files
committed
Update to new signature of update_reference_from_subscribers
1 parent c1431af commit d78bb6a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

steering_controllers_library/include/steering_controllers_library/steering_controllers_library.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class SteeringControllersLibrary : public controller_interface::ChainableControl
7676
const rclcpp_lifecycle::State & previous_state) override;
7777

7878
STEERING_CONTROLLERS__VISIBILITY_PUBLIC controller_interface::return_type
79-
update_reference_from_subscribers() override;
79+
update_reference_from_subscribers(
80+
const rclcpp::Time & time, const rclcpp::Duration & period) override;
8081

8182
STEERING_CONTROLLERS__VISIBILITY_PUBLIC controller_interface::return_type
8283
update_and_write_commands(const rclcpp::Time & time, const rclcpp::Duration & period) override;

steering_controllers_library/src/steering_controllers_library.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,11 @@ controller_interface::CallbackReturn SteeringControllersLibrary::on_deactivate(
411411
return controller_interface::CallbackReturn::SUCCESS;
412412
}
413413

414-
controller_interface::return_type SteeringControllersLibrary::update_reference_from_subscribers()
414+
controller_interface::return_type SteeringControllersLibrary::update_reference_from_subscribers(
415+
const rclcpp::Time & time, const rclcpp::Duration & period)
415416
{
416417
auto current_ref = *(input_ref_.readFromRT());
417-
const auto age_of_last_command = get_node()->now() - (current_ref)->header.stamp;
418+
const auto age_of_last_command = time - (current_ref)->header.stamp;
418419

419420
// send message only if there is no timeout
420421
if (age_of_last_command <= ref_timeout_ || ref_timeout_ == rclcpp::Duration::from_seconds(0))

0 commit comments

Comments
 (0)