Slam

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 SetCurrentSlamMap 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 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 GetSlamMaps command.

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()

Last updated