-
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
Adds Ability to Clone a RigidBodyTree. #4958
Adds Ability to Clone a RigidBodyTree. #4958
Conversation
73fb554
to
5d7a06a
Compare
5d7a06a
to
8fd1e07
Compare
6813c58
to
1948071
Compare
@drake-jenkins-bot linux-xenial-clang-ninja-experimental-open-source please. |
1948071
to
037ce0a
Compare
+@amcastro-tri for feature review please. Thanks! Review status: 0 of 5 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
feature review pass done. Reviewed 4 of 5 files at r1. drake/multibody/rigid_body_tree.cc, line 146 at r1 (raw file):
BTW, I would use the id here. Usually you avoid string comparisons in this kind of methods. The id should uniquely identify a body. drake/multibody/rigid_body_tree.cc, line 154 at r1 (raw file):
BTW, ditto about string checking vs. using id's drake/multibody/rigid_body_tree.cc, line 216 at r1 (raw file):
Is this loop to set the frame's body pointer needed at all? isn't the argument in drake/multibody/rigid_body_tree.cc, line 221 at r1 (raw file):
why not drake/multibody/rigid_body_tree.cc, line 266 at r1 (raw file):
num frames drake/multibody/rigid_body_tree.cc, line 293 at r1 (raw file):
num actuators drake/multibody/rigid_body_tree.cc, line 315 at r1 (raw file):
BTW, probably worth having a drake/multibody/rigid_body_tree.cc, line 362 at r1 (raw file):
BTW, ditto here about having a drake/multibody/rigid_body_tree.cc, line 377 at r1 (raw file):
didn't we agree on using exact comparison for the clones? drake/multibody/rigid_body_tree.h, line 128 at r1 (raw file):
no param? drake/multibody/test/rigid_body_tree/CMakeLists.txt, line 28 at r1 (raw file):
BTW, just curiosity, what do these SIZE arguments do, I've never seen them drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 56 at r1 (raw file):
using Prius with LIDAR. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 71 at r1 (raw file):
BTW, usually we'd use kQuaternion, but ok for a test if that was your intention. Comments from Reviewable |
037ce0a
to
45f72f1
Compare
I addressed all reviewer comments. PTAL. Thanks! Review status: 1 of 9 files reviewed at latest revision, 13 unresolved discussions. drake/multibody/rigid_body_tree.cc, line 146 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 154 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 216 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. Good point. drake/multibody/rigid_body_tree.cc, line 221 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 266 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 293 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 315 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 362 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/rigid_body_tree.cc, line 377 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. (See new code in drake/multibody/rigid_body_tree.h, line 128 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/test/rigid_body_tree/CMakeLists.txt, line 28 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
They control how much time CI allows the test to run before aborting. See: Line 17 in 71f7140
drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 56 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. Thanks. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 71 at r1 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done (Added explanation). Comments from Reviewable |
45f72f1
to
c78c1c9
Compare
Reviewed 7 of 7 files at r2. drake/multibody/rigid_body_loop.cc, line 15 at r2 (raw file):
BTW, for my own education. How is the use of drake/multibody/rigid_body_tree.cc, line 155 at r2 (raw file):
BTW, I don't know why you'd have this here. I would just simplify and have a single index, drake/multibody/rigid_body_tree.cc, line 205 at r2 (raw file):
Why instead of using drake/multibody/test/rigid_body_tree/CMakeLists.txt, line 28 at r1 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
Cool, thanks! Comments from Reviewable |
Review status: 8 of 9 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/rigid_body_loop.cc, line 15 at r2 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
The use of a logging subsystem is advantageous in that you can redirect all log messages by changing just the logging subsystem rather than every call sight. In this case, we disable the log messages so that they incur zero instructions when Drake is built in non-debug mode. As another example, we can modify the logging subsytem to store the log output to a file or even on a remote server. For a full list of features of the particular backend being used in this context, see: https://github.com/gabime/spdlog#features. The above may also be possible using Comments from Reviewable |
Review status: 8 of 9 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/rigid_body_loop.cc, line 15 at r2 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
Thanks! Comments from Reviewable |
d2b67e9
to
9da672e
Compare
Review status: 4 of 28 files reviewed at latest revision, 5 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 195 at r5 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
I see, I guess it's ok for a unit test. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 277 at r5 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
Yes, I do. The period is Comments from Reviewable |
9da672e
to
136ce17
Compare
Review status: 4 of 12 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 277 at r5 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
BTW, using a variable step integrator seems like a better option than trying to estimate the ideal time step ahead of time. While it may be possible here in general it can't be done in the presence of drastic changes in behavior during a simulation (such as impacts). Comments from Reviewable |
1119fb5
to
84c4b23
Compare
Review status: 4 of 11 files reviewed at latest revision, 4 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 277 at r5 (raw file): Previously, sherm1 (Michael Sherman) wrote…
Done. Comments from Reviewable |
84c4b23
to
48c8ff3
Compare
Feature review pass done. Just a few comments but otherwise this is great @liangfok. Thanks. Reviewed 2 of 7 files at r4, 4 of 5 files at r6. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 29 at r6 (raw file):
It seems like this method drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 177 at r6 (raw file):
BTW, nice! thanks for adding the equation. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file):
Lengths are positive, coordinates can be negative. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 184 at r6 (raw file):
BTW, I don't think we should cite wikipedia for this, is not a very scientific source of information. Also this equation is very well known that people usually know it by heart. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 186 at r6 (raw file):
Use positive quantities. Lengths are positive, the acceleration of gravity is positive as well. drake/multibody/test/rigid_body_tree/rigid_body_tree_compare_to_clone.cc, line 6 at r6 (raw file):
Should you move into drake/multibody/test/rigid_body_tree/rigid_body_tree_compare_to_clone.h, line 9 at r6 (raw file):
Now that it's outside RBT consider updating to: "This method clones the input @p tree and verifies its correctness against the original RigidBodyTree. Since ...` Comments from Reviewable |
48c8ff3
to
7b7191c
Compare
Review status: 5 of 11 files reviewed at latest revision, 9 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 29 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 177 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
You're welcome! drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done in terms of adding the units. I actually think the center of mass is at Z = -0.5 m. See the screenshot below of It shows that the pendlum's arm has a length of 0.75 m and its center of mass is at Z = -0.5 m. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 184 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 186 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/test/rigid_body_tree/rigid_body_tree_compare_to_clone.cc, line 6 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. drake/multibody/test/rigid_body_tree/rigid_body_tree_compare_to_clone.h, line 9 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Done. Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
I believe Gazebo is just showing the Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Good point. Looking at the URDF, I see the following:
Notice that both Also, when I use zero the inertias of the Pendulum's Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, liangfok (Chien-Liang Fok) wrote…
Right, the default Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
I'm pretty sure that, in this case, both the "arm" and "arm_com" frames are at Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 3 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file):
I always thought that Comments from Reviewable |
Review status: 5 of 11 files reviewed at latest revision, 2 unresolved discussions. drake/multibody/test/rigid_body_tree/rigid_body_tree_clone_test.cc, line 180 at r6 (raw file): Previously, amcastro-tri (Alejandro Castro) wrote…
Excellent. Glad to have this cleared up! We should probably update the documentation of Pendulum.urdf to avoid future confusion: #5156. Comments from Reviewable |
Reviewed 3 of 5 files at r6, 5 of 5 files at r7. drake/multibody/BUILD, line 101 at r7 (raw file):
drake/multibody/BUILD, line 105 at r7 (raw file):
This is not necessary anymore - please sync past #5155 and remove. drake/multibody/rigid_body_actuator.cc, line 19 at r7 (raw file):
Another CompareToClone? drake/multibody/rigid_body_loop.cc, line 13 at r7 (raw file):
Another CompareToClone? Comments from Reviewable |
0f4bf26
to
0a5fa88
Compare
0a5fa88
to
4806310
Compare
@david-german-tri, I addressed your comments. PTAL. Thanks. Review status: 4 of 15 files reviewed at latest revision, 4 unresolved discussions. drake/multibody/BUILD, line 101 at r7 (raw file): Previously, david-german-tri (David German) wrote…
Done. drake/multibody/BUILD, line 105 at r7 (raw file): Previously, david-german-tri (David German) wrote…
Done. drake/multibody/rigid_body_actuator.cc, line 19 at r7 (raw file): Previously, david-german-tri (David German) wrote…
Done. drake/multibody/rigid_body_loop.cc, line 13 at r7 (raw file): Previously, david-german-tri (David German) wrote…
Done. Comments from Reviewable |
Reviewed 11 of 12 files at r8. Comments from Reviewable |
* Adds ability to clone RigidBodyTree.
This fulfills spiral 1 of #4897. The ability to clone RigidBodyTree is necessary to support
RigidBodyTree:: DoToAutoDiffXd()
.This change is