Drake

Detailed Description

Systems for connecting to external visualization tools/GUIs.

There are also a number of external projects that provide additional visualization hook=ups:

Classes

class  MultibodyPositionToGeometryPose< T >
 A direct-feedthrough system that converts a vector of joint positions directly to a geometry::FramePoseVector<T> to behave like a MultibodyPlant::get_geometry_pose_output_port(). More...
 

Functions

systems::lcm::LcmPublisherSystemConnectContactResultsToDrakeVisualizer (systems::DiagramBuilder< double > *builder, const MultibodyPlant< double > &multibody_plant, lcm::DrakeLcmInterface *lcm=nullptr)
 Extends a Diagram with the required components to publish contact results to drake_visualizer. More...
 
systems::lcm::LcmPublisherSystemConnectContactResultsToDrakeVisualizer (systems::DiagramBuilder< double > *builder, const MultibodyPlant< double > &multibody_plant, const systems::OutputPort< double > &contact_results_port, lcm::DrakeLcmInterface *lcm=nullptr)
 Implements ConnectContactResultsToDrakeVisualizer, but using explicitly specified contact_results_port and geometry_input_port arguments. More...
 

Function Documentation

◆ ConnectContactResultsToDrakeVisualizer() [1/2]

systems::lcm::LcmPublisherSystem* drake::multibody::ConnectContactResultsToDrakeVisualizer ( systems::DiagramBuilder< double > *  builder,
const MultibodyPlant< double > &  multibody_plant,
lcm::DrakeLcmInterface lcm = nullptr 
)

Extends a Diagram with the required components to publish contact results to drake_visualizer.

This must be called during Diagram building and uses the given builder to add relevant subsystems and connections.

This is a convenience method to simplify some common boilerplate for adding contact results visualization capability to a Diagram. What it does is:

  • adds systems ContactResultsToLcmSystem and LcmPublisherSystem to the Diagram and connects the draw message output to the publisher input,
  • connects the multibody_plant contact results output to the ContactResultsToLcmSystem system, and
  • sets the publishing rate to 1/60 of a second (simulated time).
Parameters
builderThe diagram builder being used to construct the Diagram.
multibody_plantThe System in builder containing the plant whose contact results are to be visualized.
lcmAn optional lcm interface through which lcm messages will be dispatched. Will be allocated internally if none is supplied.
Precondition
The given multibody_plant must be contained within the supplied DiagramBuilder.
Returns
the LcmPublisherSystem (in case callers, e.g., need to change the default publishing rate).

◆ ConnectContactResultsToDrakeVisualizer() [2/2]

systems::lcm::LcmPublisherSystem* drake::multibody::ConnectContactResultsToDrakeVisualizer ( systems::DiagramBuilder< double > *  builder,
const MultibodyPlant< double > &  multibody_plant,
const systems::OutputPort< double > &  contact_results_port,
lcm::DrakeLcmInterface lcm = nullptr 
)

Implements ConnectContactResultsToDrakeVisualizer, but using explicitly specified contact_results_port and geometry_input_port arguments.

This call is required, for instance, when the MultibodyPlant is inside a Diagram, and the Diagram exports the pose bundle port.

Precondition
contact_results_port must be connected to the contact_results_port of multibody_plant.
See also
ConnectContactResultsToDrakeVisualizer().