Skip to content

Commit 3052d61

Browse files
committed
qtvcp -istat: fix OINT_RELATIONS_LIST so synced joints are calculated right
caused a config with no joint sequence numbers to unhome all joints when you unhomed one with ACTION library fixed a typo JOINT_SYNC_LIST
1 parent 2094ada commit 3052d61

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/python/qtvcp/qt_istat.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def update(self):
233233
for j in range(jointcount):
234234
seq = self.INI.find("JOINT_" + str(j), "HOME_SEQUENCE")
235235
if seq is None:
236-
seq = -1
236+
seq = 0
237237
self.HOME_ALL_FLAG = 0
238238
self.JOINT_SEQUENCE_LIST[j] = int(seq)
239239
# joint sequence/type
@@ -265,7 +265,7 @@ def update(self):
265265
if flag:
266266
templist.append(temp)
267267
# remove duplicates
268-
self.JOINT_SYNCH_LIST = list(set(tuple(sorted(sub)) for sub in templist))
268+
self.JOINT_SYNC_LIST = list(set(tuple(sorted(sub)) for sub in templist))
269269

270270
# This is a list of joints that are related to a joint.
271271
#ie. JOINT_RELATIONS_LIST(0) will give a list of joints that go with joint 0
@@ -276,8 +276,12 @@ def update(self):
276276
for j in range(jointcount):
277277
temp = []
278278
for hj, hs in list(self.JOINT_SEQUENCE_LIST.items()):
279+
# the absolute numbers must be equal first
279280
if abs(int(hs)) == abs(int(self.JOINT_SEQUENCE_LIST.get(j))):
280-
temp.append(hj)
281+
# theN one has to be negative to signal syncing
282+
if int(hs) <0 or int(self.JOINT_SEQUENCE_LIST.get(j)) < 0:
283+
temp.append(hj)
284+
# If empty list: no synced joints, just add the jointcount number
281285
if temp == []:
282286
temp.append(j)
283287
self.JOINT_RELATIONS_LIST[j] = temp

0 commit comments

Comments
 (0)