Skip to content

Commit 36068e1

Browse files
Add explicit cast to period.count() (ros-controls#1404)
1 parent ff3c8a0 commit 36068e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gripper_controllers/include/gripper_controllers/hardware_interface_adapter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class HardwareInterfaceAdapter<hardware_interface::HW_IF_EFFORT>
165165
// Time since the last call to update
166166
const auto period = std::chrono::steady_clock::now() - last_update_time_;
167167
// Update PIDs
168-
double command = pid_->computeCommand(error_position, error_velocity, period.count());
168+
double command =
169+
pid_->computeCommand(error_position, error_velocity, static_cast<uint64_t>(period.count()));
169170
command = std::min<double>(
170171
fabs(max_allowed_effort), std::max<double>(-fabs(max_allowed_effort), command));
171172
joint_handle_->get().set_value(command);

0 commit comments

Comments
 (0)