Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
motor-primitives-in-steering-simulation/visual.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 lines (25 sloc)
1.23 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import animation | |
import matplotlib.gridspec as gridspec | |
def mp_phi_plot(mp1_alist,mp1_func,mp1_phi1,mp2_alist,mp2_func,mp2_phi1): | |
fig2 = plt.figure(2,figsize=(3,3),constrained_layout=True) | |
gs = gridspec.GridSpec(ncols=2, nrows=2, figure=fig2) | |
f2_ax1 = fig2.add_subplot(gs[0]) # motor prim 1 --> alist, func (these are vars) | |
f2_ax1.plot(mp1_alist,mp1_func,linewidth=3) | |
f2_ax1.set_title('Motor Primitive 1') | |
f2_ax2 = fig2.add_subplot(gs[1]) # phi 1 --> phi1 (this is a function) | |
f2_ax2.plot(mp1_phi1,linewidth=3) | |
f2_ax2.set_title('Phi 1') | |
f2_ax3 = fig2.add_subplot(gs[2]) # motor prim 2 --> alist, func (these are vars) | |
f2_ax3.plot(mp2_alist,mp2_func,linewidth=3) | |
f2_ax3.set_title('Motor Primitive 2') | |
f2_ax4 = fig2.add_subplot(gs[3]) # phi 1 --> phi1 (this is a function) | |
f2_ax4.plot(mp2_phi1,linewidth=3) | |
f2_ax4.set_title('Phi 2') | |
def xy_plot(x,y,summed_x, summed_y): | |
fig3 = plt.figure(3,figsize=(3,3),constrained_layout=True) | |
F3_ax3 = plt.axes(xlim=(-5,300), ylim=(0,300)) | |
F3_ax3.plot(x,y,linewidth=3) | |
F3_ax3.plot(summed_x,summed_y,linewidth=3) | |
F3_ax3.set_title('Trajectory') |