Skip to content
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

Fix ordering of windup args to control_toolbox::Pid #2370

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

nbbrooks
Copy link
Contributor

@nbbrooks nbbrooks commented Oct 14, 2020

Description

The control_toolbox::Pid constructor expects i_max followed by i_min (and does not check that the former is greater than the latter). The current arguments are passed in reverse order and this PR addresses that.

This work is sponsored by RE2 Robotics.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Copy link
Member

@AndyZe AndyZe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Badly needed. Thanks!

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nbbrooks, I cannot follow your argumentation: The linked doc to the Pid constructor, lists i_max before i_min. So, if I'm not completely mistaken, the current order was fine any our PR willb break it. What do I miss?

@AndyZe
Copy link
Member

AndyZe commented Oct 15, 2020

Please take a quick second look. Here's the constructor definition:

control_toolbox::Pid::Pid  ( double p = 0.0, double i = 0.0, double d = 0.0, double i_max = 0.0, double i_min = -0.0, bool antiwindup = false)  

Here's Nathan's change:

pid_vector.push_back(control_toolbox::Pid(pid_config.k_p, pid_config.k_i, pid_config.k_d, pid_config.windup_limit,
                                            -pid_config.windup_limit, use_anti_windup));

(The negative value is the second-to-last arg.) Also, we were testing this on a robot 2 days ago, so it was really obvious that it was wrong.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I'm too tired...

@rhaschke rhaschke merged commit b2b04b5 into moveit:master Oct 15, 2020
@tylerjw tylerjw mentioned this pull request Oct 23, 2020
57 tasks
tylerjw pushed a commit to tylerjw/moveit that referenced this pull request Oct 23, 2020
tylerjw pushed a commit to tylerjw/moveit that referenced this pull request Oct 27, 2020
@tylerjw tylerjw mentioned this pull request Apr 9, 2021
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.

None yet

3 participants