Skip to content

Commit

Permalink
Use std::chrono overload
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jan 1, 2025
1 parent eaa4284 commit a885f0c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ 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_->compute_command(error_position, error_velocity, static_cast<uint64_t>(period.count()));
double command = pid_->compute_command(error_position, error_velocity, period);
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 a885f0c

Please sign in to comment.