fix: give SceneNode.__init__ a pose= kwarg, not just Shape - #37
Merged
Conversation
SceneNode is the true base class for the scene graph, but pose= (with SE3 support) was only ever implemented on Shape.__init__, one level below it. SceneGroup subclasses SceneNode directly and skips Shape, so SceneGroup(pose=SE3(...)) raised TypeError -- only the raw T=ndarray kwarg worked. CollisionShapeGroup happened to accept pose= already, but only as a side effect of going through Shape/CollisionShape for unrelated reasons. Move pose (and its SE3->ndarray conversion) down to SceneNode.__init__ itself so every scene-graph node, groups included, gets it consistently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SceneNodeis the true base class for everything in the scene graph, butthe friendly
pose: ndarray | SE3constructor kwarg (withSE3support)was only ever implemented on
Shape.__init__, one level below it.SceneGroupsubclassesSceneNodedirectly (notShape), soSceneGroup(pose=SE3(...))raisedTypeError: SceneNode.__init__() got an unexpected keyword argument 'pose'-- only the raw
T=ndarraykwarg worked.CollisionShapeGrouphappened to acceptpose=already, but only as aside effect of going through
CollisionShape/Shapefor unrelatedreasons (it needs to be a
CollisionShapeforisinstancecheckselsewhere), not because
posewas deliberately designed to work there.This moves
pose(and itsSE3->ndarrayconversion) down toSceneNode.__init__itself, so every scene-graph node -- including groups-- gets it consistently and for the right reason.
Shape.__init__'s ownbase/posedeprecation logic is unchanged; it now just forwards itsresolved value up as
pose=instead ofT=.SceneNode.__init__:Trenamed topose: ndarray | SE3, sameconversion
Shape.__init__already did, plus a docstring (previously hadnone)
SceneNode.__deepcopy__andShape.__init__'ssuper().__init__()call updated to the new kwarg name
SceneGroup(pose=...)with bothSE3andndarrayTest plan
pytest tests/test_Shape.py tests/test_collision.py-- 157 passedpytest tests/-- 160 passedSceneGroup(pose=SE3(1,2,3))no longer raisesbase/posemutual-exclusivityValueErroronShapestill fires unchanged