-
Notifications
You must be signed in to change notification settings - Fork 105
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
Warning message for position control PID when config not consistent #716
Conversation
…is not consistent across joints
cc @lrapetti |
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.
A few hints.
Thanks @AlexAntn for taking care.
If I can give my opinion regarding this point, in general I think this needs to be implemented for all the control types. For example, my issue was opened after I experienced that problem in torque control mode. |
But the case of torque PID should have been already covered if I got it right (cc @AlexAntn). |
Should it be a |
The message is an |
In some cases, not all, but I think fixing this will make sure to deal with the correct joint number. |
…d the previous error messages (for torque and position control)
} | ||
} | ||
} | ||
|
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.
Here I introduced an error message for current control type
} | ||
} | ||
} | ||
|
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.
here I introduced a similar message for speed control type
@@ -1246,8 +1310,6 @@ bool Parser::getCorrectPidForEachJoint(PidInfo *ppids/*, PidInfo *vpids*/, TrqPi | |||
//eomc_ctrl_out_type_vel = 2, | |||
//eomc_ctrl_out_type_cur = 3 | |||
|
|||
return true; | |||
|
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.
We noticed there was this return
before any of the error messages were printed, was this intentional or a small bug, @randaz81 ?
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.
Nice catch @AlexAntn!
Because of this, there was no hope to see error messages popping up.
firstjoint = i; | ||
break; | ||
} |
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.
Introduced a break on the firstjoint
loop, so now it correctly gets the first joint (instead of the last enabled one)
if(ppids[firstjoint].fbk_PidUnits != ppids[i].fbk_PidUnits || | ||
ppids[firstjoint].out_PidUnits != ppids[i].out_PidUnits) | ||
{ | ||
yError() << "embObjMC BOARD " << _boardname << "all joints with POSITION enabled should have same controlunits type. Joint " << firstjoint << " differs from joint " << i; |
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.
finally, added the error message for position control (not just torque). Also, made the origin of the messages more evident by putting in caps (e.g.: POSITION
) the type of control that is reporting the error
Co-authored-by: Ugo Pattacini <ugo.pattacini@iit.it>
Nice fix! |
I think it's valuable feedback @randaz81 👍🏻 |
As @randaz81 suggested, I put the print into a function that is now called (instead of having the same code spread all over). |
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.
Minor comments
Thanks @AlexAntn 👍🏻 |
Thanks all! |
This pull request introduces a warning message when the configuration of position control PID is not consistent across the different joints, resulting in wrong values for the PIDs (mismatching between
machine_units
andmetric_units
).This PR addresses this issue.
@randaz81 : This implementation covers only position control, since the configuration for other types of control is slightly different. Should this be implemented for all different types of control?