Misty Lessons
  • Misty Lessons
    • 📖Welcome to Misty Lessons
    • 📚Get to know your Misty
    • 📲Connect to Misty
    • 👩‍💻Misty Studio
    • 🖥️Desktop Environment
    • ⬆️Update your Misty
    • 👥Projects
  • Blockly
    • 🧩Blockly Lessons
      • 🤸Lesson 1: Movement
      • 🎶Lesson 2: Voice and Sound
      • 🎭Lesson 3: Expressions
      • 🎥Lesson 4: Robot Cinema
      • 🛠️Lesson 5: Events
      • ☺️Lesson 6: Face recognition
      • 🔢Lesson 7: Variables and Functions
      • 💬Lesson 8: NLP
    • 🏫Blockly projects
  • Blockly Elements
    • ⚛️Misty Blocks
      • Movement
      • Speech
      • Audio
      • Vision
      • Events
      • Miscellaneous
      • NLP
      • System
    • 🔁Basic Blocks
      • Logic
      • Loops
      • Math
      • Text
      • Lists
    • 🅰️Advanced Blocks
      • Variables
      • Functions
  • Python
    • 🐍Python Lessons
      • 🦿Lesson 1: Loco-motion
      • 🤖Lesson 2 : Build a character
      • 🧠Lesson 3: Create memories
      • ⚒️Lesson 4: Event skills
      • 👀Lesson 5: Expand awareness
      • 🔗Lesson 6: Compact code
      • 🗣️Lesson 7: Start a conversation
  • Python Elements
    • 🐸Misty Python API
      • Motion and Mobility
      • Display and LED
      • Record Assets
      • Change/Remove Assets
      • Stream Assets
      • Get Assets
      • Events
      • Sensor Events
      • Speech and NLP
      • Arduino Backpack
      • System
      • Slam
    • 📗Python Definitions
  • Python Projects
    • 🔮MistyGPT
    • 🚨Misty Intruder Alert
    • 📺Conference Assistant
    • 🏷️QR code detector
    • 🕵️‍♂️Misty follow human
    • 👋Misty wave back
    • 🖲️Misty OA
    • 🌐Get weather
    • 🚚Misty Delivery
    • 🫂Motivational Misty
    • 🖼️Misty Museum Guide
    • 🎃Who for Halloween
  • ARDUINO
    • ♾️Arduino Backpack
    • 🦎Arduino
    • 🔧Arduino Lessons
      • 🔌Arduino to Misty
      • ➕Misty to Arduino
  • ARDUINO PROJECTS
    • 🛠️Misty Tracker
    • 🦾Misty Arm
  • Community Projects
    • 🌤️Misty weather forecaster
  • HARDWARE EXTENSION
    • ⚙️Arduino breadboard support
    • 🦾Misty arm
    • 🥤Tin holder
  • Resource Database
    • 📁Image files
    • 📁Audio files
    • 📁Languages
    • 📁Known objects
    • 📁NLP Actions
    • 📁Action Commands
    • 📁ChatGPT PDF files
    • 📁AR Tag Dictionary
    • ⚙️Technical Specifications
Powered by GitBook
On this page
  • StartFaceDetection
  • StopFaceDetection
  • StartFaceRecognition
  • StopFaceRecognition
  • StartFaceTraining
  • CancelFaceTraining
  • StartObjectDetector
  • StopObjectDetector
  • StartArTagDetector
  • StopArTagDetector
  • StartQrTagDetector
  • StopQrTagDetector
  • StartRobotInteractionEvent
  • StopRobotInteractionEvent
  1. Python Elements
  2. Misty Python API

Events

Last updated 1 year ago

In this section you will find all of Misty's API calls for triggering different events. You can upload the sample code for an event by loading the event sample template. If you need information on how to trigger events with bump and touch sensors you can check out Sensor Events.

StartFaceDetection

Initiates Misty's detection of faces in her line of vision. This command assigns each detected face a random ID.

misty.start_face_detection()

When you are done having Misty detect faces, call StopFaceDetection.

StopFaceDetection

Stops Misty's detection of faces.

misty.stop_face_detection()

StartFaceRecognition

Directs Misty to recognize a face she sees, if it is among those she already knows. To use this command, you previously must have used either the StartFaceDetection command or the StartFaceTraining command to detect and store one or more face IDs in Misty's memory.

misty.start_face_recognition()

When you are done having Misty recognize faces, call StopFaceRecognition.

StopFaceRecognition

Stop Misty looking for face to recognize.

misty.stop_face_recognition()

StartFaceTraining

Trains Misty to recognize a specific face and applies a user-assigned ID to that face.

This process should take less than 15 seconds and will automatically stop when complete. To halt an in-progress face training, you can call CancelFaceTraining.

Example Code

misty.start_face_training("Simone")

Parameters

misty.start_face_training(self, faceId : str = None)
  • FaceId (string) - A unique string of 30 characters or less that provides a name for the face. Only alpha-numeric, -, and _ are valid characters.

CancelFaceTraining

Halts face training that is currently in progress. A face training session stops automatically, so you do not need to use the CancelFaceTraining command unless you want to abort a training that is in progress.

misty.cancel_face_training("Simone")

StartObjectDetector

Starts Misty locating the position and type of objects.

Example Code

misty.start_object_detector(0.6,0,5)

When you issue a StartObjectDetector command, Misty will start streaming ObjectDetection events when an appropriate object is seen.

To receive those events, you must also register for the ObjectDetection event type.

Object detection consumes extra resources, so when you are done using the events, you should call the StopObjectDetector command.

You can find a list of known objects in Known objects

Parameters

misty.start_object_detector(self, minimumConfidence : float = None, modelId : int = None, maxTrackerHistory : int = None, delegateType : int = None)
  • MinimumConfidence (double) - The minimum confidence to trigger sending an event. From 0 to 1.0.

  • ModelId (int) - The TensorFlow Lite object model to use. Valid model ids are 0-3.

  • MaximumTrackerHistory (int) - How long to hold previous object history across frames.

StopObjectDetector

Stop Misty locating the position and types of objects.

misty.stop_object_detector()

StartArTagDetector

Starts Misty locating the position and values of Ar Tags.

Example Code

misty.start_ar_tag_detector(7,144)

When you issue a StartArTagDetector command, Misty will start streaming ArTagDetection events when an appropriate tag is seen.

Parameters

misty.start_ar_tag_detector(self, dictionary : int = None, tagSizeMm : float = None)
  • Dictionary (int) - The Ar Tag dictionary to use.

  • TagSizeMm (double) - The size of the printed tags. Used in assessing distance.

StopArTagDetector

Stops Misty locating position and values of AR tags.

misty.stop_ar_tag_detector()

StartQrTagDetector

Starts Misty detecting QR tags.

misty.start_qr_tag_detector()

StopQrTagDetector

Stops Misty detecting QR tags.

misty.stop_qr_tag_detector()

StartRobotInteractionEvent

Initiates a robot interaction event in Misty, enabling her to engage in interactions that may involve vision data processing.

Example code

misty.start_robot_interaction_event(True)

Paratmeters

misty.start_robot_interaction_event(self, useVisionData : bool = None)
  • useVisionData (bool): Specifies whether the interaction event should utilize Misty's vision capabilities. When set to True, Misty will process visual data (such as facial recognition or object detection) as part of the interaction.

StopRobotInteractionEvent

Stops the interaction event.

misty.stop_robot_interaction_event()

To receive those events, you must also register for the event type.

🐸
ArTagDetection