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

Meshcat visualizer error when collision model is undefined #2146

Closed
stephane-caron opened this issue Feb 1, 2024 · 1 comment · Fixed by #2147
Closed

Meshcat visualizer error when collision model is undefined #2146

stephane-caron opened this issue Feb 1, 2024 · 1 comment · Fixed by #2147

Comments

@stephane-caron
Copy link
Collaborator

Bug description

The Meshcat visualizer tries to read from the collision model even when it is undefined (collision_model=None):

You can open the visualizer by visiting the following URL:
http://127.0.0.1:7001/static/
Traceback (most recent call last):
  File "/home/stephane-caron/src/project/run.py", line 361, in <module>
    run(scenario, args, rho, mu)
  File "/home/stephane-caron/src/project/run.py", line 189, in run
    scene = Scene(scenario, record=args.record)  # scene is not multiprocess
  File "/home/stephane-caron/src/project/project/scene.py", line 49, in __init__
    visualizer = start_meshcat_visualizer(robot)
  File "/home/stephane-caron/.micromamba/envs/project/lib/python3.10/site-packages/pink/visualization.py", line 26, in start_meshcat_visualizer
    viz.loadViewerModel()
  File "/home/stephane-caron/.micromamba/envs/project/lib/python3.10/site-packages/pinocchio/visualize/meshcat_visualizer.py", line 641, in loadViewerModel
    for collision in self.collision_model.geometryObjects:
AttributeError: 'NoneType' object has no attribute 'geometryObjects'

Expected behavior

The visualizer ignores the collision model when it is not defined.

Reproduction steps

Create a visualizer with collision_model=None.

stephane-caron added a commit to stephane-caron/pinocchio that referenced this issue Feb 1, 2024
@jorisv jorisv linked a pull request Feb 2, 2024 that will close this issue
jorisv pushed a commit to stephane-caron/pinocchio that referenced this issue Feb 2, 2024
@jorisv
Copy link
Contributor

jorisv commented Feb 2, 2024

Fixed in #2147

@jorisv jorisv closed this as completed Feb 2, 2024
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 a pull request may close this issue.

2 participants