In [ ]:
import time
from cherry import Cherry
from poppy.creatures import PoppyHumanoid
from pypot.primitive.move import MoveRecorder, Move, MovePlayer
In [ ]:
cherry = Cherry(simulator='vrep')
cherry.setup()
poppy = cherry.robot
In [ ]:
for m in poppy.arms + poppy.head:
m.compliant = True
In [ ]:
cherry.robot.disc_med.start()
In [ ]:
cherry.robot.normal_behave.start()
In [ ]:
cherry.robot.wave_behave.stop()
In [ ]:
#montre la capacité des moteurs à "savoir où ils sont"
poppy.copy_arm_behave.start()
In [ ]:
poppy.copy_arm_behave.stop()
In [ ]:
poppy.run_look.start()
In [ ]:
poppy.tracking_behave.start()
In [ ]:
poppy.tracking_behave.stop()
In [ ]:
poppy.speak.start('Bonjour! Je suis Cherry, le robot compagnon des enfants hospitalisés.')
In [ ]:
#changer filename
filename = '../utils/text_to_say.txt'
In [ ]:
poppy.say_text.start(filename)
In [ ]:
cherry.robot.disc_med.start()
In [ ]:
cherry.robot.multip_rand.start()
In [ ]:
cherry.robot.vrai1.start()
In [ ]:
cherry.robot.faux.start()
In [1]:
filename_record = '../utils/move_recorded/move10'
In [2]:
#n'enregistre que les mvmts des bras
r_motors_group = poppy.arms
In [ ]:
move_recorder = MoveRecorder(poppy, 50, r_motors_group)
for m in poppy.l_arm:
m.compliant = True
for m in poppy.r_arm:
m.compliant = True
for m in poppy.torso:
m.compliant = False
for m in poppy.head:
m.compliant = True
In [ ]:
move_recorder.start()
In [ ]:
move_recorder.stop()
with open(filename_record, 'w') as f:
move_recorder.move.save(f)
In [ ]:
with open(filename_record) as f:
m = Move.load(f)
poppy.compliant = False
move_player = MovePlayer(poppy, m)
move_player.start()