Skip to content

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

@Ipuch

Description

@Ipuch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions