🖼️Misty Museum Guide

Misty loves to dive in new jobs! This time she'll be a museum guide!

This is the biggest Python code for Misty so far! She'll be a museum guide showing you the history of robotics, from industrial machines to interactive robots of today, like Misty!

Misty will move to different stages, each representing a milestone in the history of robotics.

This is Misty's path for this specific museum but feel free to adjust it according to your preferences:


introduction
|
|
1 ----- 2 ----- 3               9 ----- 10 ----- 11
↓       ↓      /|               |\      ↓       /|
                |               |                |
               ←4               8→              ←12
                |               |                | 
                |               |                |
                5 ----- 6 ----- 7               ←13
                ↓       ↓       ↓                |
                                                 |
                        14&conclusion------------⌋

The arrows show the direction that Misty is facing when she stops, from the introduction to the conclusion.

Misty will show many pictures on her display, so they must be uploaded to the robot before the skill can be launched.

from mistyPy.Robot import Robot
from mistyPy.Events import Events
import random
import time

misty = Robot("YOUR-ROBOT-IP-ADDRESS")
misty.change_led(0, 255, 0)
misty.move_head(0, 0, 0)
misty.move_arms(20, 20)

# stages
def initial_joke():
    misty.set_default_volume(20)
    misty.speak("Can you hear me now?")
    time.sleep(2)
    misty.set_default_volume(100)
    misty.speak("And now?")
    time.sleep(2)
    misty.set_default_volume(70)
    misty.speak("Okay this should work")
    time.sleep(2)
    misty.start_action("Hi")

def introduction():
    misty.change_led(0,0,0)
    misty.display_image("e_Admiration.jpg")
    misty.speak("Hello, everyone! I'm Misty, your friendly museum guide for today.")
    time.sleep(3)
    misty.move_arms(80, -89)
    time.sleep(1)
    misty.move_arms(80, 0)
    time.sleep(0.75)
    misty.move_arms(80, -89)
    time.sleep(0.75)
    misty.speak("We're about to embark on an exciting journey through the history of robotics.")
    random_chest()
    head_side_to_side()
    time.sleep(2)
    misty.speak("From the first examples developed in the 1950s to the modern, interactive robots like me. you’ll see how robots have evolved over time.")
    time.sleep(5)
    misty.speak("Let’s begin!")
    time.sleep(3)

def stage_1_1950s():
    misty.move_head(10, 0, 0)
    misty.display_image("unimate_1.png")
    random_chest()
    misty.speak("Our journey starts in the 1950s. One of the earliest robots was Unimate, created by George Devol in 1954.")
    time.sleep(7)
    misty.move_arms(0, 0)
    misty.display_image("unimate_2.png")
    misty.speak("Unimate was designed to automate factory tasks like moving and stacking heavy metal parts.")
    time.sleep(6)
    random_chest()
    misty.move_arms(30, -30)
    misty.display_image("unimate_3.png")
    misty.speak("In 1961, it became the first robot used in a factory, working on the assembly line at General Motors. This marked the beginning of industrial robotics.")
    time.sleep(10)

def stage_2_1960s():
    misty.display_image("lunokhod_1.png")
    random_chest()
    misty.speak("During the 1960s, robots weren't just working in factories; they were also exploring new frontiers.")
    time.sleep(6)
    misty.display_image("lunokhod_2.png")
    time.sleep(2)
    misty.speak("In 1966, Lunokhod, the first prototype of a lunar rover, was developed in the Soviet Union.")
    misty.start_action("Love")
    time.sleep(6)
    random_chest()
    misty.display_image("lunokhod_3.png")
    misty.speak("Although it didn’t make it to the Moon until 1970, it set the stage for robotics in space exploration.")
    time.sleep(6)

def stage_3_1970s():
    misty.move_head(-10, 0, 0)
    misty.display_image("puma_1.png")
    random_chest()
    misty.speak("Robots in the 1970s continued to grow in sophistication. A great example is the PUMA robot arm, developed in 1978.")
    time.sleep(9)
    misty.display_image("puma_2.png")
    misty.speak("It was designed to handle precise tasks in assembly lines and became one of the most popular robotic arms, setting a standard for robotics in manufacturing.")
    random_chest()
    time.sleep(8)
    i = 0
    while i < 4:
        misty.move_arms(40, -40)
        time.sleep(0.5)
        misty.move_arms(-40, 40)
        time.sleep(0.5)
        i = i + 1

def stage_4_1980s():
    misty.move_head(-10, 0, 0)
    misty.display_image("shakey_1.png")
    random_chest()
    misty.speak("The 1980s saw the rise of robots that could think for themselves. One significant robot was Shakey, developed by Stanford Research Institute.")
    time.sleep(9)
    misty.display_image("shakey_2.png")
    random_chest()
    misty.speak("It was the first robot that could perceive its surroundings, plan its actions, and navigate through its environment, showing how robots could make decisions.")
    time.sleep(9)
    misty.drive_time(0, -50, 10000) # turn 360°
    time.sleep(10)

def stage_5_early_1990s():
    misty.display_image("asimo_1.png")
    random_chest()
    misty.move_arms(80, 80)
    misty.speak("In the early 1990s, robots started to take on more human-like forms. One of the most famous is ASIMO, created by Honda in 1996.")
    time.sleep(9)
    misty.display_image("asimo_2.png")
    random_chest()
    misty.speak("ASIMO was designed to walk, run, and even climb stairs like a human, demonstrating how robots could interact more naturally with their surroundings.")
    time.sleep(10)
    misty.start_action("Walk-fast")
    misty.drive_time(50, 0, 1000)
    time.sleep(1)
    misty.drive_time(-50, 0, 1000)
    time.sleep(1)
    time.sleep(2)

def stage_6_late_1990s():
    misty.move_head(-10, 0, 0)
    misty.display_image("aibo_1.png")
    random_chest()
    misty.speak("In the late 1990s, robots began to make their way into our homes. One of the most memorable was AIBO, the robotic dog developed by Sony in 1999.")
    time.sleep(9)
    misty.display_image("aibo_2.png")
    time.sleep(3)
    random_chest()
    misty.speak("AIBO could move, bark, play, and even learn new tricks, becoming one of the first successful social robots.")
    time.sleep(7)
    misty.start_action("Party")

def stage_7_early_2000s():
    misty.move_head(-10, 0, 0)
    misty.move_arms(0, 0)
    misty.display_image("davinci_1.png")
    random_chest()
    misty.speak("As we moved into the 2000s, robots took on new roles. Da Vinci, a surgical robot, became widely used for performing delicate surgeries with high precision.")
    time.sleep(10)
    misty.display_image("opportunity_1.png")
    time.sleep(3)
    random_chest()
    misty.speak("At the same time, NASA’s Spirit and Opportunity rovers were exploring Mars, proving that robots could work beyond Earth.")
    time.sleep(7)

def stage_8_mid_2000s():
    misty.move_arms(0, 0)
    misty.display_image("roomba_1.png")
    random_chest()
    misty.speak("In the mid-2000s, robots became more present in everyday life. Remember the Roomba vacuum cleaner, launched by iRobot in 2002?")
    time.sleep(7)
    misty.display_image("roomba_2.png")
    random_chest()
    misty.speak("It could automatically navigate a room and clean the floors. Around the same time, Paro, a robotic seal, was used for therapy in hospitals, showing how robots could calm people.")
    time.sleep(10)
    drive_square()

def stage_9_late_2000s():
    misty.display_image("nao_1.png")
    time.sleep(2)
    random_chest()
    misty.start_action("Concerned")
    misty.speak("Towards the end of the 2000s, robots became more interactive. Nao, a small humanoid robot, was released in 2008.")
    time.sleep(7)
    misty.display_image("nao_2.png")
    random_chest()
    misty.speak("Nao could walk, talk, dance, and even recognize faces, becoming a popular platform for research and education.")
    time.sleep(7)
    misty.change_led(255, 0, 0)

