-
Notifications
You must be signed in to change notification settings - Fork 3
New [custom] PID #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
New [custom] PID #137
Conversation
| self.kp = self.get_parameter('kp').get_parameter_value().double_value | ||
| self.kd = self.get_parameter('kd').get_parameter_value().double_value | ||
| self.ki = self.get_parameter('ki').get_parameter_value().double_value | ||
| self.angular = self.get_parameter('angular').value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? I would expect it would have to be self.angular = self.get_parameter('angular').get_parameter_value().boolean_value or smth
| # (input error % 360) will be in range [0, 360) | ||
| # if (input error % 360) is < 180 then output +ve value | ||
| # if (input error % 360) is >=180 then output -ve value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this comment into the convert_to_180_180_range function
| else: | ||
| cur_time = self.get_clock().now() | ||
| delta_time = self.elapsed_ms(self.prev_time, cur_time) | ||
| pose_diff: float = (self.pose - self.prev_pose) # don't do modulo anything, this should be the absolute value with sign and everything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the case where self.pose is 179.9 and self.prev_pose is -179.9. Then pose_diff is 359.8 when it should probably be -0.2.
tested yaw pid with various input values of target pose, pose, and target twist. outputs seem to be correct. also traced through all intermediate values calculated in my code and they look right.
This pr fixes #93