did some work to assemble it together
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user