def stage_10_early_2010s():
    misty.move_head(-10, 0, 0)
    misty.move_arms(0, 0)
    misty.display_image("pepper_1.png")
    random_chest()
    misty.speak("In the early 2010s, robots began to benefit from AI. Pepper, introduced in 2014, was a social robot that could read emotions and have conversations.")
    time.sleep(12)
    misty.display_image("pepper_2.png")
    random_chest()
    time.sleep(2)
    misty.start_action("Party")
    misty.speak("Meanwhile, AI-based robots like Watson showed how robots could understand language, even winning games like Jeopardy!")
    time.sleep(8)

def stage_11_mid_2010s():
    misty.move_head(-10, 0, 0)
    misty.display_image("jibo_1.png")
    random_chest()
    misty.speak("During the mid-2010s, assistive robots like Jibo became popular. Jibo was designed to be a helpful companion at home.")
    time.sleep(8)
    misty.display_image("tesla_1.png")
    random_chest()
    misty.drive_time(70, 0, 3000) #straight
    time.sleep(3)
    misty.drive_time(-70, 0, 3000) #straight
    time.sleep(3)
    misty.speak("Around the same time, companies like Tesla were developing self-driving cars, expanding what robots could do in our daily lives.")
    time.sleep(11)

def stage_12_late_2010s():
    misty.move_head(-10, 0, 0)
    misty.display_image("vector_1.png")
    random_chest()
    misty.speak("During the late 2010s, there was a surge in home robots designed to make life more fun. One example is Vector, a friendly robot created by Anki in 2018.")
    time.sleep(11)
    misty.display_image("cozmo_1.png")
    random_chest()
    arms_both_up_both_down()
    misty.speak("Another was Cozmo, also by Anki, which taught kids about coding through fun games and activities.")
    time.sleep(7)
    misty.change_led(255, 0, 0)

def stage_13_2020s():
    misty.move_head(10, 0, 0)
    misty.display_image("sophia_1.png")
    random_chest()
    misty.speak("As we move further into the 2020s, humanoid and interactive robots have reached new levels. Sophia by Hanson Robotics is one famous example.")
    time.sleep(10)
    misty.display_image("optimus_1.png")
    time.sleep(4)
    random_chest()
    misty.start_action("Hug2")
    misty.display_image("atlas_1.png")
    misty.speak("There's also Optimus by Tesla, designed to assist with tasks, and Atlas by Boston Dynamics, known for its agility.")
    time.sleep(7)

def stage_14_misty():
    misty.start_action("Love")
    misty.speak("And then there is me, Misty, the world's most lovable robot")
    time.sleep(4)
    misty.speak("I can create every activity with you, as you had the possibility to see I'm able to change my personality very easily, and you can use me to interact with the world around you! I can map, drive, recognize and much more.")
    time.sleep(10)
    misty.speak("Navigate in the Misty lessons to learn all what I can offer you!")
    time.sleep(6)
    misty.drive_time(0, -90, 12500)
    time.sleep(10)

def conclusion():
    misty.move_head(-10, 0, 0)
    random_chest()
    misty.speak("That concludes our journey through the history of robotics! From industrial machines to interactive robots of today, it’s been an incredible journey.")
    time.sleep(12)
    random_chest()
    misty.start_action("Cheers")
    misty.speak("I hope you enjoyed learning about the story of robots. Thank you for joining me!")
    time.sleep(6)

#utilities

def head_side_to_side():
    misty.move_head(0, 0, -60)
    time.sleep(1)
    misty.move_head(10, 0, -60)
    time.sleep(1)
    misty.move_head(-10, 0, -60)
    time.sleep(1)
    misty.move_head(-10, 0, 60)
    time.sleep(1)
    misty.move_head(10, 0, 60)
    time.sleep(1)
    misty.move_head(0, 0, 0)
    time.sleep(1)

def arms_up_and_down():
    i = 0
    while i < 2:
        misty.move_arms(90, -90)
        time.sleep(1)
        misty.move_arms(-90, 90)
        time.sleep(1)
        i = i + 1

