Пример #1
0
    logger.info(f"Calibration flag should be True ... {mymarty.is_calibrated()}")
time.sleep(0.1)
if martyVersion2:
    assert mymarty.is_calibrated()

logger.info(f"Marty interface stats {json.dumps(mymarty.get_interface_stats())}")

testBoolCmd("Get ready", mymarty.get_ready())
testBoolCmd("Circle Dance", mymarty.circle_dance())
testBoolCmd("Eyes excited", mymarty.eyes('excited'))
testBoolCmd("Eyes wide", mymarty.eyes('wide'))
testBoolCmd("Eyes angry", mymarty.eyes('angry'))
testBoolCmd("Eyes normal", mymarty.eyes('normal'))
testBoolCmd("Kick left", mymarty.kick('left'))
testBoolCmd("Kick right", mymarty.kick('right'))
testBoolCmd("Stop", mymarty.stop())
testBoolCmd("Arms 45", mymarty.arms(45, 45, 500))
testBoolCmd("Arms 0", mymarty.arms(0, 0, 500))

testBoolCmd("Arms 0", mymarty.play_sound("disbelief"))
testBoolCmd("Arms 0", mymarty.play_sound("excited"))
testBoolCmd("Arms 0", mymarty.play_sound("screenfree"))

logger.info(f"Marty interface stats {json.dumps(mymarty.get_interface_stats())}")

for i in range(9): 
    testBoolCmd(f"Move joint {i}", mymarty.move_joint(i, i * 10, 500))
for jointName in jointNames: 
    testBoolCmd(f"Move joint {jointName}", mymarty.move_joint(jointName, 123, 500))

logger.info(f"Accelerometer x {mymarty.get_accelerometer('x')}")
Пример #2
0
from martypy import Marty

my_marty = Marty("wifi", "192.168.86.11")

# Ask Marty to walk
my_marty.walk(20)
my_marty.dance()

# Do something while marty is walking
while my_marty.is_moving():
    if my_marty.get_distance_sensor() < 20:
        my_marty.stop()