Class PivoProSdk

    • Method Detail

      • getInstance

        public static PivoProSdk getInstance()
      • init

        public static void init​(Context context)
      • scan

        public void scan()
        Description copied from interface: IPivoSdk
        This function is used to scan for Pivo devices
        Specified by:
        scan in interface IPivoSdk
      • connectTo

        public void connectTo​(PivoDevice pivoDevice)
        Description copied from interface: IPivoSdk
        This function is used to connect to the device.
        Specified by:
        connectTo in interface IPivoSdk
        Parameters:
        pivoDevice - is the device, you want to connect to
      • stopScan

        public void stopScan()
        Description copied from interface: IPivoSdk
        Call this function to stop scanning.
        Specified by:
        stopScan in interface IPivoSdk
      • setSpeedBySecondsPerRound

        public void setSpeedBySecondsPerRound​(int speedInSecondsPerRound)
        Description copied from interface: IPivoSdk
        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.
        Specified by:
        setSpeedBySecondsPerRound in interface IPivoSdk
      • getSupportedSpeedsInSecondsPerRound

        public int[] getSupportedSpeedsInSecondsPerRound()
        Description copied from interface: IPivoSdk
        This function is used to get all supported speeds for application.
        Specified by:
        getSupportedSpeedsInSecondsPerRound in interface IPivoSdk
        Returns:
        returns an array of speeds(unit is seconds per round)
      • getSupportedSpeedsByRemoteInSecondsPerRound

        public int[] getSupportedSpeedsByRemoteInSecondsPerRound()
        Description copied from interface: IPivoSdk
        This function is used to get all supported speeds using remote controller.
        Specified by:
        getSupportedSpeedsByRemoteInSecondsPerRound in interface IPivoSdk
        Returns:
        returns array of speeds(unit is seconds per round).
      • disconnect

        public void disconnect()
        Description copied from interface: IPivoSdk
        This function is called to disconnect from the Pivo.
        Specified by:
        disconnect in interface IPivoSdk
      • turnLeft

        public void turnLeft​(int angle)
        Description copied from interface: IPivoSdk
        Turn Pivo to left at the current speed.
        Specified by:
        turnLeft in interface IPivoSdk
        Parameters:
        angle - is angle to rotate
      • turnRight

        public void turnRight​(int angle)
        Description copied from interface: IPivoSdk
        This function is used to turn Pivo to right.
        Specified by:
        turnRight in interface IPivoSdk
        Parameters:
        angle - is angle to rotate
      • turnRightContinuously

        public void turnRightContinuously()
        Description copied from interface: IPivoSdk
        This function is used to rotate continuously to right with the current speed.
        Specified by:
        turnRightContinuously in interface IPivoSdk
      • turnLeftContinuously

        public void turnLeftContinuously()
        Description copied from interface: IPivoSdk
        This function is used to rotate continuously to left with the current speed.
        Specified by:
        turnLeftContinuously in interface IPivoSdk
      • requestBatteryLevel

        public void requestBatteryLevel()
        Description copied from interface: IPivoSdk
        This function is used to request Pivo battery level.
        Specified by:
        requestBatteryLevel in interface IPivoSdk
      • stop

        public void stop()
        Description copied from interface: IPivoSdk
        This function is used to stop Pivo rotation
        Specified by:
        stop in interface IPivoSdk
      • changeName

        public void changeName​(String name)
        Description copied from interface: IPivoSdk
        This function is used to change Pivo name.
        Specified by:
        changeName in interface IPivoSdk
        Parameters:
        name - is desired name
      • isPivoConnected

        public boolean isPivoConnected()
        Description copied from interface: IPivoSdk
        This function is used to check connectivity of Pivo to the app.
        Specified by:
        isPivoConnected in interface IPivoSdk
        Returns:
        is boolean, if it's connected returns true, otherwise it returns false.
      • getPivoVersion

        public String getPivoVersion()
        Description copied from interface: IPivoSdk
        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.
        Specified by:
        getPivoVersion in interface IPivoSdk
        Returns:
        version of Pivo
      • getVersion

        public Version getVersion()
        Description copied from interface: IPivoSdk
        This method is used to get Pivo Version and type.
        Specified by:
        getVersion in interface IPivoSdk
        Returns:
        pivo version
      • enableBypass

        public void enableBypass​(boolean activate)
        Specified by:
        enableBypass in interface IPivoSdk
      • getSupportedTrackingModes

        public String[] getSupportedTrackingModes()
        Description copied from interface: IPivoSdk
        This function returns all supported tracking modes by Pivo
        Specified by:
        getSupportedTrackingModes in interface IPivoSdk
        Returns:
        an array of supported tracking methods.
      • startActionTracking

        public void startActionTracking​(FrameMetadata metadata,
                                        Rect region,
                                        Image image,
                                        PivoSensitivity sensitivity,
                                        ITrackingListener listener)
        Description copied from interface: IPivoSdk
        This function is used to start Action Tracking.
        Specified by:
        startActionTracking in interface IPivoSdk
        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

        public void startActionTracking​(FrameMetadata metadata,
                                        Rect region,
                                        byte[] image,
                                        PivoSensitivity sensitivity,
                                        ITrackingListener listener)
        Description copied from interface: IPivoSdk
        This function is used to start Action Tracking.
        Specified by:
        startActionTracking in interface IPivoSdk
        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 NV21 image byteArray.
        listener - is a callback of action tracking.
      • starPersonTracking

        public void starPersonTracking​(FrameMetadata metadata,
                                       Image image,
                                       PivoSensitivity sensitivity,
                                       ITrackingListener listener)
        Description copied from interface: IPivoSdk
        This function is used to start human tracking.
        Specified by:
        starPersonTracking in interface IPivoSdk
        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

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

        public void startHorseTracking​(FrameMetadata metadata,
                                       Image image,
                                       PivoSensitivity sensitivity,
                                       ITrackingListener listener)
        Description copied from interface: IPivoSdk
        This function is used to start horse tracking.
        Specified by:
        startHorseTracking in interface IPivoSdk
        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

        public void startHorseTracking​(FrameMetadata metadata,
                                       byte[] image,
                                       PivoSensitivity sensitivity,
                                       ITrackingListener listener)
        Description copied from interface: IPivoSdk
        This function is used to start horse tracking.
        Specified by:
        startHorseTracking in interface IPivoSdk
        Parameters:
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
        image - is NV21 byte array
        sensitivity - is enum set to control Pivo movement.
        listener - is a callback of horse tracking.
      • stopTracking

        public void stopTracking()
        Description copied from interface: IPivoSdk
        This function is used to stop tracking.
        Specified by:
        stopTracking in interface IPivoSdk
      • updateTrackingFrame

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

        public void updateTrackingFrame​(byte[] image,
                                        FrameMetadata metadata)
        Description copied from interface: IPivoSdk
        This function is used to update frames for processing. Please make sure calling startPersonTracking, startActionTracking, or startHorseTracking, and call updateTrackingFrame function.
        Specified by:
        updateTrackingFrame in interface IPivoSdk
        Parameters:
        image - is an NV21 image byte array.
        metadata - is a frame metadata which contains orientation, rotation, width, height, cameraFacing.