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

compliance


In [ ]:
for m in poppy.arms + poppy.head:
    m.compliant = True

Exemple de discours


In [ ]:
cherry.robot.disc_med.start()

mouvements de base


In [ ]:
cherry.robot.normal_behave.start()

In [ ]:
cherry.robot.wave_behave.stop()

exemple : copy arm


In [ ]:
#montre la capacité des moteurs à "savoir où ils sont"
poppy.copy_arm_behave.start()

In [ ]:
poppy.copy_arm_behave.stop()

Vision


In [ ]:
poppy.run_look.start()

In [ ]:
poppy.tracking_behave.start()

In [ ]:
poppy.tracking_behave.stop()

voix


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)

voix+mouvement


In [ ]:
cherry.robot.disc_med.start()

In [ ]:
cherry.robot.multip_rand.start()

In [ ]:
cherry.robot.vrai1.start()

In [ ]:
cherry.robot.faux.start()

enregistrement de mvmt


In [1]:
filename_record = '../utils/move_recorded/move10'

In [2]:
#n'enregistre que les mvmts des bras
r_motors_group = poppy.arms


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-44558a2c1d31> in <module>()
----> 1 r_motors_group = poppy.arms

NameError: name 'poppy' is not defined

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)

On le rejoue


In [ ]:
with open(filename_record) as f:
    m = Move.load(f)

poppy.compliant = False

move_player = MovePlayer(poppy, m)
move_player.start()