Skip to content

Fall through error in the binary operator for BasePoseMatrix #116

Closed

Description

@bokorn-bdaii

Fall through error in the binary operator for BasePoseMatrix:

https://github.com/bdaiinstitute/spatialmath-python/blob/1b89c49395a21b5241e2f0a233e69394f3bc27b1/spatialmath/baseposematrix.py#L1632C7-L1632C7

If you want to compare the rotation of an SE3 to an SO3, it returns none as opposed to throwing an error or returning a valid value. This should probably raise an error as opposed to returning None.

import numpy as np
from spatialmath import SE3, SO3

T0 = SE3()
print(T0.angdist(SO3()))

Could be fixed with closing else in BasePoseMatrix._op2

    else:
        raise ValueError(f'Invalid type ({right.__class__}) for binary operation with {left.__class__}')

Activity

  1. jcao-bdai commented on Jan 5, 2024

    @jcao-bdai
    Contributor

    Thank you for noticing this, @bokorn-bdaii

    i see you have a PR up with this fix but it also exposed the fact that we did not have test coverage for this logic - do you mind if I push a commit with just a unit test onto your branch?

  2. bokorn-bdaii commented on Jan 5, 2024

    @bokorn-bdaii
    ContributorAuthor

    Ya, of course. Feel free to push a unit test in.

  3. jcao-bdai commented on Jan 5, 2024

    @jcao-bdai
    Contributor

    @bokorn-bdaii pushed. thanks! 🤞
    will approve as soon as the workflow completes. thanks again for fixing this issue.

  4. jcao-bdai commented on Jan 10, 2024

    @jcao-bdai
    Contributor

    @bokorn-bdaii your PR fixing this issue has been merged: #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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