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
  • GetMap
  • GetCurrentSlamMap
  • GetSlamIrExposureAndGain
  • GetSlamVisibleExposureAndGain
  • GetSlamMaps
  • GetSlamNavigationDiagnostics
  • GetSlamPath
  • GetSlamStatus
  • SetCurrentSlamMap
  • SetSlamIrExposureAndGain
  • SetSlamVisibleExposureAndGain
  • RenameSlamMap
  • ResetSlam
  • StartMapping
  • StopMapping
  • DeleteSlamMap
  • StartSlamStreaming
  • StopSlamStreaming
  • StartTracking
  • StopTracking
  • TakeDepthPicture
  • TakeFisheyePicture
  1. Python Elements
  2. Misty Python API

Slam

Last updated 1 year ago

This section contains API calls for using the Occipital Core Structure sensors and Slam capabilities on Misty II Pro.

GetMap

Obtains the occupancy grid data for Misty's currently active map.To obtain a valid response from GetMap, Misty must first have successfully generated a map. To change the currently active map, use the command.

Additional Notes

Misty's maps are squares that are constructed around her initial physical location when she starts mapping. When a map is complete, it is a square with Misty's starting point at the center.

The occupancy grid for the map is represented by a two-dimensional matrix. Each element in the occupancy grid represents an individual cell of space. The value of each element (0, 1, 2, or 3) indicates the nature of the space in those cells (respectively: "unknown", "open", "occupied", or "covered").

Each cell corresponds to a pair of X,Y coordinates that you can use with the FollowPath, DriveToLocation, and GetSlamPath commands. The first cell in the first array of the occupancy grid is the origin point (0,0) for the map. The X coordinate of a given cell is the index of the array for the cell. The Y coordinate of a cell is the index of that cell within its array.

misty.get_map()

GetCurrentSlamMap

Obtains the key for the currently active map.

misty.get_current_slam_map()

GetSlamIrExposureAndGain

Obtains the current exposure and gain settings for the infrared cameras in the Occipital Structure Core depth sensor.

misty.get_slam_ir_exposure_and_gain()

GetSlamVisibleExposureAndGain

Obtains the current exposure and gain settings for the fisheye camera in the Occipital Structure Core depth sensor.

misty.get_slam_visible_exposure_and_gain()

GetSlamMaps

Obtains a list of keys and names for Misty's existing maps.

Example code

misty.get_slam_maps()

Parameters

GetSlamNavigationDiagnostics

Obtains diagnostic information about Misty's navigation system.

The information in the data object for this command is primarily used by the Misty Robotics engineering and support staff to troubleshoot and root-cause issues with Misty's SLAM system. The contents of this data object are likely to change without notice in future system updates.

misty.get_slam_navigation_diagnostics()

GetSlamPath

Obtain a path from Misty's current location to a specified set of X,Y coordinates. Pass the waypoints this command returns to the path parameter of FollowPath for Misty to follow this path to the desired location.

This command is not functional with the Misty II Basic Edition.

Important! Make sure to use StartTracking before using this command to have Misty start tracking her location, and use StopTracking to have her stop tracking her location after she arrives at the specified location

Example code

misty.get_slam_path(x=13,y=37)

Parameters

misty.get_slam_path(self, x : int = None, y : int = None, minGap : float = None, wallCostDistance : float = None, unknownIsOpen : bool = None)
  • X (integer) - The X coordinate of the destination.

  • Y (integer) - The Y coordinate of the destination.

GetSlamStatus

Obtains values representing the current activity and status of Misty's SLAM system. Check these values for information about the current status of Misty's depth sensor, the SLAM system, and to see information relevant to any ongoing mapping or tracking activities.

misty.get_slam_status()

SetCurrentSlamMap

Sets a map to be Misty's currently active map for tracking and relocalization.

Example code

misty.set_current_slam_map("Map_20190912_21.16.32.UTC")

Parameters

misty.set_current_slam_map(self, key : str = None)
  • Key (string) - The unique key of the map to make currently active. Note: This command does not work when passed the value for the name associated with a map.

SetSlamIrExposureAndGain

Sets the exposure and gain settings for the infrared cameras in the Occipital Structure Core depth sensor.

Example code

misty.set_slam_ir_exposure_andGain(

Parameters

misty.set_slam_ir_exposure_andGain(self, exposure : float = None, gain : float = None)
  • Exposure (double) - Exposure levels for the infrared cameras in the depth sensor (in seconds). Range: 0.001 - 0.033.

  • Gain (integer) - Gain levels for the infrared cameras in the depth sensor (in dB). Range: 0 - 3.

SetSlamVisibleExposureAndGain

Sets the exposure and gain settings for the fisheye camera in the Occipital Structure Core depth sensor.

Example code

misty.set_slam_visible_exposure_andGain(exposure=0.007987,gain=2)

Parameters

misty.set_slam_visible_exposure_andGain(self, exposure : float = None, gain : float = None)
  • Exposure (double) - Exposure levels for the fisheye camera in the depth sensor (in seconds). Range: 0.001 - 0.033

  • Gain (integer) - Gain levels for the fisheye camera in the depth sensor (in dB). Range: 1 - 8

RenameSlamMap

Renames an existing map.

Example code

misty.rename_slam_map("Map_20190911_21.47.16.UTC", "Kitchenmap2")

Parameters

misty.rename_slam_map(self, key : str = None, name : str = None)
  • Key (string) - The unique key value of the map to rename.

  • Name (string) - A new name value for the map.

ResetSlam

Resets Misty's SLAM sensors

misty.reset_slam()

StartMapping

Starts Misty mapping an area.

misty.start_mapping()

StopMapping

Stops Misty from mapping the environment.

misty.stop_mapping()

DeleteSlamMap

Deletes a specified Slam map.

Example code

misty.delete_slam_map("Map_20190912_21.16.32.UTC")

Parameters

misty.delete_slam_map(self, key : str = None)
  • Key (string) - The unique key value of the map to delete. Note: This command does not work when passed the value for the name associated with a map.

StartSlamStreaming

Opens the data stream from the Occipital Structure Core depth sensor, so you can obtain image and depth data when Misty is not actively tracking or mapping.

Important! Always use StopSlamStreaming to close the depth sensor data stream after sending commands that use Misty's Occipital Structure Core depth sensor. Using StopSlamStreaming turns off the laser in the depth sensor and lowers Misty's power consumption.

Example code

misty.start_slam_streaming()

StopSlamStreaming

Stops Misty's streaming data from the Occipital Structure Core depth sensor.

misty.stop_slam_streaming()

StartTracking

Enables Misty to start tracking the mapped enviornment.

misty.start_tracking()

StopTracking

Stops Misty from tracking the mapped environment.

misty.stop_tracking()

TakeDepthPicture

Provides the current distance of objects from Misty's Occipital Structure Core depth sensor. Note that depending on the scene being viewed, the sensor may return a large proportion of "unknown" values in the form of NaN ("not a number") values.

misty.take_depth_picture()

TakeFisheyePicture

Takes a photo using Misty's Occipital Structure Core depth sensor..

misty.take_fisheye_picture()

Misty saves each map she creates to local storage. Each map is associated with a unique key at the time of the map's creation. Map keys are formatted as date timestamps in UTC (i.e. Map_20190911_21.47.16.UTC). To obtain a list of Misty's existing maps, use the command.

🐸
SetCurrentSlamMap
GetSlamMaps