Skip to content

Commit

Permalink
Merge pull request #15 from pariterre/master
Browse files Browse the repository at this point in the history
Fixed a broadcasting error
  • Loading branch information
pariterre authored Jul 24, 2019
2 parents e580568 + d95254a commit 359c9ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 8 additions & 7 deletions BiorbdViz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def set_q(self, Q, refresh_window=True):
raise TypeError(f"Q should be a {self.nQ} column vector")
self.Q = Q

self.model.UpdateKinematicsCustom(self.model, biorbd.s2mGenCoord(self.Q))
if self.show_muscles:
self.__set_muscles_from_q()
if self.show_rt:
Expand Down Expand Up @@ -470,20 +471,20 @@ def __load_movement(self):
self.muscle_analyses.add_movement_to_dof_choice()

def __set_markers_from_q(self):
markers = self.model.Tags(self.model, self.Q)
markers = self.model.Tags(self.model, self.Q, True, False)
for k, mark in enumerate(markers):
self.markers[0:3, k, 0] = mark.get_array()
self.markers[0:3, k, 0] = mark.get_array().reshape(-1, 1)
self.vtk_model.update_markers(self.markers.get_frame(0))

def __set_global_center_of_mass_from_q(self):
com = self.model.CoM(self.Q)
self.global_center_of_mass[0:3, 0, 0] = com.get_array()
com = self.model.CoM(self.Q, False)
self.global_center_of_mass[0:3, 0, 0] = com.get_array().reshape(-1, 1)
self.vtk_model.update_global_center_of_mass(self.global_center_of_mass.get_frame(0))

def __set_segments_center_of_mass_from_q(self):
coms = self.model.CoMbySegment(self.Q)
coms = self.model.CoMbySegment(self.Q, False)
for k, com in enumerate(coms):
self.segments_center_of_mass[0:3, k, 0] = com.get_array()
self.segments_center_of_mass[0:3, k, 0] = com.get_array().reshape(-1, 1)
self.vtk_model.update_segments_center_of_mass(self.segments_center_of_mass.get_frame(0))

def __set_meshes_from_q(self):
Expand Down Expand Up @@ -512,6 +513,6 @@ def __set_muscles_from_q(self):
self.vtk_model.update_muscle(self.muscles)

def __set_rt_from_q(self):
for k, rt in enumerate(self.model.globalJCS(self.Q, True)):
for k, rt in enumerate(self.model.globalJCS(self.Q, False)):
self.rt[k] = RotoTrans(rt.get_array())
self.vtk_model.update_rt(self.rt)
5 changes: 5 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1- Faire cadre autours du vizualiseur (mieux délimiter)
2- Tick box pour affichage (show_*)
3- Choisir plans en cliquant
4- Nom des axes sur le repère global

0 comments on commit 359c9ea

Please sign in to comment.