Skip to content

Commit

Permalink
Update to new signature of update_reference_from_subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar committed Apr 5, 2023
1 parent c1431af commit d78bb6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class SteeringControllersLibrary : public controller_interface::ChainableControl
const rclcpp_lifecycle::State & previous_state) override;

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

STEERING_CONTROLLERS__VISIBILITY_PUBLIC controller_interface::return_type
update_and_write_commands(const rclcpp::Time & time, const rclcpp::Duration & period) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,11 @@ controller_interface::CallbackReturn SteeringControllersLibrary::on_deactivate(
return controller_interface::CallbackReturn::SUCCESS;
}

controller_interface::return_type SteeringControllersLibrary::update_reference_from_subscribers()
controller_interface::return_type SteeringControllersLibrary::update_reference_from_subscribers(
const rclcpp::Time & time, const rclcpp::Duration & period)
{
auto current_ref = *(input_ref_.readFromRT());
const auto age_of_last_command = get_node()->now() - (current_ref)->header.stamp;
const auto age_of_last_command = time - (current_ref)->header.stamp;

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

0 comments on commit d78bb6a

Please sign in to comment.