RobotLocomotion / drake

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

Stop-gap DrakeVisualizer system implementation w/o RigidBodyTree #4112

Closed liangfok closed 7 years ago

liangfok commented 7 years ago

In preparation for the existence of GeometryWorld, it makes sense to remove DrakeVisualizer's dependence on RigidBodyTree.

jwnimmer-tri commented 7 years ago

To be clear: we should retain a publisher System that uses the RBT, like we have now. But we also want to have a System that publishes to drake-vis that doesn't need the Tree. So two separate classes (that likely share a lot of code). This is a stop-gap until GeometryWorld comes online and supplants (refactors) this new System.

SeanCurtis-TRI commented 7 years ago

Rather than me digging through the code, can someone summarize what the current dependency is?

jwnimmer-tri commented 7 years ago

We want a System very much like this one: https://github.com/RobotLocomotion/drake/blob/ddbde0448fa38e271a08706e2457bb2e61fff351/drake/multibody/rigid_body_plant/drake_visualizer.h#L58

But without mentioning RigidBodyTree (and thus, with a different input port type).

liangfok commented 7 years ago

DrakeVisualizer publishes two types of messages:

  1. lcmt_viewer_load_robot - upon init
  2. lcmt_viewer_draw - each update

The lcmt_viewer_load_robot contains visual geometry information, which it currently obtains from the RigidBodyTree. We want it to be able to get this geometry info from other things like GeomtryWorld.

The lcmt_viewer_draw message does not require RigidBodyTree.

jwnimmer-tri commented 7 years ago

I've renamed the issue to make it clear what the point is: do we want to stand up a temporary lcmt_viewer publisher that can operate without using RigidBodyTree, prior to GeometryWorld coming online, so that the automotive library and demos are easier to develop in the meantime?

rdeits commented 7 years ago

BTW, this is exactly what I've done with https://github.com/rdeits/DrakeVisualizer.jl/ which wraps the interface to the visualizer and https://github.com/rdeits/RigidBodyTreeInspector.jl which uses that interface to draw rigid body tree robots.

Also, FYI, there's a major redesign of the drake visualizer interface underway: https://github.com/RobotLocomotion/director/pull/420 with the goal of supporting more geometry types and more flexible communication between the viewer and client.

david-german-tri commented 7 years ago

I've renamed the issue to make it clear what the point is: do we want to stand up a temporary lcmt_viewer publisher that can operate without using RigidBodyTree, prior to GeometryWorld coming online, so that the automotive library and demos are easier to develop in the meantime?

Yes (in part because it's a useful prototyping step for GeometryWorld). I'll work on it.

david-german-tri commented 7 years ago

@rdeits Thanks for the pointers. I agree, this ticket proposes to do something similar (in C++ System2 diagrams) to what you've done (in a separate Julia app). I have a couple of comments that I'll add to RobotLocomotion/director#415.

david-german-tri commented 7 years ago

This was fixed in https://github.com/RobotLocomotion/drake/pull/5476