RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.16k stars 1.24k forks source link

Make prereq tickets in MbTS more precise #21590

Closed xuchenhan-tri closed 4 days ago

xuchenhan-tri commented 1 week ago

This PR is a piece of #21589 that only modifies the prerequisite tickets for cache entries in MultibodyTreeSystem. In particular, the set of dependency tickets for each cache entry either shrinks or remains the same. No new dependency has been added.

Related to #20545.


This change is Reviewable

jwnimmer-tri commented 1 week ago

Hmm, I should have clarified ...

...we MUST NOT use all_sources_ticket() in MbP nor MbTS ...

Ideally, we would also eschew all_state_ticket() for MbP and MbTS, because I think that my extra sampling will end up as State. In any case, a few lingering all_state_ticket() would not be difficult to clean up later in a second pass -- it's not too difficult to figure out which fraction of State an entry depends on. Figuring out inputs, time, parameters, etc. is the hard part.

jwnimmer-tri commented 5 days ago

If you maybe want to add Alejandro as feature, that's fine. Or, if all you want is a platform stamp, you can assign me and I'll review it tonight.

jwnimmer-tri commented 4 days ago

FYI my opinion on getting tickets right is that #12709 would be the best investment -- in short, have a DRAKE_ASSERT() inside the framework that bombs in case a Calc function ever reaches beyond its declared tickets.