Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Adding inertias yields: AttributeError: 'SpatialInertia' object has no attribute 'I' #101

Copy link
Copy link
Closed
@niederha

Description

@niederha
Issue body actions

When adding two spatial inertia using the + override I get a AttributeError: 'SpatialInertia' object has no attribute 'I'.

I think I'm noticing 3 potential mistakes in the source code at line 637

return SpatialInertia(left.I + left.I)
  1. It seems SpatialInertia has no member I but rather a data[0]
  2. We're adding left twice and not right.
  3. I am not sure the syntax matches the definition in the constructor...

To make minimum changes, I would suggest rewritting this line as such:

total_inertia=SpatialInertia()
total_inertia.data[0] = left.data[0] + right.data[0]
return total_inertia

But I'm not familiar with the whole code corpus, and I just infer that from quickly reading the class. Does that seem correct? If so could we fix it? If it helps I am happy making a PR and expending tests so this doesn't happen anymore.

Otherwise, thanks for a cool library!

Metadata

Metadata

Assignees

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.