def random_chest():
    misty.change_led(random.randrange(0, 255), random.randrange(0, 255), random.randrange(0, 255))

def turn_straight_turn():
    misty.drive_time(0, -50, 4500) #turn left 90°
    time.sleep(5)
    misty.drive_time(70, 0, 3000)# straight
    time.sleep(3)
    misty.drive_time(0, 50, 4500) #turn right 90°
    time.sleep(5)

def drive_square():
    i = 0
    while i < 4:
        misty.drive_time(40, 0, 3000)
        time.sleep(3)
        misty.drive_time(0, 50, 4500)
        time.sleep(5)
        i = i + 1
    
def arms_both_up_both_down():
    i = 0
    while i < 3:
        misty.move_arms(70, 70)
        time.sleep(0.8)
        misty.move_arms(-70, -70)
        time.sleep(0.8)
        i = i + 1

def path():
    introduction()
    time.sleep(3)
    misty.drive_time(0, 50, 6500) #turn right 180°
    time.sleep(7)
    misty.drive_time(70, 0, 3000) #straight
    time.sleep(3)

    stage_1_1950s()
    time.sleep(3)
    turn_straight_turn()

    stage_2_1960s()
    time.sleep(3)
    turn_straight_turn()
    misty.drive_time(0, 50, 3000) #turn right 45° 
    time.sleep(3)

    stage_3_1970s()
    time.sleep(3)
    misty.drive_time(0, -50, 3000) #turn left 45°
    time.sleep(3)
    misty.drive_time(70, 0, 3000)
    time.sleep(3)
    misty.drive_time(0,-50, 4500)
    time.sleep(5)

    stage_4_1980s()
    time.sleep(3)
    misty.drive_time(70, 0, 3000)
    time.sleep(3)

    stage_5_early_1990s()
    time.sleep(3)
    turn_straight_turn()

    stage_6_late_1990s()
    time.sleep(3)
    turn_straight_turn()

    stage_7_early_2000s()
    time.sleep(3)
    misty.drive_time(0, 50, 6500)
    time.sleep(7)
    misty.drive_time(70, 0, 3000)
    time.sleep(3)
    misty.drive_time(0, -50, 4500)
    time.sleep(5)

    stage_8_mid_2000s()
    time.sleep(3)
    turn_straight_turn()
    misty.drive_time(0, 50, 3000) #turn right 45° 
    time.sleep(3)

    stage_9_late_2000s()
    time.sleep(3)
    misty.drive_time(0, -50, 3000) #turn left 45°
    time.sleep(3)
    misty.drive_time(70, 0, 3000)
    time.sleep(3)
    misty.drive_time(0,-50, 4500)
    time.sleep(5)

    stage_10_early_2010s()
    time.sleep(3)
    turn_straight_turn()
    misty.drive_time(0, 50, 3000) #turn right 45° 
    time.sleep(3)

    stage_11_mid_2010s()
    time.sleep(3)
    misty.drive_time(0, -50, 3000) #turn left 45°
    time.sleep(3)
    misty.drive_time(70, 0, 3000)
    time.sleep(3)
    misty.drive_time(0,-50, 4500)
    time.sleep(5)

    stage_12_late_2010s()
    time.sleep(3)
    turn_straight_turn()

    stage_13_2020s()
    time.sleep(3)
    turn_straight_turn()
    misty.drive_time(70, 0, 5000)
    time.sleep(5)
    misty.drive_time(0, 50, 4500)
    time.sleep(5)

    stage_14_misty()
    time.sleep(3)
    conclusion()
    time.sleep(3)

initial_joke()
time.sleep(2)
path()
time.sleep(2)

In the first part of the code, you can see the declaration of Misty's libraries and the creation of the robot. In the stages section, you can find all the different stages each with a different story to tell and unique animations. In the utils some useful functions that involve Misty's behaviour such as moving arms or head in specific locations.

In the last function, path, you can see all Misty's driving and the stage's calls.

Last updated