Skip to content

Octave compatibility

Peter Corke edited this page Dec 9, 2018 · 1 revision

What works

With Octave 4.4.x, straight out of the box all the classic functions: rotx, roty, rotz, trotx, troty, trotz, r2t, t2r, tr2rt.

What works with a little tweaking

Any function that uses the argument parser tb_optparse requires that you dummy out one function

function v = verLessThan()
    v = true;
end

put this somewhere on your Octave path

Now you have access to many of the functions that convert rotation matrices and homogeneous transformation matrices, eg. rpy2r, rpy2tr, tr2rpy, eul2r, eul2tr, tr2eul.

Where we get stuck

  1. trplot displays many warnings and doesn't draw the axes properly. This is an error in the implementation of hgtransform. See some of the discussion here.
  2. The new pose classes SO2, SE2, SO3, SE3 have a number of issues:
  • no Octave support for function handles at RTBPose.m line 854-8. Changing these lines to print = @(color, fmt, value) fprintf(fmt, value); eliminates that bug, but
  • composing two SE3 objects, fails when pre-allocating the result at line 298, could comment that out, but
  • creating an instance of a new SE3 object using the .new method fails at SE3.m line 685. It's good that it gets to this point, but I don't know why it is erroring.
  1. None of the robot models will load, eg. mdl_puma560, this results in an error in Link.m at line 261 because there is no properties method for objects. This block of code could be rewritten to use an explicit list of known object properties rather than iterating over this list.

  2. Quaternion and UnitQuaternion constructors fail with an infinite recursion, a difference in the way that protected SetAccess is implemented in Octave.

There are lots of minor differences between object implementations in MATLAB and Octave which make life hard. I don't want to have to maintain two code bases.

Clone this wiki locally