Skip to content

Standardize coordinate schemes - #1

Open
WillB97 wants to merge 8 commits into
PeterJCLaw:fix-spherical-coordinatesfrom
WillB97:fix-yaw_pitch_roll
Open

Standardize coordinate schemes#1
WillB97 wants to merge 8 commits into
PeterJCLaw:fix-spherical-coordinatesfrom
WillB97:fix-yaw_pitch_roll

Conversation

@WillB97

@WillB97 WillB97 commented Nov 20, 2022

Copy link
Copy Markdown

Moves to using the standard right-handed coordinate system and spherical coordinates in mathematical notation.

Yaw, pitch and roll are also corrected to their expected directions.

Setting the environment variable ZOLOTO_LEGACY_AXIS uses the axis as in version 0.9.0, except for yaw, pitch and roll which always follows their expected directions.

Builds upon RealOrangeOne#302.

@WillB97

WillB97 commented Nov 20, 2022

Copy link
Copy Markdown
Author

Docs will also need to be updated as they don't line up with what the coordinate systems previously were nor what this will make them.

@RealOrangeOne RealOrangeOne left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks ok, although would appreciate someone more knowledgeable with it review the maths side.

Comment thread zoloto/coords.py Outdated
if os.environ.get('ZOLOTO_LEGACY_AXIS'):
return self.phi - (math.pi / 2)
else:
raise AttributeError("Rotation around this axis is not used")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why would this not be used?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this axis system this is a rotation that would be twist of the marker which is a property of the orientation, not the coordinate.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I see. I think we should still improve the exception message though.

Comment thread zoloto/coords.py
initial_rotation.y,
) * self.__MARKER_ORIENTATION_CORRECTION

if os.environ.get('ZOLOTO_LEGACY_AXIS'):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: We should extract this as a constant

Comment thread zoloto/coords.py
Comment thread zoloto/coords.py
A zero value is on the centerline of the image.
"""
if os.environ.get('ZOLOTO_LEGACY_AXIS'):
return -self.theta

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: A lot of these "new" legacy axis codepaths don't have tests.

That said, I'm slightly concerned the tests aren't failing in their current state...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is merging into Peter's fork the tests aren't being run.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that would do it! Do the tests pass locally?

@trickeydan trickeydan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The maths is good.

Comment thread zoloto/coords.py Outdated
Comment thread zoloto/coords.py Outdated

@trickeydan trickeydan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Co-authored-by: Dan Trickey <trickeydan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants