did some work to assemble it together

This commit is contained in:
Pavel Lutskov
2019-01-28 17:34:55 +01:00
parent dc88c5259b
commit 2d0441306a
6 changed files with 76 additions and 38 deletions

View File

@@ -27,6 +27,7 @@ if __name__ == '__main__':
sleep(0.1)
if not _inform_controller('imitate'):
continue
rospy.loginfo('IMITATOR: ACTIVE')
for i, eff in enumerate(['L',
'R'], 1):
try:
@@ -36,18 +37,14 @@ if __name__ == '__main__':
rospy.Time(0)
)
except Exception as e:
print e
continue
sign = 1 if eff == 'L' else -1
roll = asin(trans[1] /
sqrt(trans[0]**2 + trans[1]**2 + trans[2]**2))
roll -= sign * radians(25)
pitch = atan(-trans[2] / abs(trans[0]))
# sign = 1 if roll > 0 else -1
# roll -= sign * radians(10)
# print degrees(roll)
mp.setAngles([
'{}ShoulderRoll'.format(eff),
'{}ShoulderPitch'.format(eff)