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

experimental markers need to be exactly the size of model markers #94

Open
Ipuch opened this issue Jun 27, 2023 · 2 comments
Open

experimental markers need to be exactly the size of model markers #94

Ipuch opened this issue Jun 27, 2023 · 2 comments

Comments

@Ipuch
Copy link
Contributor

Ipuch commented Jun 27, 2023

This is problematic as this was a feature of bioptim to find tracked markers and display them automatically in the animation.

https://github.com/pyomeca/bioptim/blob/2cecbe2cecb1ee262af857d83ba077a09d91d01f/bioptim/optimization/solution.py#L1409-L1417

Error message:
Traceback (most recent call last): File "/home/puchaud/Projets_Python/Pyomeca_github/bioviz/bioviz/__init__.py", line 881, in __animate_from_slider self.__set_experimental_markers_from_frame() File "/home/puchaud/Projets_Python/Pyomeca_github/bioviz/bioviz/__init__.py", line 1130, in __set_experimental_markers_from_frame self.vtk_model.update_experimental_markers( File "/home/puchaud/Projets_Python/Pyomeca_github/bioviz/bioviz/biorbd_vtk.py", line 481, in update_experimental_markers self._update_experimental_marker_link(virtual_to_experimental_markers_indices) File "/home/puchaud/Projets_Python/Pyomeca_github/bioviz/bioviz/biorbd_vtk.py", line 564, in _update_experimental_marker_link self._new_experimental_marker_link(virtual_to_experimental_markers_indices) File "/home/puchaud/Projets_Python/Pyomeca_github/bioviz/bioviz/biorbd_vtk.py", line 528, in _new_experimental_marker_link points.InsertNextPoint(self.markers["experimental"].data[:3, i, 0].data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/home/puchaud/miniconda3/envs/bio23/lib/python3.11/site-packages/xarray/core/dataarray.py", line 817, in __getitem__ return self.isel(indexers=self._item_key_to_dict(key)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/puchaud/miniconda3/envs/bio23/lib/python3.11/site-packages/xarray/core/dataarray.py", line 1402, in isel variable = self._variable.isel(indexers, missing_dims=missing_dims) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/puchaud/miniconda3/envs/bio23/lib/python3.11/site-packages/xarray/core/variable.py", line 1336, in isel return self[key] ~~~~^^^^^ File "/home/puchaud/miniconda3/envs/bio23/lib/python3.11/site-packages/xarray/core/variable.py", line 880, in __getitem__ data = as_indexable(self._data)[indexer] ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/home/puchaud/miniconda3/envs/bio23/lib/python3.11/site-packages/xarray/core/indexing.py", line 1330, in __getitem__ return array[key] ~~~~~^^^^^ IndexError: index 5 is out of bounds for axis 1 with size 5

@pariterre
Copy link
Member

It needs to be the same as they are fundamentally linked. It is necessary because there is a line that visually link markers

@Ipuch
Copy link
Contributor Author

Ipuch commented Jul 6, 2023

I should use nan values to fill the value with nan.

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

No branches or pull requests

2 participants