Closed stonier closed 5 years ago
@stonier , FYI.
Just added two items to the Work Items
list to track the completion of the items discussed here.
@basicNew @stonier @clalancette @apojomovsky On RigidBodyTree
(aka RBT) to MultibodyTree
(aka MBT) migration. All RBT uses within Drake's automotive
namespace, and to some extent within Delphyne's backend as well, reduce to car and road visual geometry loading (e.g. see PriusVis
and AutomotiveSimulator
classes).
Now, before delving into details, it's important to understand the differences between RBT and MBT. As I understand it, RBT was designed to provide a self-contained representation of a rigid kinematic chain (e.g. a robotic arm) and thus geometrical (visuals, collisions) and physical (inertias, forces) descriptions are coupled. MBT, however, only provides a representation for a not-strictly rigid multibody physical system in order to solve for its dynamics, while geometry is delegated to the SceneGraph
(aka SG) [1]. Coupled with these trees, both RigidBodyPlant
(aka RBP) and MultibodyPlant
(aka MBP) provide System
interfaces for them to be used in simulation context. This is particularly relevant for the latter case, considering SG was designed to work with systems that register geometry and update/query it through ports.
In migrating from one to the other, a couple difficulties have been identified:
sdformat
is used behind the scenes and that it'd seem that said library handles both formats seamlessly, we'd be OK. We must validate this hypothesis.PoseBundle
for visualization update, because of its port-based API, it's harder to use outside a simulation diagram. Moreover, it is my understanding that SG was designed to be just another system in a diagram; all other systems may register geometry and hook up a port or two to the (global?) SG to update their own geometry and/or act upon current scene state (e.g. to model contact forces).The last bullet is the most crucial, as it'll shape how we move forward with this:
CarVisApplicator
system -visual registering would be handled by car systems themselves-, as well as the need for a PoseAgreggator
system -since we could get the same information from the SG-. It would simplify the architecture and provide a full description of the world (collision geometries included). But that's not for free: we would have to significantly change automotive
code base and push agents' SPC-G-V modularization (or any of its variations) down to systems. If we were to use SDF/URDF models, we'd still need a temporary MBP to load them into that SG. Good thing is that we can steal its SourceId
, which is necessary to update SG poses later on. Bad thing is that knowing what to update requires a bit of reverse engineering if we drop that MBP.PoseBundle
output port manually. Tangentially, we should also decide if we'll be doing the migration within Drake or if we'll be moving away from it, in the spirit of #498.
[1] It was stated that, because of this, for our particular use case we may not even need MBT (given we care about visual geometries only).
@hidmic thanks for the research and the summary! Just to see if I got it right, the core issues are:
CarVisApplicator
and PoseAgreggator
).Am I missing anything?
One more detail that I think is worth mentioning: initially, @SeanCurtis-TRI was straightforward about SG not being ready for automotive
. Thus SceneGraph
's API may still be subject to changes in a not so distant future, hopefully simplifying our use cases.
I'm going to close this one out now, since everything in here is either complete or has a separate issue. Feel free to reopen if you think we should continue to use this tracking bug instead.
Resources
Goals
Keep tabs on the architecture and the complexity. This list will likely evolve as flags get raised while we work on items.
Front Load
SimpleCarState_V
publisher ⇨ #504 (PR #511)SimpleCarState
message ⇨ #505 (PR #517)Stretch Bugs
Success Criteria