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

fix issue when rotation is not provided in pose #43

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

romaintha
Copy link
Contributor

When rotation is not provided in the node pose data, it raises a E57Exception exception. I propose to catch it and to instantiate the default quaternion in that case.

@dancergraham
Copy link
Collaborator

Hello, thank you for this - do you have a test file or could you write a test for it ?

q = Quaternion([e.value() for e in self.node["pose"]["rotation"]])
return q.rotation_matrix

@property
def rotation(self) -> np.array:
q = Quaternion([e.value() for e in self.node["pose"]["rotation"]])
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought: it would be better to use
try rotation = self.node["pose"]["rotation"} ... except KeyError ...
This avoids squashing other E57Exceptions, e.g. if there is malformed data in the rotation.

@dancergraham dancergraham merged commit cb9c5c7 into davidcaron:master Aug 12, 2024
35 checks passed
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