Explicitly set matplotlib backend in drivetrain.py
Otherwise --plot doesn't work great.
Change-Id: Ib6706ad22b8ac591473a1ff93fa25b7cc88d024e
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/control_loops/python/drivetrain.py b/frc971/control_loops/python/drivetrain.py
index 8ff7748..1535432 100644
--- a/frc971/control_loops/python/drivetrain.py
+++ b/frc971/control_loops/python/drivetrain.py
@@ -6,6 +6,7 @@
import math
import sys
from matplotlib import pylab
+import matplotlib
import glog
@@ -563,6 +564,9 @@
def PlotDrivetrainSprint(drivetrain_params):
+ # Set up the gtk backend before running matplotlib.
+ matplotlib.use("GTK3Agg")
+
# Simulate the response of the system to a step input.
drivetrain = KFDrivetrain(left_low=False,
right_low=False,
@@ -810,6 +814,9 @@
def PlotDrivetrainMotions(drivetrain_params):
+ # Set up the gtk backend before running matplotlib.
+ matplotlib.use("GTK3Agg")
+
# Test out the voltage error.
drivetrain = KFDrivetrain(left_low=False,
right_low=False,