diff --git a/src/pid_ros.cpp b/src/pid_ros.cpp index 58d0f609..0cdef37d 100644 --- a/src/pid_ros.cpp +++ b/src/pid_ros.cpp @@ -221,7 +221,7 @@ std::shared_ptr> PidROS::getPidSt double PidROS::computeCommand(double error, rclcpp::Duration dt) { - double cmd_ = pid_.computeCommand(error, dt.nanoseconds()); + double cmd_ = pid_.computeCommand(error, static_cast(dt.nanoseconds())); publishPIDState(cmd_, error, dt); return cmd_; @@ -229,7 +229,7 @@ double PidROS::computeCommand(double error, rclcpp::Duration dt) double PidROS::computeCommand(double error, double error_dot, rclcpp::Duration dt) { - double cmd_ = pid_.computeCommand(error, error_dot, dt.nanoseconds()); + double cmd_ = pid_.computeCommand(error, error_dot, static_cast(dt.nanoseconds())); publishPIDState(cmd_, error, dt); return cmd_;