Skip to content

Commit

Permalink
Fix dt
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Nov 26, 2024
1 parent def5b94 commit 13fe06a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pid_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ std::shared_ptr<rclcpp::Publisher<control_msgs::msg::PidState>> PidROS::getPidSt

double PidROS::computeCommand(double error, rclcpp::Duration dt)
{
double cmd_ = pid_.computeCommand(error, static_cast<int>(dt.nanoseconds()));
double cmd_ = pid_.computeCommand(error, static_cast<uint64_t>(dt.nanoseconds()));
publishPIDState(cmd_, error, dt);

return cmd_;
}

double PidROS::computeCommand(double error, double error_dot, rclcpp::Duration dt)
{
double cmd_ = pid_.computeCommand(error, error_dot, static_cast<int>(dt.nanoseconds()));
double cmd_ = pid_.computeCommand(error, error_dot, static_cast<uint64_t>(dt.nanoseconds()));
publishPIDState(cmd_, error, dt);

return cmd_;
Expand Down

0 comments on commit 13fe06a

Please sign in to comment.