pydy / pydy-tutorial-human-standing Goto Github PK
View Code? Open in Web Editor NEWPyDy tutorial materials for MASB 2014, PYCON 2014, and SciPy 2014/2015.
Home Page: http://pydy.org
PyDy tutorial materials for MASB 2014, PYCON 2014, and SciPy 2014/2015.
Home Page: http://pydy.org
20 mins
This should do all the symbolic kinematics needed for the EoM generation.
Get Aaron to make a new SymPy release with updates from us by about February 20th or so. We've got several patches in master, especially for notebook printing.
Didn't pay careful attention. I want the angles to be defined such that positive rotation is about the positive Z axis.
5 min
Should give a complete description of the inverted pendulum, all variables, etc.
This will include:
This can possible be combined with #13 and we can explain dynamics with some pydy commands.
We need backups ready in case downloads don't work.
The USB stick(s) should contain:
We also need installation instructions for the USB stick as they will have to use either: python setup.py install
or pip install -e /path/to/package
.
There will be USB sticks available at PyCon. We need to get them either the nigh of April 8th or early the first thing on the 9th.
@pydy/pydy-developers I'd like to rename this repo to something like pydy-standing-tutorial
and then continue to use branches and tags for the various versions that we give at different places with the HEAD of master being the most generic version.
Any suggestions on names for the repo? Is this fine?
Github will redirect (maybe indefinitely) so it shouldn't break links.
This is because of the switch from the github org PythonDynamics to PyDy.
(either fix Luke's server or create a new site with github pages + sphinx, for example, and move content over).
15 min
We need to be able to pass in a function to odeint along with the rhs for feedback. This should be a simple addtion.
def feedback(t, x):
return -K * x
10 min
Use Kanesmethod, but maybe can should Lagranges too. Talk about relationship to dp/dt = F and dH/dt = T.
We need to write up the installation instructions. There are of course many ways to do this. These are the two methods that I'd like to have in place, because I think it will be the easiest for folks new to Python:
Aaron said he'll be on gitter during our tutorials to give help if needed.
I am getting this error on n07_simulation.ipynb, n08_simulation.ipynb and n09_simulation.ipynb:
right_hand_side(x0, 0.0, args)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-25-a7cae5bebf3b> in <module>()
----> 1 right_hand_side(x0, 0.0, args)
/gpfs/home/kirk/anaconda/envs/robotics/lib/python2.7/site-packages/pydy-0.2.1-py2.7.egg/pydy/codegen/code.pyc in evaluate_ode(x, t, args)
471 # computation time.
472
--> 473 segmented = [np.array([args['constants'][c] for c in constants]),
474 x[:len(coordinates)],
475 x[len(coordinates):]]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
conda list
# packages in environment at /gpfs/home/kirk/anaconda/envs/robotics:
#
basemap 1.0.7 np19py27_0
cairo 1.12.2 2
cython 0.21 py27_0
dateutil 2.1 py27_2
freetype 2.4.10 0
geos 3.3.3 0
ipython 2.2.0 py27_0
ipython-notebook 2.2.0 py27_0
jinja2 2.7.3 py27_1
libpng 1.5.13 1
libsodium 0.4.5 0
markupsafe 0.23 py27_0
matplotlib 1.4.0 np19py27_0
nose 1.3.4 py27_0
numpy 1.9.0 py27_0
openssl 1.0.1h 1
pandas 0.14.1 np19py27_0
pixman 0.26.2 0
py2cairo 1.10.0 py27_1
pyparsing 2.0.1 py27_0
pyqt 4.10.4 py27_0
python 2.7.8 1
pytz 2014.7 py27_0
pyzmq 14.3.1 py27_0
qt 4.8.5 0
readline 6.2 2
requests 2.4.3 py27_0
scipy 0.14.0 np19py27_0
setuptools 5.8 py27_0
sip 4.15.5 py27_0
six 1.8.0 py27_0
sqlite 3.8.4.1 0
ssl_match_hostname 3.4.0.2 py27_0
sympy 0.7.5 py27_0
system 5.8 1
theano 0.6.0 np19py27_0
tk 8.5.15 0
tornado 4.0.2 py27_0
zeromq 4.0.4 0
zlib 1.2.7 0
use the kane's method linearize command or even do it manually with diff(). Then use scipy.linalg.continuous_are to get the optimal gain matrix (full state feedback). We can give them starting values for R and Q and then they can adjust.
Simulate with the feedback function and then visualize.
We need a little polishing on the website. Would be nice to have a general cleanup. We will share the url to all potential users.
Possible better exercises:
I'm not sure if this is the best place to discuss the project idea, but I wanted to share ideas somewhere.
I like the 2d 2dof arm idea, especially considering that @moorepants will be giving that biomechanics tutorial. It's extendable, and maybe for the tutorial, it'd be good to have it all set up so people can continue adding on to a base model. Also, @moorepants has a N-link inverted pendulum balancing notebook already. So they could start with the cursive, then naturally add more links and do that balancing, or then in the biomechanics session, you could add muscles maybe. You could add helical springs and dampers to the joints and then model a long chain (a kid on a swing). I guess there's only a little time, so maybe people would only have time for the cursive.
Anyway, the audience sounds like they might have broad interests, and so the 2d arm makes sense, because it allows so many different extensions.
We need to release the 0.1.0 version of pydy-viz to PyPi.
pydy is now one package so we should update this tutorial accordingly.
Make a PyDy package that includes sympy.physics.mechanics, pydy-viz, and pydy-code-gen.
Release to PyPi and ensure it installs in Anaconda based environments (at least, can check more too) on all three main OS's.
See https://github.com/PythonDynamics/PyDy, ideally this will pip install everything that is needed. We will need to make 0.1.0 releases of pydy-viz and pydy-code-gen too.
We need to be able to not display the solutions to exercises, but still be able to execute the code once the exercise is done.
Note that this support is currently not in IPython by default, only hiding the output of cells is: ipython/ipython#1340. Seems to be available in Wakari though.
Weird, Brain Granger says they can't implement it for a legal reason: http://python.6.x6.nabble.com/IPython-User-Hide-code-cells-in-the-notebook-td4997151.html
Main changes:
check_env.py
works for the new software.Scene
so that they only use the display_ipython
method.If you change the numerical value of gravity it is affecting the length definition of the torso. This doesn't make any sense though. They should be independent.
use pydy-code-gen to generate numeric right hand side, odeint, + matplotlib plot of state trajectories
specify realistic numerical parameters and the initial conditions.
Some things:
These will be the first notebooks. Should be short and sweet, showing just enough Python, NumPy, SciPy, SymPy, and IPython needed to do our examples. These should not include anything from sympy.physics.mechanics as that intro will come later.
Setup shapes and viz frames.
We should stick to the basic mapping of rigidbody to vizframe and single shape. keep it simple.
I just remembered that internet is required for rendering latex in the notebook. This could be an issue if we have internet connectivity issues.
We could recommend installing mathjax and pointing ipython to it locally, but that is a pain.
The virutalbox install option can have local mathjax easy enough.
This shouldn't be an issue on the Akron machines either, I don't expect internet connectivity issues at the university.
@tarzzz created this PR #56 that needs to be updated so that we can allow people to view the inputs and outputs of the notebooks. I'm curious to know if the visualization can be embedded so that they display on nbviewer (that would be awesome!). We still need to keep the master branch with all the outputs hidden.
15 mins
All forces: joint torques and gravity
If we include a shorcut to IPython notebook there, then maybe the students can just double click it at the MASB.
Gilbert and Tarun can take some notebook(s) if they like.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.