Skip to content

Commit

Permalink
Add explicit cast to period.count() (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Dec 1, 2024
1 parent ff3c8a0 commit 36068e1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,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 36068e1

Please sign in to comment.