-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
More "link" to "body" refactoring. #2597
More "link" to "body" refactoring. #2597
Conversation
+@sherm1 for both levels of review since this is a minor non-functional change. Review status: 0 of 10 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
@liangfok, build failed because this changes the API and forces downstream changes that haven't been made. Also, let's make sure @RussTedrake is happy with the change from "link" to "body" before doing this everywhere. Russ? |
I agree. FTR, it looks like unit test |
what was the motivation for the change? it will break the current "API". Review status: 0 of 10 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
There are two primary motivations:
A secondary motivation is we are currently in a pre-release period where the API is less set-in-stone. It would be best to clean up the API as much as possible now before our first 1.0 release. Review status: 0 of 10 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
i guess i'm ok with it, but i think you have the burden for now of adding back findLink() and finkLinkId() methods which throw a static assert instructing people to update their code to FindBody. Review status: 0 of 10 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
Sure no problem! Thanks. Review status: 0 of 10 files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
…Body of these methods contain a static assertion.
…e/link_to_body_refactor
…ause it delays downstream users from discovering that they need to update their code.
I attempted to add back I then considered replacing the I thus removed these deprecated methods again. If a downstream user compiles their code and it fails because of a missing Perhaps we can institute a more formal deprecation glide path after release 1.0? Review status: 0 of 11 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Forgot to mention: Another option I considered was to have the old API call the new API after printing a warning to On another note, this PR passed https://drake-jenkins.csail.mit.edu/job/experimental/2187/ and is thus ready for another round of review / merge. Review status: 0 of 11 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Would it be possible within the remits of the style guide or similar to add a deprecation comment, use a pragma/trigger a deprecated compiler warning/output an error on runtime and internally call the new API (just saw you added a new comment to that regard). I feel like having a warning/error message shows users they need to act on it (and the deprecation comment when it's going to be removed, e.g. |
Since the compilers all support deprecation as a compile-time warning (standardized in C++14), we could define a Drake macro to mark the old methods, which would call the new ones. The warnings are only issued when the old methods are used. Here is an example of a functional macro for that purpose:
Review status: 0 of 11 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
FWIW -- I am open to the idea of using |
Thanks for all of the advice! How about let's strike a compromise: From now till the 1.0 release, we'll do everything possible to honor the existing method API alongside the new API but add deprecation compile-time and run-time warnings stating that the old APIs will be removed by the 1.0 release. Just prior to the 1.0 release, we remove all of these depreciated methods. Caveat 1: Drake also uses numerous public variables that we should ideally make private or protected. I see no way of doing this without breaking the API, and don' t think we can keep them public until the last minute. For these, I can think of no other option but to force downstream users to use the soon-to-be-introduced accessors for them. Caveat 2: We are considering changing entire class names prior to the 1.0 release. If a class' name is changed, I see no way to maintain both simultaneously unless the new classes are decoupled from the old ones and ideally physically located in a separate directory. This may justify developing the new classes in a separate directory alongside the existing classes (e.g., System 2.0 vs. System 1.0 and potentially Dynamics 2.0 vs. Dynamics 1.0). Thoughts? |
I agree that we should be able to change the c++ code with abandon. I'll go further -- i think it's really important that we feel unconstrained in making those changes. However, findLink is a method that probably every piece of c++ code using drake is calling. Changing it somewhat arbitrarily (because we suddenly like FindBody better) feels like an extreme of abuse to any users, and i hoped that adding a deprecated warning is very easy in this case. If there is an easy solution available, then i think we should consider it. |
…rake into feature/link_to_body_refactor
…Id() because it delays downstream users from discovering that they need to update their code." This reverts commit f337c61.
Shouldn't this be merged or rebased to master, to use the existing deprecated.h instead of a different one? Both reviewable and github are showing drake/common/deprecated.h as new-code in this PR. Comments from Reviewable |
I think that may be a Reviewable issue. I'll close and re-open this PR to fix. Review status: 0 of 12 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
…e/link_to_body_refactor
Looks like this includes your own Reviewed 1 of 12 files at r9. CHANGELOG.md, line 79 [r11] (raw file):
The PR # is wrong and there is no final newline. Comments from Reviewable |
You're right! Doing that right now. Thanks. Reviewed 1 of 12 files at r9. Comments from Reviewable |
Signed-off-by: Chien-Liang Fok <[email protected]>
Reviewed 2 of 12 files at r9. drake/systems/plants/RigidBodyTree.h, line 10 [r11] (raw file):
drake/systems/plants/RigidBodyTree.h, line 581 [r11] (raw file):
@liangfok, this shouldn't be necessary since drake/systems/plants/RigidBodyTree.h, line 584 [r11] (raw file):
This message is wrong -- the macro generates its own boilerplate and the compiler will identify the deprecated declaration. You should just write drake/systems/plants/RigidBodyTree.h, line 616 [r11] (raw file):
Fix message. Comments from Reviewable |
Review status: 2 of 11 files reviewed at latest revision, 5 unresolved discussions. CHANGELOG.md, line 79 [r11] (raw file):
|
Reviewed 5 of 12 files at r9, 1 of 1 files at r11. CHANGELOG.md, line 79 [r11] (raw file):
|
Review status: 7 of 11 files reviewed at latest revision, 4 unresolved discussions. CHANGELOG.md, line 79 [r11] (raw file):
|
Reviewed 2 of 12 files at r9, 1 of 1 files at r13, 2 of 2 files at r14. drake/systems/plants/RigidBodyTree.h, line 581 [r11] (raw file):
|
Review status: all files reviewed at latest revision, 3 unresolved discussions. drake/systems/plants/RigidBodyTree.h, line 581 [r11] (raw file):
|
I'm going to de-assign myself. By all means if merging ends up blocked on a flake, please bring ping me here or DM me on slack to use my override powers, but in general I think either the platform reviewer or author should push the merge button; the on-call reviewer doesn't need to be involved (and will often lack the necessary context). |
OS X CI appears to have suffered a known flake:
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. Comments from Reviewable |
@drake-jenkins-bot retest this please |
This PR passed https://drake-jenkins.csail.mit.edu/job/experimental/2276/ and is thus ready for final review / merge. Review status: all files reviewed at latest revision, 3 unresolved discussions. Comments from Reviewable |
Just one SWIG question remaining. Review status: all files reviewed at latest revision, 3 unresolved discussions. drake/systems/plants/RigidBodyTree.h, line 581 [r11] (raw file):
|
I addressed all reviewer comments. PTAL. Thanks! Review status: all files reviewed at latest revision, 3 unresolved discussions. drake/systems/plants/RigidBodyTree.h, line 581 [r11] (raw file):
|
Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from Reviewable |
Liang, reviewable completion is held up on two of your own comments that need acknowledging. Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from Reviewable |
This change is