Author RoboticExplorationLab
2 Stars
Updated Last
2 Years Ago
Started In
January 2020


This package provides methods for visualizing 2D and 3D systems, and is part of the TrajectoryOptimization.jl ecosystem. This package depends heavily upon MeshCat.jl, which is used as the visualization backend. This package is basically a simple wrapper around MeshCat, providing convenient methods for the types defined in RobotDynamics.jl and TrajectoryOptimization.jl.


To install, use the Julia package manager:

julia> ] # activate package manager
(@v1.5) pkg> add TrajOptPlots

We also recommend using the package manager to add the following packages to your environment:

Quick Start

Basic usage will usually follow something like this:

using TrajOptPlots
using RobotZoo: Cartpole
using MeshCat
using StaticArrays

# Start visualizer
vis = Visualizer()

# Display the model
model = Cartpole()
TrajOptPlots.set_mesh!(vis, model)

# Visualize a single state
x = SA[0.5, pi/3, 0, 0]
visualize!(vis, model, x)

# Visualize a trajectory
tf = 2.0
X = [SA[sin(t), cos(t), 0, 0] for t in range(0, 2.0, length=21)]
visualize!(vis, model, tf, X)


For more detailed examples, see the notebooks