Trajectory Optimization

This is not really intended as "ready to accept," but I wanted to start the conversation on trajectory optimization. I added (what I hope is) a pretty flexible framework for direct methods for traj opt, along with some implementations for some first-order integration schemes and direct collocation. The code is far from being speed-optimized, and I think one of the important discussions should be on how to prevent repeated, unnecessary calculations, similar to what Hongkai has with kinsol for inverse kinematics. 

I also added a ConstraintManager class, which is just intended to be a general interface for combining multiple constraints into one. I think this would be a good approach to describe more complex constraints, like support polygons and complementarity constraints.
Wow.  Scary.

What about the difference between

NLP.data_function(..)
and 
data_function(NLP,…)

I thought the second one should be better since it saves one call to subsref(‘.’)


On Jun 20, 2014, at 10:42 AM, Michael Posa <notifications@github.com> wrote:

> In util/FunctionWrapper.m:
> 
> > @@ -0,0 +1,22 @@
> > +classdef FunctionWrapper
> > +  %FUNCTIONWRAPPER 
> > +  % A simple class to wrap a function handle. It seems like this should not
> > +  % be necessary, but somehow when using class methods this avoids a large
> > +  % amount of overhead
> Shockingly much faster to compute. I did a number of tests yesterday on various ways to pass these function handles in. It turns out that doing something like ```NLP.addDataFunction(@obj.dynamics) ;
> ...
> NLP.data_function(args{:});
> 
> is REALLY slow, whereas
> NLP.addDataFunction(FunctionWrapper(@obj.dynamics));
> ...
> NLP.data_function.eval(args{:});
> 
> Is not. For the Acrobot Dircol case, the overhead increased runtime from 8 seconds to over 60. There are other 'fast' ways to do this, but after trying a whole bunch of options, this seemed the cleanest, not that I like it.
> —
> Reply to this email directly or view it on GitHub.
>