RobotLocomotion / drake

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

Proximity reification during algebraic loop detection #21624

Closed SeanCurtis-TRI closed 14 hours ago

SeanCurtis-TRI commented 4 days ago

What happened?

When DiagramBuilder queries for algebraic loops, this can lead to the allocating a default context on an Expression-valued Diagram. When SceneGraph allocates a default context, its default proximity properties are assessed and proximity geometries have the potential to get reified. This is wasted work.

The proximal cause is that the calculation of direct feedthrough for SceneGraph is not resolved by examining the dependency graph and instantiating System<Expression> and its default Context<Expression> is the fallback.

The solution would be to make sure that SceneGraph's output ports explicitly declare their dependencies. Right now it defaults to the "all sources" ticket which is treated by the feed through calculation as meaningless. Simply declaring it dependent on parameter (its GeometryState) and all of its inputs would be sufficient.

Version

No response

What operating system are you using?

No response

What installation option are you using?

No response

Relevant log output

No response

jwnimmer-tri commented 14 hours ago

Fixed in #21630.