underactuated.pyplot_utils
- underactuated.pyplot_utils.AdvanceToAndVisualize(simulator, visualizer, time, time_if_running_headless=0.1, movie_filename=None)
Helper to support visualizing a simulation with pyplot visualizer. Will simply simulate (with target_realtime_rate = 1) if visualizer.show = True, or will record and render an animation if visualizer.show = False. If specified, time_if_running_headless will be used instead of time if running_as_notebook is False.
- underactuated.pyplot_utils.AnimatePositionTrajectory(trajectory, root_context, plant, visualizer, time_step=0.030303030303030304)
Returns an animation of a MultibodyPlant using a trajectory of the plant positions.
- Parameters:
trajectory (Trajectory) – A Trajectory instance.
root_context (Context) – The root context of the diagram containing plant.
plant (MultibodyPlant) – A MultibodyPlant instance.
visualizer (PyPlotVisualizer) – A PyPlotVisualizer instance.
time_step (float) – The time step between published frames.
- class underactuated.pyplot_utils.HistogramVisualizer(num_samples, bins, xlim, ylim, draw_time_step, figsize=(6, 4), show=True)
A simple visualizer that plots a histogram of the input vector.
- draw(context)
Draws a single frame. context can either be a Context object, or a raw vector (for ease of interpolation).
- class underactuated.pyplot_utils.SliderSystem(ax, title, min, max)