pyomeca / bioviz

Biorbd visualization toolkit
MIT License
16 stars 26 forks source link

Error when no marker defined in bioMod #50

Open EveCharbie opened 3 years ago

EveCharbie commented 3 years ago

Traceback (most recent call last): File "/home/user/Documents/PyCharm/plugins/python-ce/helpers/pydev/pydevd.py", line 1438, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/user/Documents/PyCharm/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/user/Documents/Programmation/Eve/Modeles/ModeleVisu.py", line 50, in b = bioviz.Viz(model_chemin) File "/home/user/anaconda3/envs/Trampo_bioptim/lib/python3.8/site-packages/bioviz/init.py", line 361, in init self.set_q(self.Q) File "/home/user/anaconda3/envs/Trampo_bioptim/lib/python3.8/site-packages/bioviz/init.py", line 401, in set_q self.set_markers_from_q() File "/home/user/anaconda3/envs/Trampo_bioptim/lib/python3.8/site-packages/bioviz/init.py", line 790, in set_markers_from_q self.markers[0:3, :, :] = self.Markers.get_data(Q=self.Q, compute_kin=False) File "/home/user/anaconda3/envs/Trampo_bioptim/lib/python3.8/site-packages/bioviz/init.py", line 82, in get_data self.get_data_func(**kwargs) File "/home/user/anaconda3/envs/Trampo_bioptim/lib/python3.8/site-packages/bioviz/init.py", line 103, in _get_data_from_casadi self.data[:, :, 0] = np.array(self.markers(Q)) ValueError: could not broadcast input array from shape (0,0) into shape (3,0)

callmekofi commented 2 years ago

It could probably be that an item in the list is not 3D, or it doesn't match other elements. Check the dimensions of the array shape

pariterre commented 2 years ago

@EveCharbie Didi we fix this bug? I feel that we just need to add a check when nbMarkers is zero