MatthewPeterKelly / OptimTraj

A trajectory optimization library for Matlab
MIT License
598 stars 207 forks source link

Error with running quadRotor2d demo #38

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello,

I attempted to run the "MAIN_simulate.m" and "MAIN_minForceTraj.m" files in the quadRotor2d demo, but received the following error in both cases:

Index in position 1 exceeds array bounds (must not exceed 2).

Error in dynamics (line 14) q = x(1:5,:);

Error in MAIN_simulate>@(t,z)(dynamics(z,ctrlFun(z),p))

Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

Error in MAIN_simulate (line 29) soln = ode45(dynFun,tSpan,z0);

I know the OptimTraj library should be compatible with any release of MATLAB, but I encountered this error using both the 2016a version and the 2018b version. Is there a change from earlier versions that might be causing this error?

MatthewPeterKelly commented 4 years ago

Hmmmm... That's interesting. I just ran both scripts on the current master branch, using Matlab version R2017b on linux, and they ran without issue. Do you have a clean working directory? For example, if you run:

git fetch git checkout --force origin/master

and then try to run both scripts, do you still get the error? Note that the git checkout --force may remove local changes, so back them up first.

As far as I know, the software should run on both windows and linux, and on all newer versions of Matlab.

On Sat, Dec 7, 2019 at 1:52 PM virajsampat notifications@github.com wrote:

Hello,

I attempted to run the "MAIN_simulate.m" and "MAIN_minForceTraj.m" files in the quadRotor2d demo, but received the following error in both cases:

Index in position 1 exceeds array bounds (must not exceed 2).

Error in dynamics (line 14) q = x(1:5,:);

Error in MAIN_simulate>@(t,z)(dynamics(z,ctrlFun(z),p))

Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

Error in MAIN_simulate (line 29) soln = ode45(dynFun,tSpan,z0);

I know the OptimTraj library should be compatible with any release of MATLAB, but I encountered this error using both the 2016a version and the 2018b version. Is there a change from earlier versions that might be causing this error?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MatthewPeterKelly/OptimTraj/issues/38?email_source=notifications&email_token=AB6CWOLDJAEWBV4PS24K6JLQXPWG3A5CNFSM4JXQXD3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H624GIQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6CWOJELMHA7WJWCPXJDSTQXPWG3ANCNFSM4JXQXD3A .