-
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
Strandbeest example #13302
Strandbeest example #13302
Conversation
We have The xacro data is large; did you write it on your own? Or was it copied from somewhere? (If so, we need to preserve its copyright and licensing.) |
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.
Ok thanks, I'd appreciate your help with the @xacro
integration.
I actually adapted the xacro from data from an old drake commit:
https://github.com/RobotLocomotion/drake/tree/last_sha_with_original_matlab/drake/examples/Strandbeest
Things like link names, dimensions and joint associations are the same. But there is a lot added for calculating mass/inertia accurately and the custom tags added to replace loop_joint
s.
Reviewable status: needs platform reviewer assigned, needs at least two assigned reviewers
Wow, see d87d931 -- maybe Robin actually wrote these by hand originally? I assumed we'd copied them from somewhere else. It might be nice to add Co-authored-by on the commit with the xacro, or even curate a first commit with just the file added unmodified from the few years ago. Then it would also call out your edits as diffs. |
@joemasterjohn did a lot of editing to this model to get physical properties such as mass and rotational inertias right (we found out a must to get time scales right). I agree though we should give both Joe and Robin credit for this model. |
=> #13304 provides what I hope are sufficient bazel xacro macros to generate the sdf on demand. |
3c7070b
to
7605acc
Compare
3c6b542
to
2ec3ea9
Compare
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.
+@avalenzu for feature review on Monday, please!
Reviewable status: LGTM missing from assignee avalenzu, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on @avalenzu)
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.
Review pass done. PTAL.
Reviewed 7 of 7 files at r1.
Reviewable status: 10 unresolved discussions, LGTM missing from assignee avalenzu, needs platform reviewer assigned, needs at least two assigned reviewers, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @joemasterjohn)
examples/multibody/strandbeest/BUILD.bazel, line 28 at r1 (raw file):
test_rule_timeout = "moderate", deps = [ "//common:find_resource",
nit: Could you add //common:add_text_logging_gflags
to the deps
here? That enables the --spdlog_level
flag. See https://github.com/RobotLocomotion/drake/blob/master/common/add_text_logging_gflags.cc.
examples/multibody/strandbeest/BUILD.bazel, line 36 at r1 (raw file):
"//multibody/tree", "//solvers", "//solvers:snopt_solver",
nit: This is redundant, as snopt_solver
is already included in //solvers
.
examples/multibody/strandbeest/README.md, line 1 at r1 (raw file):
# Strandbeest
This file should probably have an acknowledgment of Theo Jansen (the creator of the Strandbeest).
examples/multibody/strandbeest/README.md, line 4 at r1 (raw file):
## Change the model Modfiy any relevant values in `model/Macros.xacro`. The Strandbeest model is
nit: s/Modifiy/Modify
examples/multibody/strandbeest/README.md, line 9 at r1 (raw file):
## Run the example
bazel run --config snopt //examples/multibody/strandbeest:run_with_motor
Does the IK solve in run_with_motor
only work with SNOPT? If not, it would be better to leave out the --config snopt
.
examples/multibody/strandbeest/run_with_motor.cc, line 140 at r1 (raw file):
} // Set the penetration allowand and stiction tolerance to values that make
nit: s/allowand/allowance
examples/multibody/strandbeest/run_with_motor.cc, line 162 at r1 (raw file):
auto diagram = builder.Build(); // Create a context for this system and context for the strandbeest system.
nit: This would probably be clearer as "... for the diagram and extract the context for the ..."
examples/multibody/strandbeest/run_with_motor.cc, line 207 at r1 (raw file):
strandbeest.GetForceElement<LinearBushingRollPitchYaw>(bushing_index); ik.AddPointToPointDistanceConstraint(bushing.frameA(), Eigen::Vector3d(),
I thought that Eigen's default constructors left data uninitialized?
examples/multibody/strandbeest/model/LegAssembly.xacro, line 158 at r1 (raw file):
<frame name="${prefix}_loop_f_g_bushing_frameA" link="${prefix}_bar_f" rpy="-1.5707963267948966 0 0"
Could these super precise constants be replaced with ${pi/2}
as was done earlier in this file?
examples/multibody/strandbeest/model/LegPair.xacro, line 69 at r1 (raw file):
<frame name="${prefix}_leg1_loop_a_c_bushing_frameA" link="${prefix}_bar_a" rpy="-1.5707963267948966 0 0"
Could this be ${-pi/2}
here and below?
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.
Thanks @avalenzu! The IK does solver with the default chosen solver without added --config snopt
(which is IPOPT), but I have been running it with SNOPT because it is considerably faster. I thought that IPOPT might be causing the timeout failure I'm seeing in CI, but even after changing the test timeout to moderate
it seems to timeout on two builds. Any ideas?
Reviewable status: 5 unresolved discussions, LGTM missing from assignee avalenzu, needs platform reviewer assigned, needs at least two assigned reviewers, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @avalenzu)
examples/multibody/strandbeest/BUILD.bazel, line 28 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
nit: Could you add
//common:add_text_logging_gflags
to thedeps
here? That enables the--spdlog_level
flag. See https://github.com/RobotLocomotion/drake/blob/master/common/add_text_logging_gflags.cc.
Done.
examples/multibody/strandbeest/BUILD.bazel, line 36 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
nit: This is redundant, as
snopt_solver
is already included in//solvers
.
Done.
examples/multibody/strandbeest/README.md, line 1 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
This file should probably have an acknowledgment of Theo Jansen (the creator of the Strandbeest).
Done.
examples/multibody/strandbeest/README.md, line 9 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
Does the IK solve in
run_with_motor
only work with SNOPT? If not, it would be better to leave out the--config snopt
.
No, but it is considerably faster than the default chosen solver (Ipopt in my default setup. I've added running with SNOPT as an optional thing to do, with a link to Drake docs for SNOPT setup.
examples/multibody/strandbeest/run_with_motor.cc, line 207 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
I thought that Eigen's default constructors left data uninitialized?
Oh good catch. Surprised that didn't cause havoc in the IK.
examples/multibody/strandbeest/model/LegAssembly.xacro, line 158 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
Could these super precise constants be replaced with
${pi/2}
as was done earlier in this file?
Done.
examples/multibody/strandbeest/model/LegPair.xacro, line 69 at r1 (raw file):
Previously, avalenzu (Andres Valenzuela) wrote…
Could this be
${-pi/2}
here and below?
Done.
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.
+@sammy-tri for platform review.
Reviewed 6 of 6 files at r2.
Reviewable status: LGTM missing from assignee sammy-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @sammy-tri)
examples/multibody/strandbeest/README.md, line 9 at r1 (raw file):
Previously, joemasterjohn (Joe Masterjohn) wrote…
No, but it is considerably faster than the default chosen solver (Ipopt in my default setup. I've added running with SNOPT as an optional thing to do, with a link to Drake docs for SNOPT setup.
Perfect.
examples/multibody/strandbeest/run_with_motor.cc, line 207 at r1 (raw file):
Previously, joemasterjohn (Joe Masterjohn) wrote…
Oh good catch. Surprised that didn't cause havoc in the IK.
Yeah, I was surprised by that too ... ¯_(ツ)_/¯
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.
Reviewed 2 of 7 files at r1, 6 of 6 files at r2.
Reviewable status: 5 unresolved discussions, LGTM missing from assignee sammy-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @joemasterjohn)
examples/multibody/strandbeest/run_with_motor.cc, line 21 at r2 (raw file):
#include "drake/multibody/inverse_kinematics/inverse_kinematics.h" #include "drake/multibody/parsing/parser.h" #include "drake/multibody/plant/contact_results_to_lcm.h"
unused (at least directly)
examples/multibody/strandbeest/run_with_motor.cc, line 39 at r2 (raw file):
using multibody::BodyIndex; using multibody::ForceElementIndex; using multibody::Frame;
unused
examples/multibody/strandbeest/run_with_motor.cc, line 42 at r2 (raw file):
using multibody::InverseKinematics; using multibody::Joint; using multibody::JointIndex;
unused
examples/multibody/strandbeest/model/LegAssembly.xacro, line 118 at r2 (raw file):
</joint> <joint name="${prefix}_joint_k_i" type="revolute">
Should the joint names match the names of the links being joined in all cases? This joint "k_i" joints bars "k" and "g". There are a couple others below which also don't match ("j_e" and "e_f").
examples/multibody/strandbeest/model/Macros.xacro, line 31 at r2 (raw file):
<xacro:macro name="strandbeest_cylinder_inertial" params="xyz rpy length radius">
parameter radius
is unused?
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.
Reviewable status: 5 unresolved discussions, LGTM missing from assignee sammy-tri(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @sammy-tri)
examples/multibody/strandbeest/run_with_motor.cc, line 21 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
unused (at least directly)
Sorry, I'm confused on which include you're talking about here because I use ConnectContactResultsToDrakeVisualizer
in do_main()
and LinearBushingRollPitchYaw
when constructing constraints for the IK.
examples/multibody/strandbeest/run_with_motor.cc, line 39 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
unused
Done.
examples/multibody/strandbeest/run_with_motor.cc, line 42 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
unused
Done.
examples/multibody/strandbeest/model/LegAssembly.xacro, line 118 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
Should the joint names match the names of the links being joined in all cases? This joint "k_i" joints bars "k" and "g". There are a couple others below which also don't match ("j_e" and "e_f").
Done.
examples/multibody/strandbeest/model/Macros.xacro, line 31 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
parameter
radius
is unused?
Done.
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.
Reviewed 3 of 3 files at r3.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits)
examples/multibody/strandbeest/run_with_motor.cc, line 21 at r2 (raw file):
Previously, joemasterjohn (Joe Masterjohn) wrote…
Sorry, I'm confused on which include you're talking about here because I use
ConnectContactResultsToDrakeVisualizer
indo_main()
andLinearBushingRollPitchYaw
when constructing constraints for the IK.
My bad, I forgot where that was defined. Sorry!
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.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits)
examples/multibody/strandbeest/run_with_motor.cc, line 21 at r2 (raw file):
Previously, sammy-tri (Sam Creasey) wrote…
My bad, I forgot where that was defined. Sorry!
Ok thanks!
Adds a parameterized strandbeest example that tests out the new URDF parsing capabilities for creating
LinearBushingRollPitchYaw
(#13255).This change is