Skip to content

Conversation

@muskaan-mittal
Copy link
Contributor

@muskaan-mittal muskaan-mittal commented Nov 19, 2025

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

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
Copy link
Member

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

Comment on lines +96 to +98
# (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
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make custom pid and delete any useless pid code

3 participants