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

Don't iterate on collision geometries when undefined #2147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed
- Remove a lot of warnings ([#2139](https://github.com/stack-of-tasks/pinocchio/pull/2139))
- `MeshcatVisualizer` doesn't crash anymore when there is no collision model defined ([#2147](https://github.com/stack-of-tasks/pinocchio/pull/2147))

### Added
- Add `examples/floating-base-velocity-viewer.py` to visualize floating base velocity [#2143](https://github.com/stack-of-tasks/pinocchio/pull/2143)
Expand Down
10 changes: 6 additions & 4 deletions bindings/python/pinocchio/visualize/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,16 @@ def loadViewerModel(self, rootNodeName="pinocchio", color=None):
# Collisions
self.viewerCollisionGroupName = self.viewerRootNodeName + "/" + "collisions"

for collision in self.collision_model.geometryObjects:
self.loadViewerGeometryObject(collision, pin.GeometryType.COLLISION, color)
if self.collision_model is not None:
for collision in self.collision_model.geometryObjects:
self.loadViewerGeometryObject(collision, pin.GeometryType.COLLISION, color)
self.displayCollisions(False)

# Visuals
self.viewerVisualGroupName = self.viewerRootNodeName + "/" + "visuals"
for visual in self.visual_model.geometryObjects:
self.loadViewerGeometryObject(visual, pin.GeometryType.VISUAL, color)
if self.visual_model is not None:
for visual in self.visual_model.geometryObjects:
self.loadViewerGeometryObject(visual, pin.GeometryType.VISUAL, color)
self.displayVisuals(True)

# Frames
Expand Down
Loading