Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always cast 'att' attribute into Quat object #281

Merged
merged 1 commit into from
Feb 20, 2019
Merged

Always cast 'att' attribute into Quat object #281

merged 1 commit into from
Feb 20, 2019

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Feb 20, 2019

Leaving the att (attitude) attribute as whatever the user supplied instead of casting to Quat makes life difficult for downstream code. This fixes that and with this in place one can be sure that aca.att is a Quat.

This passes tests. Sparkles passes tests (except for the known fail).

class QuatMetaAttribute(MetaAttribute):
def __set__(self, instance, value):
if not isinstance(value, Quat):
value = Quat(value)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine. I've sometimes run into issues with the not-quite-normalized Quat, but hopefully anything that reaches this point will be fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Default handling of a not-quite-normalized Quat should be handled upstream by Quat. Maybe auto-fix if within some threshold? Is there something like that already?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now there's just a good error message. For proseco I had the MATLAB side explicitly normalize to avoid the possibility of it being a problem with these attitudes (relying on later checking to catch any problem).

@taldcroft taldcroft merged commit 24d8d11 into master Feb 20, 2019
@taldcroft taldcroft deleted the att-quat branch February 20, 2019 03:19
@taldcroft taldcroft restored the att-quat branch February 20, 2019 03:19
@taldcroft taldcroft deleted the att-quat branch February 20, 2019 03:19
taldcroft added a commit that referenced this pull request Feb 20, 2019
taldcroft added a commit that referenced this pull request Feb 20, 2019
Fix guide and acq report templates after #281
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.

2 participants