Adding inertias yields: AttributeError: 'SpatialInertia' object has no attribute 'I'
niederha opened this issue · 2 comments
niederha commented
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)- It seems
SpatialInertiahas no memberIbut rather adata[0] - We're adding
lefttwice and notright. - 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_inertiaBut 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!