Skip to content

interp1() errors due to undefined start variable #33

Description

@btalb

Error is throwing when using interp1():

In [12]: a = SE3(1, 2, 0) * SE3.Rz(45, unit='deg')

In [13]: b = a.interp1(0.5)
---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-13-efa36fbc2384> in <module>
----> 1 b = a.interp1(0.5)

~/.python-venv/lib/python3.8/site-packages/spatialmath/baseposematrix.py in interp1(self, s)
    477         s = np.clip(s, 0, 1)
    478 
--> 479         if start is not None:
    480             assert len(start) == 1, 'len(start) must == 1'
    481             start = start.A

UnboundLocalError: local variable 'start' referenced before assignment

Error occurs for both SE2 and SE3 classes.

A workaround is to call interp() explicity with the identity pose, e.g.:

SE3().interp(a, 0.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions