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

Added an easy example for visualizing biorbd #3

Merged
merged 1 commit into from
May 1, 2019
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
2 changes: 1 addition & 1 deletion examples/3d_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np

from pyomeca import Markers3d, RotoTrans, RotoTransCollection
from pyoviz import VtkModel, VtkWindow, Mesh, MeshCollection
from pyoviz.vtk import VtkModel, VtkWindow, Mesh, MeshCollection

# Path to data
DATA_FOLDER = Path('..') / 'tests' / 'data'
Expand Down
20 changes: 20 additions & 0 deletions examples/biorbd_viz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Example script for animating a model
"""

import numpy as np

from pyoviz.BiorbdViz import BiorbdViz

b = BiorbdViz(model_path="pyomecaman.s2mMod")

n_frames = 200
Q = np.ndarray((n_frames, b.nQ))
Q[:, 4] = np.linspace(0, np.pi/2, n_frames)

i = 0
while b.vtk_window.is_active:
b.set_q(Q[i, :])
i = (i+1) % n_frames


Loading