temi SDK

repository·master·Indexed 42 days ago

https://github.com/robotemi/sdk

A set of tools and libraries for building applications for temi robots, distributed as an Android Archive (AAR) via Maven Central. The SDK provides APIs for robot hardware control, navigation, mapping, user interaction, face recognition, and telepresence. Key components include the Robot entry point, MapModel for floor management, and ActivityStreamListItem for activity stream representation. Version 1.138.0 is available via Gradle and Maven.

Tokens
197.5K
Snippets
1.1K
Records
1.5K
Agent score
51%

What's inside temi SDK

  1. Use the com.robotemi.sdk.notification package

    master

    The com.robotemi.sdk.notification package provides the types necessary to display and handle notifications on the temi device. It includes different notification styles and a callback mechanism to handle user interactions with notification buttons.

    Available Notification Types

    All notification types implement the Notification interface:

    • AlertNotification: Used for high-priority alerts.
    • BillboardNotification: Used for large, billboard-style visual notifications.
    • NormalNotification: Standard notifications for general information.

    Handling User Interactions

    To receive information about which button a user pressed on a notification, use the NotificationCallback. This class encapsulates the notification ID and the specific button number that was pressed, allowing your skill to respond to user input.

  2. Use listeners in the com.robotemi.sdk.listeners package

    master

    The com.robotemi.sdk.listeners package provides a variety of listener interfaces and abstract classes used to react to real-time state changes and events on the temi robot. These listeners allow your application to respond to changes in battery status, movement, detection data, telepresence status, user interactions, and more.

    Available listener types include:

    Status and State Changes

    • OnBatteryStatusChangedListener: React to battery level or charging status changes.
    • OnMovementStatusChangedListener: Monitor the robot's movement state.
    • OnMovementVelocityChangedListener: Track changes in the robot's movement speed.
    • OnRobotReadyListener: Detect when the robot is ready for commands.
    • OnRobotLiftedListener: Respond when the robot is physically lifted.
    • OnPrivacyModeChangedListener: Monitor changes in the robot's privacy mode.
    • OnGreetModeStateChangedListener: Track changes in the greeting mode state.
    • OnDisabledFeatureListUpdatedListener: React to updates in the list of disabled features.

    Interaction and Presence

    • OnBeWithMeStatusChangedListener: Monitor the 'Be With Me' status.
    • OnConstraintBeWithStatusChangedListener: Monitor constraint-based 'Be With Me' status.
    • OnUserInteractionChangedListener: Detect changes in user interaction.
    • OnConversationStatusChangedListener: Track the status of active conversations.
    • OnUsersUpdatedListener (Abstract Class): Receive updates when the list of recognized userIds changes.

    Detection and Location

    • OnDetectionDataChangedListener: React to changes in sensor/detection data.
    • OnDetectionStateChangedListener: Monitor the state of the detection system.
    • OnLocationsUpdatedListener: Respond to updates in known robot locations.
    • OnGoToLocationStatusChangedListener: Track the progress or status of a 'Go To Location' command.

    Telepresence and Audio

    • OnTelepresenceStatusChangedListener (Abstract Class): Monitor telepresence status; includes a sessionId: String.
    • OnTelepresenceEventChangedListener: React to specific telepresence events.
    • OnTtsVisualizerFftDataChangedListener: Receive FFT data for TTS (Text-to-Speech) visualization.
    • OnTtsVisualizerWaveFormDataChangedListener: Receive waveform data for TTS visualization.
  3. Use the com.robotemi.sdk.mediabar package

    master
    The com.robotemi.sdk.mediabar package provides the interfaces and classes required to control and interact with the Media Bar on temi devices. It includes the core MediaBarController interface, an AidlMediaBarController implementation for Android JVM environments, and MediaBarData for handling media-related data structures.
  4. Configure UI Modes and Flags using SdkConstants

    master

    When defining how your application's UI should behave on the temi robot (e.g., whether the top bar is visible or if the app should be fullscreen), use the METADATA_UI_MODE and METADATA_UI_FLAG constants.

    UI Modes (METADATA_UI_MODE):

    • METADATA_UI_MODE_DEFAULT (0): All UI elements are visible.
    • METADATA_UI_MODE_FULLSCREEN (1): All UI elements are hidden. Note: If this mode is set, other Flags are ignored.
    • METADATA_UI_MODE_IMMERSIVE (2): UI elements can be shown/hidden when requested. This mode can be used in conjunction with Flags.
    • METADATA_UI_MODE_BLEND (3): All UI elements are visible. If this mode is set, other Flags are ignored.
    • METADATA_UI_MODE_HIDE_ALL_TOP_BAR_ELEMENTS (4)

    UI Flags (METADATA_UI_FLAG):

    • METADATA_UI_FLAG_DEFAULT (0): Show everything.
    • METADATA_UI_FLAG_HIDE_TOP_BAR (1): Hide top bar always.
  5. Understand the OnLoadMapStatusChangedListener Status enum

    master
    The Status enum is used within the OnLoadMapStatusChangedListener to indicate the current state of the map loading process. When implementing a listener for map status changes, you can inspect this Status value to determine if the map has successfully loaded, failed, or is currently in a specific state during the loading lifecycle.
  6. Use BeWithMeStatus to monitor presence status

    master
    The BeWithMeStatus enum represents the current status of the 'Be With Me' feature, which indicates whether a user is currently interacting with or present with the robot. This status is typically used within an OnBeWithMeStatusChangedListener to react to changes in user presence or engagement levels.
  7. Use GoToLocationStatus in OnGoToLocationStatusChangedListener

    master

    The GoToLocationStatus enum/annotation represents the current state of a 'go to location' command. It is used within the OnGoToLocationStatusChangedListener to monitor whether a robot's movement to a specific location is currently in progress, has succeeded, or has failed.

    When implementing OnGoToLocationStatusChangedListener, you can check the GoToLocationStatus to react to the robot's navigation lifecycle.

  8. Understand the Floor.CREATOR object

    master
    In the Android JVM environment, Floor.CREATOR is a Parcelable.Creator<Floor> object. It is used by the Android system to reconstruct Floor instances from a Parcel during inter-process communication (IPC) or when restoring state. This is an internal mechanism used by the Android framework to handle the serialization and deserialization of the Floor object.