Visualize trajectory

Drake does not support visualizing the trajectory yet. To show any customized data format in visualizer, we need a plugin.

Visualize trajectory

Create plugin

You could place your plugin anywhere as long as they load correctly. I would put the plugin file show_trajectory.py under drake/tools/workspace/drake_visualizer/plugin/

The plugin could be loaded by the drake_visualizer, it will call the _handle_message every time it gets a message data. The message data is defined as map{name, transformation}. The plugin will display all the points as frames and connect the points with arrows.

Create and send trajectory to visualizer

Add publisher code and BUILD.bazel under drake/examples/viz.

This code would create a piecewise cubic polynomial trajectory given several key points and sample points on the trajectory. The points are then packed into message and sent over to the drake_visualizer.

Run the demo

Compile the visualizer again, and open visualizer with plugin.

Run the trajectory publisher.

Last updated

Was this helpful?