-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add optional state publishing to PID controller #37
Add optional state publishing to PID controller #37
Conversation
Per-changeset comments:
|
6dabd8f: Thanks for pointing out that message, didn't spot it before. I'm a little skeptical of using it, since the PID library wouldn't always be used to control a joint, so the message name would be a little deceptive. It seems that in ROS the pattern is to create per-application message types for clarity. Additionally, from inside the controller I don't have access to the setpoint (only the error), so I can't fill that field. I could move the PID message to control_msgs if you'd be amenable to that? |
Also, the JointStateController message doesn't include the three terms (p_term, i_term, d_term), which are the helpful bits for tuning a controller. |
I get that the I find the message type you propose less informative than Also, it would be best if new messages made it to |
Sounds good on all points. Any proposals for what additional information you'd like to see in the PidState message? |
Moved message to control_msgs, depends on ros-controls/control_msgs#14 |
7a9796f
to
a459b31
Compare
Updated with ros-controls/control_msgs#14, other dependencies met, ping for review. |
a459b31
to
ce5e806
Compare
Please rebase now that #46 has been merged, and we preserved the implementation in Also, please make two commits: One with the style change, and another one with the enhancement. |
ce5e806
to
e229d99
Compare
Ping for review. No style change here. |
// Publish controller state if configured | ||
if (publish_state_ && state_publisher_.trylock()) | ||
{ | ||
state_publisher_.msg_.header.stamp = ros::Time::now(); |
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.
Hmmm, I realize just now that under certain RTOSes, like Xenomai 2.6.X, ros::Time::now
is a no-no, as there's a Linux system call involved.
Since state publishing is optional and comes disabled by default, I think your proposal is an acceptable compromise.
Could you please document the publish_state
parameter here, and mention that if enabled, it may break real-time guarantees on certain RTOS?. I think that with this, the PR can be merged.
e229d99
to
cf70afe
Compare
@adolfo-rt, added the documentation, thanks |
Could you update this please? |
ed57e82
to
7a140eb
Compare
Rebased on kinetic-devel |
Unfortunately you have to open a new PR pointing to kinetic-devel, github is rigid on the "from-to" relations of PRs, cannot edit this one... |
Also a minor change to computeCommand calls, to chain the two implementations rather than replicate code.