-
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
Introduce a diagram that implements an IDM model with one external agent. #4081
Introduce a diagram that implements an IDM model with one external agent. #4081
Conversation
0050f05
to
b6ff775
Compare
+@david-german-tri for platform review, please. |
0745dae
to
5323dfe
Compare
Partial checkpoint. Reviewed 10 of 15 files at r1. drake/automotive/CMakeLists.txt, line 17 at r3 (raw file):
Please alpha-sort (interleave) these entries within the list of sources. drake/automotive/idm_planner.cc, line 11 at r3 (raw file):
Unused. drake/automotive/idm_planner.cc, line 46 at r3 (raw file):
Prefer drake/automotive/idm_planner.cc, line 70 at r3 (raw file):
BTW If you drake/automotive/idm_planner.cc, line 82 at r3 (raw file):
This is somewhat unreadable. Consider ways to make it moreso, such as capturing "input_foo->GetAtIndex" into named local variables, and/or making the line wrapping match the math better. drake/automotive/idm_planner.cc, line 89 at r3 (raw file):
If I'm not mistaken, the parent class will already take care of this for us, without writing out this override? drake/automotive/idm_planner.h, line 12 at r3 (raw file):
Please elaborate on the input and output structure, somewhere in this class's APIs (overview and/or methods). drake/automotive/idm_planner.h, line 23 at r3 (raw file):
Missing API comment on what drake/automotive/idm_planner.h, line 32 at r3 (raw file):
Missing disable of copy and assignment. drake/automotive/linear_car.cc, line 48 at r3 (raw file):
The prior two lines seem like dead code? drake/automotive/linear_car.cc, line 64 at r3 (raw file):
BTW Prefer drake/automotive/linear_car.cc, line 79 at r3 (raw file):
drake/automotive/linear_car.cc, line 81 at r3 (raw file):
I think this instead should be the ContinuousState constructor overload that declares our second-order structure? (Passing drake/automotive/linear_car.cc, line 88 at r3 (raw file):
If I'm not mistaken, the parent class will already take care of this for us, without writing out this override? drake/automotive/linear_car.cc, line 91 at r3 (raw file):
BTW I think this fits on the prior line? drake/automotive/linear_car.h, line 41 at r2 (raw file):
Missing disable of copy and assignment. drake/automotive/linear_car.h, line 28 at r3 (raw file):
Please elaborate on the input structure (either here, or class overview). (It's a single scalar acceleration.) drake/automotive/linear_car.h, line 31 at r3 (raw file):
Please elaborate on the output structure (either here, or class overview). (It's two scalars; first is x, second is v.) drake/automotive/single_lane_ego_and_agent.h, line 62 at r3 (raw file):
Missing disable of copy and assignment. Comments from Reviewable |
Partial checkpoint. Reviewed 2 of 15 files at r1. a discussion (no related file): drake/automotive/idm_planner.cc, line 10 at r3 (raw file):
META (for all classes in the PR)... in new code, do not drake/automotive/single_lane_ego_and_agent.cc, line 13 at r3 (raw file):
BTW Consider drake/automotive/single_lane_ego_and_agent.cc, line 21 at r3 (raw file):
Unclear why drake/automotive/single_lane_ego_and_agent.cc, line 23 at r3 (raw file):
Unclear why drake/automotive/single_lane_ego_and_agent.cc, line 28 at r3 (raw file):
Magic number drake/automotive/single_lane_ego_and_agent.cc, line 29 at r3 (raw file):
Magic number drake/automotive/single_lane_ego_and_agent.cc, line 39 at r3 (raw file):
BTW Add a TODO that Diagram should be able to compute this, once the sparsity matrix is available? drake/automotive/single_lane_ego_and_agent.h, line 42 at r3 (raw file):
This seems like the wrong group for this System. drake/automotive/single_lane_ego_and_agent.h, line 60 at r3 (raw file):
Missing object-const drake/automotive/single_lane_ego_and_agent.h, line 67 at r3 (raw file):
If possible, add Comments from Reviewable |
Partial checkpoint. Reviewed 1 of 15 files at r1, 1 of 1 files at r2. drake/automotive/test/idm_planner_test.cc, line 20 at r3 (raw file):
The trailing underscore in the method name here is weird, and possibly defective (though I didn't go read the cppguide to check for sure). drake/automotive/test/idm_planner_test.cc, line 26 at r3 (raw file):
BTW I'm not sure these comments are adding much value. drake/automotive/test/idm_planner_test.cc, line 33 at r3 (raw file):
FYI #4041 offers drake/automotive/test/idm_planner_test.cc, line 44 at r3 (raw file):
Missing attribute-checking coverage of the second input port? drake/automotive/test/idm_planner_test.cc, line 50 at r3 (raw file):
Cannot have commented-out code. drake/automotive/test/idm_planner_test.cc, line 88 at r3 (raw file):
Is repeating the formula here truly the best way to unit test? Would a literal value for drake/automotive/test/linear_car_test.cc, line 36 at r3 (raw file):
BTW Same thing on #4041 making this go away. drake/automotive/test/linear_car_test.cc, line 69 at r3 (raw file):
Typo "starting output" is zero, I think? drake/automotive/test/linear_car_test.cc, line 73 at r3 (raw file):
I'm not sure what this drake/automotive/test/single_lane_ego_and_agent_test.cc, line 21 at r3 (raw file):
BTW Same thing on #4041 making this go away. Comments from Reviewable |
First pass done. Reviewed 1 of 1 files at r3. drake/automotive/test/single_lane_ego_and_agent_test.cc, line 45 at r3 (raw file):
cappunc drake/automotive/test/single_lane_ego_and_agent_test.cc, line 58 at r3 (raw file):
One of the two prior lines has a magic number typo. drake/automotive/test/single_lane_ego_and_agent_test.cc, line 144 at r3 (raw file):
Not sure "parameters" is the best term to explain the new state values? drake/automotive/test/single_lane_ego_and_agent_test.cc, line 155 at r3 (raw file):
FYI Thus squishing the life out of the ego car occupants at 42 G's deceleration. ;) Comments from Reviewable |
5323dfe
to
39641a6
Compare
@jadecastro Closed by accident? |
Yes I force-pushed from no brach to the same remote, and apparently |
Ouch, sorry! |
Review status: all files reviewed at latest revision, 44 unresolved discussions, some commit checks failed. a discussion (no related file):
|
Somehow github and reviewable are confused about the symbolic PR coming in as-new here. I don't know how you can fix that though. Is this feature branch fully merged up to master? Review status: 4 of 27 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Yeah, I noticed those files have hitched a ride in this PR. Strange - all I did was rebase against master. Let me see if I can disentangle the mess. If not, I'll just submit a new PR. Review status: 4 of 27 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Given the discussions in flight I would prefer to keep this PR if we can. I should be able to reasonably ignore the changes that were from the other PR (that I also reviewed). Review status: 4 of 27 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Ok, I'll try to remove those from the PR (strange they don't show on any of my personal branch commits, when I select Update: Fixed (woohoo!) Review status: 4 of 27 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Review status: 4 of 27 files reviewed at latest revision, 1 unresolved discussion. drake/automotive/test/idm_planner_test.cc, line 88 at r3 (raw file):
|
7bc8225
to
7d55814
Compare
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. drake/automotive/test/idm_planner_test.cc, line 88 at r3 (raw file):
|
fe9fb77
to
5a63654
Compare
I've updated the input ports to use the named-getter features, and have addressed the unit test comment. BTW, it seems that a recent merge broke the ability to use Review status: 12 of 17 files reviewed at latest revision, 1 unresolved discussion. drake/automotive/linear_car.h, line 61 at r7 (raw file):
|
2f5b0fa
to
5981cb3
Compare
Reviewed 4 of 15 files at r1, 2 of 12 files at r4, 5 of 10 files at r7, 3 of 5 files at r8, 2 of 2 files at r9. drake/automotive/CMakeLists.txt, line 1 at r9 (raw file):
BTW do you want to update the BUILD files too? drake/automotive/CMakeLists.txt, line 29 at r9 (raw file):
Do you need to install the new headers? drake/automotive/idm_planner.cc, line 57 at r9 (raw file):
indentation is wrong; run clang-format? drake/automotive/idm_planner.h, line 43 at r9 (raw file):
btw nit: algebraic drake/automotive/linear_car.cc, line 10 at r9 (raw file):
alphabetize drake/automotive/linear_car.cc, line 24 at r9 (raw file):
Did you consider using one of the multi-argument versions? This seems like second-order state to me, and moreover it would be pretty nice to have named accessors/mutators. drake/automotive/linear_car.cc, line 68 at r9 (raw file):
BTW, you can also say drake/automotive/linear_car.cc, line 68 at r9 (raw file):
BTW consider commenting these as "velocity" and "acceleration" respectively drake/automotive/simple_car_gen.sh, line 17 at r9 (raw file):
This is redundant now, right? Do you plan to delete it in a subsequent PR? drake/automotive/single_lane_ego_and_agent.cc, line 46 at r9 (raw file):
Wait, why is this necessary? Diagram does already try to infer direct-feedthrough. drake/automotive/test/idm_planner_test.cc, line 9 at r9 (raw file):
This goes above the drake includes. https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes drake/automotive/test/idm_planner_test.cc, line 35 at r9 (raw file):
BTW, you could just use drake/automotive/test/idm_planner_test.cc, line 86 at r9 (raw file):
BTW consider splitting these up into separate drake/automotive/test/linear_car_test.cc, line 36 at r9 (raw file):
There is now
drake/automotive/test/single_lane_ego_and_agent_test.cc, line 9 at r9 (raw file):
goes above drake/automotive/test/single_lane_ego_and_agent_test.cc, line 141 at r9 (raw file):
Here and below, comments giving some kind of intuition for the results would be useful. drake/systems/framework/primitives/constant_vector_source.cc, line 9 at r9 (raw file):
alphabetize Comments from Reviewable |
11b98d6
to
344327d
Compare
Review status: 8 of 18 files reviewed at latest revision, 17 unresolved discussions. drake/automotive/CMakeLists.txt, line 1 at r9 (raw file):
|
context_->FixInputPort(0, BasicVector<double>::Make({128})); |
drake/automotive/test/single_lane_ego_and_agent_test.cc, line 9 at r9 (raw file):
Previously, david-german-tri (David German) wrote…
goes above
drake
drake/automotive/test/single_lane_ego_and_agent_test.cc, line 141 at r9 (raw file):
Previously, david-german-tri (David German) wrote…
Here and below, comments giving some kind of intuition for the results would be useful.
drake/systems/framework/primitives/constant_vector_source.cc, line 9 at r9 (raw file):
Previously, david-german-tri (David German) wrote…
alphabetize
Comments from Reviewable
aa824a0
to
e25ff08
Compare
Reviewed 4 of 5 files at r8, 11 of 11 files at r10. drake/automotive/single_lane_ego_and_agent.cc, line 60 at r10 (raw file):
BTW This already seems done below? drake/automotive/test/idm_planner_test.cc, line 26 at r10 (raw file):
Don't use Comments from Reviewable |
Review status: 16 of 45 files reviewed at latest revision, 19 unresolved discussions. drake/automotive/single_lane_ego_and_agent.cc, line 60 at r10 (raw file):
|
fb3620b
to
21ac54b
Compare
+(status: curate commits before merging) Review status: 16 of 18 files reviewed at latest revision, 17 unresolved discussions. Comments from Reviewable |
Reviewed 9 of 11 files at r10, 1 of 29 files at r11, 1 of 1 files at r12. drake/automotive/CMakeLists.txt, line 1 at r9 (raw file):
|
Great - I'll be sure to curate everything before merging. Review status: 16 of 19 files reviewed at latest revision, 3 unresolved discussions. drake/automotive/CMakeLists.txt, line 1 at r9 (raw file):
|
Add diagram composing an ego car, a planner and an agent car Add a unit test for the diagram Add unit test for the standalone IDM planner leaf system Fix bad-cast issues, perform clang-format, cleanup, documentation
Minor updates.
Address review comments
75b4d65
to
26a687b
Compare
Reviewed 3 of 3 files at r13. Comments from Reviewable |
Reviewed 1 of 29 files at r11, 1 of 1 files at r12, 3 of 3 files at r13. Comments from Reviewable |
Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Purge IdmWithTrajectoryAgent (replaced with diagram in #4081)
This supplants IdmWithTrajectoryAgent.
This change is