MatthewPeterKelly / MatthewPeterKelly/OptimTraj

Error with running quadRotor2d demo

Open
#38 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
MATLAB
Stars
703
Forks
219
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running MAIN_simulate.m and MAIN_minForceTraj.m in the reported MATLAB versions and inspect the ode45 call at line 29. Trace how z0 reaches dynamics at line 14, where q = x(1:5,:) triggers the bounds error. Done means identifying whether the failure is MATLAB-version compatibility or an input/setup issue and documenting a reproducible fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.