HybridTrajectoryOptimization and minor updates

Added HybridTrajectoryOptimization and Compass Gait example. Minor changes to ContactImplicitTrajectoryOptimization, particularly the initialization of slack variables.
is “mode" here not the same as the hybrid “mode”?

the case logic might look a little better as just `if (mode==2)` if that’s the only case you ever intend to handle with this.  

On Aug 28, 2014, at 8:47 AM, Michael Posa <notifications@github.com> wrote:

> In solvers/trajectoryOptimization/NonlinearComplementarityConstraint.m:
> 
> > @@ -97,6 +101,14 @@
> >        end
> >        
> >        obj = obj@CompositeConstraint(constraints, n);
> > +      
> > +      switch mode
> > +        case 1
> > +        case 2
> > +          obj.slack_fun = fun;
> Yes, since MATLAB switch is different from C switch. Only mode 2 has slack variables, so only it needs a slack function.
> 
> —
> Reply to this email directly or view it on GitHub.
>