Interface IPivoSdk

  • All Known Implementing Classes:
    PivoProSdk

    public interface IPivoSdk
    PivoSDK interface
    • Method Detail

      • scan

        void scan()
        This function is used to scan for Pivo devices
      • connectTo

        void connectTo​(PivoDevice pivoDevice)
        This function is used to connect to the device.
        Parameters:
        pivoDevice - is the device, you want to connect to
      • stopScan

        void stopScan()
        Call this function to stop scanning.
      • setSpeedBySecondsPerRound

        void setSpeedBySecondsPerRound​(int speedInSecondsPerRound)
        This function is used to set default speed with seconds per round for Pivo. You need to send Pivo supported speed, to get Pivo supported speeds call getSupportedSpeedsInSecondsPerRound() function.
        Parameters:
        speedInSecondsPerRound -
      • setSpeedBySecondsPerRoundRemote

        void setSpeedBySecondsPerRoundRemote​(int speedInSecondsPerRound)
      • getSupportedSpeedsInSecondsPerRound

        int[] getSupportedSpeedsInSecondsPerRound()
        This function is used to get all supported speeds for application.
        Returns:
        returns an array of speeds(unit is seconds per round)
      • getSupportedSpeedsByRemoteInSecondsPerRound

        int[] getSupportedSpeedsByRemoteInSecondsPerRound()
        This function is used to get all supported speeds using remote controller.
        Returns:
        returns array of speeds(unit is seconds per round).
      • disconnect

        void disconnect()
        This function is called to disconnect from the Pivo.
      • turnLeft

        void turnLeft​(int angle)
        Turn Pivo to left at the current speed.
        Parameters:
        angle - is angle to rotate
      • turnRight

        void turnRight​(int angle)
        This function is used to turn Pivo to right.
        Parameters:
        angle - is angle to rotate
      • turnRightContinuously

        void turnRightContinuously()
        This function is used to rotate continuously to right with the current speed.
      • turnLeftContinuously

        void turnLeftContinuously()
        This function is used to rotate continuously to left with the current speed.
      • requestBatteryLevel

        void requestBatteryLevel()
        This function is used to request Pivo battery level.
      • stop

        void stop()
        This function is used to stop Pivo rotation
      • changeName

        void changeName​(String name)
        This function is used to change Pivo name.
        Parameters:
        name - is desired name
      • isPivoConnected

        boolean isPivoConnected()
        This function is used to check connectivity of Pivo to the app.
        Returns:
        is boolean, if it's connected returns true, otherwise it returns false.
      • getPivoVersion

        @Deprecated
        String getPivoVersion()
        Deprecated.
        This method is deprecated starting from version 1.0.1-beta. Please use getVersion instead of this method. This function is used to get Pivo version.
        Returns:
        version of Pivo
      • getSupportedTrackingModes

        String[] getSupportedTrackingModes()
        This function returns all supported tracking modes by Pivo
        Returns:
        an array of supported tracking methods.
      • startActionTracking

        void startActionTracking​(FrameMetadata metadata,
                                 Rect region,
                                 Image image,
                                 PivoSensitivity sensitivity,
                                 ITrackingListener listener)
        This function is used to start Action Tracking.
        Parameters:
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        region - is region of interest. The minimum supported width and height should be bigger than 100.
        image - is image data which is acquired from camera.
        listener - is a callback of action tracking.
      • startActionTracking

        void startActionTracking​(FrameMetadata metadata,
                                 Rect region,
                                 byte[] byteArray,
                                 PivoSensitivity sensitivity,
                                 ITrackingListener listener)
        This function is used to start Action Tracking.
        Parameters:
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        region - is region of interest. The minimum supported width and height should be bigger than 100.
        byteArray - is NV21 image byteArray.
        listener - is a callback of action tracking.
      • starPersonTracking

        void starPersonTracking​(FrameMetadata metadata,
                                Image image,
                                PivoSensitivity sensitivity,
                                ITrackingListener listener)
        This function is used to start human tracking.
        Parameters:
        metadata - metadata is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        image - is image data which is acquired from camera.
        sensitivity - is enum set to control Pivo movement.
        listener - is a callback of person tracking.
      • starPersonTracking

        void starPersonTracking​(FrameMetadata metadata,
                                byte[] byteArray,
                                PivoSensitivity sensitivity,
                                ITrackingListener listener)
        This function is used to start human tracking.
        Parameters:
        metadata - metadata is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        byteArray - is NV21 image data.
        sensitivity - is enum set to control Pivo movement.
        listener - is a callback of person tracking.
      • startHorseTracking

        void startHorseTracking​(FrameMetadata metadata,
                                Image image,
                                PivoSensitivity sensitivity,
                                ITrackingListener listener)
        This function is used to start horse tracking.
        Parameters:
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        image - is image data which is acquired from camera.
        sensitivity - is enum set to control Pivo movement.
        listener - is a callback of horse tracking.
      • startHorseTracking

        void startHorseTracking​(FrameMetadata metadata,
                                byte[] byteArray,
                                PivoSensitivity sensitivity,
                                ITrackingListener listener)
        This function is used to start horse tracking.
        Parameters:
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        byteArray - is NV21 byte array
        sensitivity - is enum set to control Pivo movement.
        listener - is a callback of horse tracking.
      • updateTrackingFrame

        void updateTrackingFrame​(Image image,
                                 FrameMetadata metadata)
        This function is used to update frames for processing. Please make sure calling startPersonTracking, startActionTracking, or startHorseTracking, and call updateTrackingFrame function.
        Parameters:
        image - is image data which is acquired from camera.
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
      • updateTrackingFrame

        void updateTrackingFrame​(byte[] byteArray,
                                 FrameMetadata metadata)
        This function is used to update frames for processing. Please make sure calling startPersonTracking, startActionTracking, or startHorseTracking, and call updateTrackingFrame function.
        Parameters:
        byteArray - is an NV21 image byte array.
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
      • stopTracking

        void stopTracking()
        This function is used to stop tracking.
      • getVersion

        Version getVersion()
        This method is used to get Pivo Version and type.
        Returns:
        pivo version
      • enableBypass

        void enableBypass​(boolean activate)