Skip to content

Commit

Permalink
Add explicit cast to period.count() (#1404)
Browse files Browse the repository at this point in the history
(cherry picked from commit 36068e1)
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Dec 1, 2024
1 parent b133273 commit 15359e0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ class HardwareInterfaceAdapter<hardware_interface::HW_IF_EFFORT>
// Time since the last call to update
const auto period = std::chrono::steady_clock::now() - last_update_time_;
// Update PIDs
double command = pid_->computeCommand(error_position, error_velocity, period.count());
double command =
pid_->computeCommand(error_position, error_velocity, static_cast<uint64_t>(period.count()));
command = std::min<double>(
fabs(max_allowed_effort), std::max<double>(-fabs(max_allowed_effort), command));
joint_handle_->get().set_value(command);
Expand Down

0 comments on commit 15359e0

Please sign in to comment.