forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up van der Pol oscillator example
Push limit cycle into main class (as a static method) a replace the CallMatlab visualization with a few lines of python matplotlib. Add missing python bindings Lots of small cleanup touches.
- Loading branch information
1 parent
36b6c4c
commit 5d45081
Showing
8 changed files
with
109 additions
and
85 deletions.
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import argparse | ||
import matplotlib.pyplot as plt | ||
|
||
from pydrake.examples.van_der_pol import VanDerPolOscillator | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--test", | ||
action='store_true', | ||
help="Run without blocking for user input.", | ||
default=False) | ||
args = parser.parse_args() | ||
|
||
x = VanDerPolOscillator.CalcLimitCycle() | ||
|
||
fig, ax = plt.subplots() | ||
ax.plot(x[0, :], x[1, :], color='k', linewidth=2) | ||
ax.set_xlim([-2.5, 2.5]) | ||
ax.set_ylim([-3, 3]) | ||
ax.set_xlabel('q') | ||
ax.set_ylabel('qdot') | ||
|
||
if not args.test: | ||
plt.show() |
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
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
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