-
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
Dev/sf pr #2712
Dev/sf pr #2712
Conversation
+@ggould-tri since is the platform reviewer for today. Review status: 0 of 9 files reviewed at latest revision, 1 unresolved discussion. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 154 [r1] (raw file):
Follow the cpp guide for naming conventions. E.g: Comments from Reviewable |
BTW this is going to take me a bit of time to review. In the meanwhile perhaps you can start fixing the problems Jenkins has found so far on some platforms? Reviewed 1 of 6 files at r2. Comments from Reviewable |
At +4000 lines, this PR is well larger than is practical to review. I expect that it will take until well into next week (ie, after the long weekend) before I have a complete set of comments. I will try to file intermediate comments as I go, but this is going to be a long one. In the future please try to find ways to break up large PRs like this. Even if you don't reach intermediate PR-able points in your development, you can at least structure your ultimate submission for staged review, for instance by using |
FWIW, it is 1000 lines of code + 3000 lines of data. |
Thanks for the inputs. Review status: 1 of 9 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
Saving my comments so far. Review still in progress. Reviewed 3 of 6 files at r2. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.cpp, line 5 [r2] (raw file):
Whitespace: Indentation does not line up. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.cpp, line 6 [r2] (raw file):
Code conventions prefer all input parameters before all output parameters: drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.cpp, line 45 [r2] (raw file):
FYI -- Complete sentence; capitalize and add a period. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.cpp, line 54 [r2] (raw file):
drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 58 [r2] (raw file):
Prefer doxygen style for comments documenting public members. In this case that would be drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 84 [r2] (raw file):
FYI -- Consider moving this logic to the cpp file. This would also let you move the include of drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 123 [r2] (raw file):
FYI The next four items are complete sentences and so should end in periods. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 156 [r2] (raw file):
Can this method be const? drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 156 [r2] (raw file):
Code conventions prefer all input parameters before all output parameters: drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 9 [r2] (raw file):
FYI -- Capitalize and punctuate. drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 39 [r2] (raw file):
long line. drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 57 [r2] (raw file):
FYI -- Consider 'const' on all of these (per https://google.github.io/styleguide/cppguide.html#Constant_Names changing their names to 'k style' is optional). drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 100 [r2] (raw file):
Capitalize and punctuate throughout. drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 250 [r2] (raw file):
Does this really only work with Snopt or would drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 265 [r2] (raw file):
Unconditionally writing to cout is usually not appropriate, particularly in the high-frequency loop. Consider conditionalizing this, eg drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 319 [r2] (raw file):
I have no idea what this comment means. Rephrase it? drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 342 [r2] (raw file):
FYI -- This expression (and the similar ones following) are difficult to read. Consider (author's discretion) adding some parens, moving your newlines, or otherwise making the code visually resemble its parse. drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 344 [r2] (raw file):
FYI -- I believe this code may be called in a tight loop, and so this output will spam the console. Consider conditionalizing it, eg on Comments from Reviewable |
Reviewed 1 of 6 files at r2, 2 of 5 files at r3. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.cpp, line 47 [r3] (raw file):
Perhaps you could document or make named variables out of all these constant positions such as the suggestion of @ggould-tri below? drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 18 [r3] (raw file):
Nit : Consider using proper sentences here. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 42 [r3] (raw file):
Consider linking to a diagrammatic representation of the various frames and their locations. drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 9 [r3] (raw file):
This should be a TODO comment https://google.github.io/styleguide/cppguide.html#TODO_Comments drake/examples/QPInverseDynamicsForHumanoids/QPController.cpp, line 249 [r3] (raw file):
Needs a check to see if the solver is available. Comments from Reviewable |
Review status: 4 of 9 files reviewed at latest revision, 17 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/HumanoidState.h, line 42 [r3] (raw file):
|
This PR introduces new files. Should the C++ style guide's rules for file names be enforced? https://google.github.io/styleguide/cppguide.html#File_Names Review status: 4 of 9 files reviewed at latest revision, 17 unresolved discussions, some commit checks failed. Comments from Reviewable |
+1 to Liang's note above. New files must follow the style guide ( Other than that, and the issues noted below, this all looks good to me. I don't know enough about the subject matter to verify all of the math and names, so I hope feature reviewer @naveenoid who has more experience with humanoid mechanics can verify that in more detail. Reviewed 1 of 9 files at r1, 1 of 6 files at r2, 5 of 5 files at r3. drake/examples/QPInverseDynamicsForHumanoids/RBTUtils.cpp, line 13 [r3] (raw file):
Complete sentence: Capitalize and punctuate. drake/examples/QPInverseDynamicsForHumanoids/RBTUtils.cpp, line 17 [r3] (raw file):
Complete sentence: Capitalize and punctuate. drake/examples/QPInverseDynamicsForHumanoids/RBTUtils.cpp, line 25 [r3] (raw file):
Complete sentence: Capitalize and punctuate. drake/examples/QPInverseDynamicsForHumanoids/RBTUtils.cpp, line 47 [r3] (raw file):
Complete sentence: Capitalize. drake/examples/QPInverseDynamicsForHumanoids/RBTUtils.h, line 8 [r3] (raw file):
This comment should be marked as TODO(siyuanfeng-tri). drake/examples/QPInverseDynamicsForHumanoids/test.cpp, line 5 [r3] (raw file):
Complete sentence: Capitalize and punctuate. Comments from Reviewable |
I will fix the names. Thanks guys. Review status: 1 of 9 files reviewed at latest revision, 24 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/test.cpp, line 5 [r3] (raw file):
|
My 2 cents on this Review status: 1 of 9 files reviewed at latest revision, 30 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.cc, line 4 [r4] (raw file):
Why to have this offset to be a static constant? is this exclusive to Valkyrie? why not to have it as a parameter (maybe with default value of 9 cm) that the user of drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.cc, line 5 [r4] (raw file):
ditto. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.cc, line 38 [r4] (raw file):
drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 9 [r4] (raw file):
Is this supposed to be a Doxygen doc? if so, what is it documenting? file, class? take a look at the generated doxygen. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 44 [r4] (raw file):
There is a very specific concept of "state" in Drake and that will become even stronger with System 2.0. Is "HumanoidState" what we want to call this? @sherm1 or @david-german-tri, what's your take on this? drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 44 [r4] (raw file):
I don't know if worth at this stage. But none of these files seem to be following the style guide, at least for naming conventions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 63 [r4] (raw file):
avoid using abbreviations like these as per style guide. https://google.github.io/styleguide/cppguide.html#General_Naming_Rules drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 66 [r4] (raw file):
Does you bias term include gravity? or is it just the Coriolis term? (usually denoted by C(q,qdot)?) drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 71 [r4] (raw file):
drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 72 [r4] (raw file):
why not drake/examples/QPInverseDynamicsForHumanoids/rigid_body_tree_utils.cc, line 5 [r4] (raw file):
I know this is in other places within RBT but I think we should discourage this API. Why not just overload this method on passing either a RigidBody or a RigidBodyFrame? drake/examples/QPInverseDynamicsForHumanoids/rigid_body_tree_utils.cc, line 7 [r4] (raw file):
This is an expensive way to obtain a body. drake/examples/QPInverseDynamicsForHumanoids/rigid_body_tree_utils.cc, line 7 [r4] (raw file):
Notice that this method should be marked as deprecated as per Twan's comment in the header description. Volunteer to PR that (in just a single PR)? drake/examples/QPInverseDynamicsForHumanoids/rigid_body_tree_utils.h, line 8 [r3] (raw file):
|
Reviewed 14 of 14 files at r4. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.cc, line 6 [r2] (raw file):
|
Review status: all files reviewed at latest revision, 20 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 66 [r4] (raw file):
|
Reviewed 3 of 14 files at r4, 3 of 3 files at r5. Comments from Reviewable |
Review status: all files reviewed at latest revision, 21 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.cc, line 4 [r4] (raw file):
|
Review status: all files reviewed at latest revision, 22 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 15 [r4] (raw file):
Style guide only permits public members in a drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 44 [r4] (raw file):
|
Review status: all files reviewed at latest revision, 23 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 9 [r4] (raw file):
|
Review status: 3 of 9 files reviewed at latest revision, 22 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_state.h, line 15 [r4] (raw file):
|
A series of minor style nits (some discretionary) and a couple of possible opportunities for Reviewed 4 of 14 files at r4, 8 of 8 files at r6. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.h, line 149 [r6] (raw file):
FYI -- consider const. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.h, line 155 [r6] (raw file):
FYI This is only set in the ctor and can reasonably be const (although it will have to move to the initializer list). drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 352 [r6] (raw file):
FYI -- cappunc. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 362 [r6] (raw file):
FYI -- cappunc. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h, line 11 [r6] (raw file):
FYI prefer doxygen style comment ( drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h, line 14 [r6] (raw file):
FYI there is a doxygen style for documenting a group of parameters together. It is author's discretion whether to use it or not but you should at least be aware that it exists if you were not. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h, line 43 [r6] (raw file):
FYI Prefer doxygen style. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h, line 46 [r6] (raw file):
FYI consider doxygen grouping. Comments from Reviewable |
Review status: all files reviewed at latest revision, 20 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h, line 14 [r6] (raw file):
|
Reviewed 1 of 1 files at r7. Comments from Reviewable |
Um, something in here just blew up the diffs list. I now seem to have 96 files to review. Review status: 6 of 103 files reviewed at latest revision, 16 unresolved discussions, some commit checks failed. Comments from Reviewable |
It was some git mistake. Commits to master got added here, as if they we new in this PR. Github says "This branch has conflicts that must be resolved" so perhaps just wait for that to be fixed first? |
FYI (to be non blocking) clearly seem to be merge artefacts..I propose I will complete feature review here and a new PR is built after feature and platform LGTMs.. Review status: 6 of 103 files reviewed at latest revision, 16 unresolved discussions, some commit checks failed. Comments from Reviewable |
Review status: 6 of 103 files reviewed at latest revision, 18 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 90 [r14] (raw file):
I suggest a rename of tau0 to tauFixedTerm or something else. drake/examples/QPInverseDynamicsForHumanoids/test.cc, line 74 [r14] (raw file):
Could you potentially include a couple of other robot configurations..just to be sure there are no artefacts due to initialising at a single configuration alone..Something like leaning on 1 foot or the other as well.. Comments from Reviewable |
Review status: 4 of 103 files reviewed at latest revision, 18 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 90 [r14] (raw file):
|
For TRI developers, we should not accept that state of affairs. We should be able to help fix the git history (with a force-push) to be sensible, without throwing it away and starting over. |
Review status: 2 of 10 files reviewed at latest revision, 15 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.cc, line 8 [r19] (raw file):
|
Done with review. F2f tomorrow to discuss (mostly for my own education) will help wrapping this up. I also have some suggestions regarding the structure of this code but I will leave that up to you to change in this PR (I am ok if you'd like to do those in this one since this PR is huge already) or in a future one. Review status: 2 of 10 files reviewed at latest revision, 16 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/test.cc, line 1 [r20] (raw file):
you should call this file something more specific like, drake/examples/QPInverseDynamicsForHumanoids/valkyrie_sim_drake.urdf, line 1 [r19] (raw file):
|
Review status: 2 of 10 files reviewed at latest revision, 17 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.h, line 28 [r20] (raw file):
Missing a EIGEN_MAKE_ALIGNED_OPERATOR_NEW. We've observed a 50-50% chance of failure especially in Windows builds (#2683, #2679) Comments from Reviewable |
Im done with my review..Based on F2F and the remaining topics raised by @amcastro-tri , i give it Review status: 2 of 10 files reviewed at latest revision, 17 unresolved discussions. Comments from Reviewable |
Reviewed 5 of 15 files at r4, 1 of 9 files at r6, 1 of 4 files at r14, 1 of 1 files at r19, 8 of 8 files at r20. Comments from Reviewable |
Review status: all files reviewed at latest revision, 21 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 132 [r20] (raw file):
For my own education here. These constraints are imposed on the x and y components separately like drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 165 [r20] (raw file):
Make explicit in the comment that this is just a toy model to simplify the formulation. State that even the equations are not dimensionally consistent. drake/examples/QPInverseDynamicsForHumanoids/qp_controller.cc, line 238 [r20] (raw file):
Only if you feel strong about it write cost in therms of dimensionless weights like: J=w*(x/L_x)^2 drake/examples/QPInverseDynamicsForHumanoids/rigid_body_tree_utils.cc, line 12 [r20] (raw file):
Add comment here like "Converting from Plucker vector (Featherstone's spatial vectors) to spatial vector algebra as defined by Abhinandan Jain." Comments from Reviewable |
Review status: all files reviewed at latest revision, 21 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.cc, line 8 [r19] (raw file):
|
Almost there! now CI is complaining cause there were some API changes in RBT and you need to do Review status: 2 of 10 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.cc, line 8 [r19] (raw file):
|
changed humanoidstate to humnoidstatus added a bit more comments.
rebased
rigid_body_tree_utils.cc add the explicitly templated version of RigidBodyTree::parseBodyOrFrameID at the end of RigidBodyTree.cpp
added in alejandro's new comments.
4187527
to
eddb017
Compare
Review status: 2 of 10 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. drake/examples/QPInverseDynamicsForHumanoids/humanoid_status.cc, line 8 [r19] (raw file):
|
Review status: 1 of 10 files reviewed at latest revision, 5 unresolved discussions. drake/examples/QPInverseDynamicsForHumanoids/valkyrie_sim_drake.urdf, line 14 [r19] (raw file):
|
Waiting for CI now but otherwise Review status: 1 of 10 files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
sfeng wrote a inverse dynamics controller for the valkyrie robot in examples/QPInverseDynamicsForHumanoids using the Optimization.h interface.
It is formulated as a Quadratic Program. The current implementation calls SNOPT explicitly for solution. This needs to be updated when appropriate solvers become available.
This change is