-
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
Add ExternallyAppliedSpatialForceMultiplexer #18171
Add ExternallyAppliedSpatialForceMultiplexer #18171
Conversation
py plant: - Remove unneeded qualifier for ExternallyAppliedSpatialForce - test_propeller: Use body name rather than magic number adder_test: - Add check for discrete number of states - Use std::make_unique instead of .reset()
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.
+@RussTedrake Might you have time for quick feature review?
Reviewable status: LGTM missing from assignee RussTedrake(platform), needs at least two assigned reviewers, missing label for release notes (waiting on @RussTedrake)
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.
with just a few comments below. thanks!
+@sherm1 for platform review, please.
Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee sherm1(platform), missing label for release notes (waiting on @EricCousineau-TRI and @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 16 at r1 (raw file):
@system name: ExternallyAppliedSpatialForceMultiplexer
nit: can we make it clear that the inputs are still std::vector (as opposed to just ExternallyAppliedSpatialForce elements by themselves)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 41 at r1 (raw file):
*/ explicit ExternallyAppliedSpatialForceMultiplexer(int num_inputs);
nit: strange whitespace (between the comment and the method, but then no whitespace after...?
56714f7
to
45639a8
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.
Reviewable status: LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @RussTedrake and @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 16 at r1 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
nit: can we make it clear that the inputs are still std::vector (as opposed to just ExternallyAppliedSpatialForce elements by themselves)
Done, I think?
Though admittedly, this name is now super long.
Should I just revert, and denote input port types instead?
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 41 at r1 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
nit: strange whitespace (between the comment and the method, but then no whitespace after...?
Done. Oops!
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: 1 unresolved discussion, LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @RussTedrake and @sherm1)
a discussion (no related file):
Working: Mark revision.
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.
Russ / Sherm, if y'all have a chance, please look at base..r2 and base..r3 and let me know which names you prefer.
Reviewable status: LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @RussTedrake and @sherm1)
a discussion (no related file):
Previously, EricCousineau-TRI (Eric Cousineau) wrote…
Working: Mark revision.
Done. Restored shorter name, relied on docs.
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 1 of 5 files at r3.
Reviewable status: LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 16 at r1 (raw file):
Previously, EricCousineau-TRI (Eric Cousineau) wrote…
Done, I think?
Though admittedly, this name is now super long.Should I just revert, and denote input port types instead?
I prefer the shorter name. I just want it to be clear in the docs.
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 4 of 5 files at r3, all commit messages.
Reviewable status: LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @sherm1)
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: LGTM missing from assignee sherm1(platform), commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 16 at r1 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
I prefer the shorter name. I just want it to be clear in the docs.
OK Thanks!
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.
I also prefer the shorter name.
"Combining" forces usually means adding them together, which is what I expected here at first. I see that what is actually happening is concatenation, rather than combining. To avoid confusion, please consider saying that explicitly here and naming the output port "concatenated" rather than "combined".
Platform pending a few minor things.
Reviewed 2 of 7 files at r1, 5 of 5 files at r3, all commit messages.
Reviewable status: 5 unresolved discussions, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @EricCousineau-TRI)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 13 at r3 (raw file):
/** Combines multiple std::vector<>'s of ExternallyAppliedSpatialForce<T>.
BTW Combines->Concatenates
Also consider promising that the inputs are concatenated in order of input port number, or say explicitly that the concatenation order is undefined. (I mildly prefer the former because I think that's what users would expect.)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 22 at r3 (raw file):
- u(N-1) output_ports: - combined
BTW consider "concatenated" rather than "combined" per comment above
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 16 at r3 (raw file):
namespace { using ListType = std::vector<ExternallyAppliedSpatialForce<double>>;
BTW better to tie this to the dut. Consider:
Code snippet:
using ListType =
ExternallyAppliedSpatialForceMultiplexer<double>::ListType;
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 75 at r3 (raw file):
// Tests that the system computes the correct sum. TEST_F(ExternallyAppliedSpatialForceMultiplexerTest, AddTwoVectors) {
nit: sum -> concatenation, AddTwoVectors -> ConcatenateTwoVectors
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 94 at r3 (raw file):
// Asserts that adders have direct-feedthrough from all inputs to the output. TEST_F(ExternallyAppliedSpatialForceMultiplexerTest, AdderIsDirectFeedthrough) {
nit: adders, Adder -> multiplexers, Multiplexer
nit If we're going to publish these as public types, then we need to Doxygen-document them. (My own preference would be to bury them in 'private' anyway. They don't appear to be useful to users at all.) |
Previously, sherm1 (Michael Sherman) wrote…
FWIW my 2c would be just |
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: 1 unresolved discussion, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @RussTedrake and @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 13 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
BTW Combines->Concatenates
Also consider promising that the inputs are concatenated in order of input port number, or say explicitly that the concatenation order is undefined. (I mildly prefer the former because I think that's what users would expect.)
Done.
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 22 at r3 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
FWIW my 2c would be just
y0
for consistency since that's what https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_multiplexer.html calls it and it likewise that system also does concatenation.
Done, going for y0
multibody/plant/externally_applied_spatial_force_multiplexer.h
line 34 at r3 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
nit If we're going to publish these as public types, then we need to Doxygen-document them.
(My own preference would be to bury them in 'private' anyway. They don't appear to be useful to users at all.)
Done.
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 16 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
BTW better to tie this to the dut. Consider:
OK Buried privately, but thanks!
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 75 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
nit: sum -> concatenation, AddTwoVectors -> ConcatenateTwoVectors
Done.
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 94 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
nit: adders, Adder -> multiplexers, Multiplexer
Done. Removed qualifier (sufficiently informative, IMO)
typo Suggestion: "y0" |
b082bb8
to
ec621cd
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.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @RussTedrake and @sherm1)
multibody/plant/externally_applied_spatial_force_multiplexer.cc
line 22 at r4 (raw file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
typo
Done. D'oh, thanks! Used kUseDefaultName
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 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @EricCousineau-TRI)
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 75 at r3 (raw file):
Previously, EricCousineau-TRI (Eric Cousineau) wrote…
Done.
Still says "sum" in the comment above.
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 94 at r3 (raw file):
Previously, EricCousineau-TRI (Eric Cousineau) wrote…
Done. Removed qualifier (sufficiently informative, IMO)
Still says "adder" in the comment above
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 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @EricCousineau-TRI)
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), missing label for release notes (waiting on @RussTedrake and @sherm1)
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 75 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
Still says "sum" in the comment above.
Done.
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 94 at r3 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
Still says "adder" in the comment above
Done. 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.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: commits need curation (https://drake.mit.edu/reviewable.html#curated-commits), missing label for release notes (waiting on @EricCousineau-TRI)
multibody/plant/test/externally_applied_spatial_force_multiplexer_test.cc
line 94 at r3 (raw file):
Previously, EricCousineau-TRI (Eric Cousineau) wrote…
Done. Sorry!
No worries!
Resolves #13139
Relates #16923
py plant:
adder_test:
\cc @amcastro-tri @jwnimmer-tri
This change is