Package app.pivo.android.prosdk
Class PivoProSdk
- java.lang.Object
-
- app.pivo.android.prosdk.PivoProSdk
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeName(String name)This function is used to change Pivo name.voidconnectTo(PivoDevice pivoDevice)This function is used to connect to the device.voiddisconnect()This function is called to disconnect from the Pivo.voidenableBypass(boolean activate)PivoDeviceInfogetDeviceInfo()Returns device infoPivoDeviceInfostatic PivoProSdkgetInstance()StringgetPivoVersion()This method is deprecated starting from version 1.0.1-beta.int[]getSupportedSpeedsByRemoteInSecondsPerRound()This function is used to get all supported speeds using remote controller.int[]getSupportedSpeedsInSecondsPerRound()This function is used to get all supported speeds for application.String[]getSupportedTrackingModes()This function returns all supported tracking modes by PivoVersiongetVersion()This method is used to get PivoVersionand type.static voidinit(Context context)booleanisPivoConnected()This function is used to check connectivity of Pivo to the app.voidrequestBatteryLevel()This function is used to request Pivo battery level.voidscan()This function is used to scan for Pivo devicesvoidsetSpeedBySecondsPerRound(int speedInSecondsPerRound)This function is used to set default speed with seconds per round for Pivo.voidsetSpeedBySecondsPerRoundRemote(int speedInSecondsPerRound)voidstarPersonTracking(FrameMetadata metadata, byte[] image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start human tracking.voidstarPersonTracking(FrameMetadata metadata, Image image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start human tracking.voidstartActionTracking(FrameMetadata metadata, Rect region, byte[] image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start Action Tracking.voidstartActionTracking(FrameMetadata metadata, Rect region, Image image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start Action Tracking.voidstartHorseTracking(FrameMetadata metadata, byte[] image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start horse tracking.voidstartHorseTracking(FrameMetadata metadata, Image image, PivoSensitivity sensitivity, ITrackingListener listener)This function is used to start horse tracking.voidstop()This function is used to stop Pivo rotationvoidstopScan()Call this function to stop scanning.voidstopTracking()This function is used to stop tracking.voidturnLeft(int angle)Turn Pivo to left at the current speed.voidturnLeft(int angle, int speed)This function is used to turn Pivo to left.voidturnLeftContinuously()This function is used to rotate continuously to left with the current speed.voidturnLeftContinuously(int speed)This function is used to rotate continuously to left with the specified speed.voidturnLeftRemote(int angle, int speed)voidturnRight(int angle)This function is used to turn Pivo to right.voidturnRight(int angle, int speed)This function is used to turn Pivo to right.voidturnRightContinuously()This function is used to rotate continuously to right with the current speed.voidturnRightContinuously(int speed)This function is used to rotate continuously to right with the specified speed.voidturnRightRemote(int angle, int speed)voidunlockWithLicenseKey(String licenseContent)This function is used to put license content.voidupdateTrackingFrame(byte[] image, FrameMetadata metadata)This function is used to update frames for processing.voidupdateTrackingFrame(Image image, FrameMetadata metadata)This function is used to update frames for processing.
-
-
-
Method Detail
-
getInstance
public static PivoProSdk getInstance()
-
init
public static void init(Context context)
-
unlockWithLicenseKey
public void unlockWithLicenseKey(String licenseContent) throws PackageNameException, LicenseDateException, LicenseNotProvidedException, InvalidLicenseException, SdkPlanTypeException
Description copied from interface:IPivoSdkThis function is used to put license content. Please get license content and pass as parameter to this function without modifying it- Specified by:
unlockWithLicenseKeyin interfaceIPivoSdk- Parameters:
licenseContent- - license file- Throws:
PackageNameException- this exception is thrown if the license is expiredLicenseDateException- this exception is thrown if the package name in the package name of the application and license files are differentLicenseNotProvidedExceptionInvalidLicenseExceptionSdkPlanTypeException
-
scan
public void scan()
Description copied from interface:IPivoSdkThis function is used to scan for Pivo devices
-
connectTo
public void connectTo(PivoDevice pivoDevice)
Description copied from interface:IPivoSdkThis function is used to connect to the device.
-
stopScan
public void stopScan()
Description copied from interface:IPivoSdkCall this function to stop scanning.
-
setSpeedBySecondsPerRound
public void setSpeedBySecondsPerRound(int speedInSecondsPerRound)
Description copied from interface:IPivoSdkThis 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:
setSpeedBySecondsPerRoundin interfaceIPivoSdk
-
setSpeedBySecondsPerRoundRemote
public void setSpeedBySecondsPerRoundRemote(int speedInSecondsPerRound)
- Specified by:
setSpeedBySecondsPerRoundRemotein interfaceIPivoSdk
-
getSupportedSpeedsInSecondsPerRound
public int[] getSupportedSpeedsInSecondsPerRound()
Description copied from interface:IPivoSdkThis function is used to get all supported speeds for application.- Specified by:
getSupportedSpeedsInSecondsPerRoundin interfaceIPivoSdk- Returns:
- returns an array of speeds(unit is seconds per round)
-
getSupportedSpeedsByRemoteInSecondsPerRound
public int[] getSupportedSpeedsByRemoteInSecondsPerRound()
Description copied from interface:IPivoSdkThis function is used to get all supported speeds using remote controller.- Specified by:
getSupportedSpeedsByRemoteInSecondsPerRoundin interfaceIPivoSdk- Returns:
- returns array of speeds(unit is seconds per round).
-
disconnect
public void disconnect()
Description copied from interface:IPivoSdkThis function is called to disconnect from the Pivo.- Specified by:
disconnectin interfaceIPivoSdk
-
turnLeft
public void turnLeft(int angle)
Description copied from interface:IPivoSdkTurn Pivo to left at the current speed.
-
turnLeft
public void turnLeft(int angle, int speed) throws UnsupportedSpeedExceptionDescription copied from interface:IPivoSdkThis function is used to turn Pivo to left.- Specified by:
turnLeftin interfaceIPivoSdk- Parameters:
angle- is angle to rotatespeed- is specified speed- Throws:
UnsupportedSpeedException
-
turnRight
public void turnRight(int angle)
Description copied from interface:IPivoSdkThis function is used to turn Pivo to right.
-
turnRight
public void turnRight(int angle, int speed) throws UnsupportedSpeedExceptionDescription copied from interface:IPivoSdkThis function is used to turn Pivo to right.- Specified by:
turnRightin interfaceIPivoSdk- Parameters:
angle- is angle to rotatespeed- is specified speed- Throws:
UnsupportedSpeedException
-
turnLeftRemote
public void turnLeftRemote(int angle, int speed) throws UnsupportedSpeedException- Specified by:
turnLeftRemotein interfaceIPivoSdk- Throws:
UnsupportedSpeedException
-
turnRightRemote
public void turnRightRemote(int angle, int speed) throws UnsupportedSpeedException- Specified by:
turnRightRemotein interfaceIPivoSdk- Throws:
UnsupportedSpeedException
-
turnRightContinuously
public void turnRightContinuously()
Description copied from interface:IPivoSdkThis function is used to rotate continuously to right with the current speed.- Specified by:
turnRightContinuouslyin interfaceIPivoSdk
-
turnRightContinuously
public void turnRightContinuously(int speed) throws UnsupportedSpeedExceptionDescription copied from interface:IPivoSdkThis function is used to rotate continuously to right with the specified speed.- Specified by:
turnRightContinuouslyin interfaceIPivoSdk- Parameters:
speed- is Pivo speed- Throws:
UnsupportedSpeedException
-
turnLeftContinuously
public void turnLeftContinuously()
Description copied from interface:IPivoSdkThis function is used to rotate continuously to left with the current speed.- Specified by:
turnLeftContinuouslyin interfaceIPivoSdk
-
turnLeftContinuously
public void turnLeftContinuously(int speed) throws UnsupportedSpeedExceptionDescription copied from interface:IPivoSdkThis function is used to rotate continuously to left with the specified speed.- Specified by:
turnLeftContinuouslyin interfaceIPivoSdk- Parameters:
speed- is Pivo speed- Throws:
UnsupportedSpeedException
-
requestBatteryLevel
public void requestBatteryLevel()
Description copied from interface:IPivoSdkThis function is used to request Pivo battery level.- Specified by:
requestBatteryLevelin interfaceIPivoSdk
-
stop
public void stop()
Description copied from interface:IPivoSdkThis function is used to stop Pivo rotation
-
changeName
public void changeName(String name)
Description copied from interface:IPivoSdkThis function is used to change Pivo name.- Specified by:
changeNamein interfaceIPivoSdk- Parameters:
name- is desired name
-
isPivoConnected
public boolean isPivoConnected()
Description copied from interface:IPivoSdkThis function is used to check connectivity of Pivo to the app.- Specified by:
isPivoConnectedin interfaceIPivoSdk- Returns:
- is boolean, if it's connected returns true, otherwise it returns false.
-
getPivoVersion
public String getPivoVersion()
Description copied from interface:IPivoSdkThis 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:
getPivoVersionin interfaceIPivoSdk- Returns:
- version of Pivo
-
getVersion
public Version getVersion()
Description copied from interface:IPivoSdkThis method is used to get PivoVersionand type.- Specified by:
getVersionin interfaceIPivoSdk- Returns:
- pivo version
-
getDeviceInfo
public PivoDeviceInfo getDeviceInfo()
Description copied from interface:IPivoSdkReturns device infoPivoDeviceInfo- Specified by:
getDeviceInfoin interfaceIPivoSdk- Returns:
- device info
-
enableBypass
public void enableBypass(boolean activate)
- Specified by:
enableBypassin interfaceIPivoSdk
-
getSupportedTrackingModes
public String[] getSupportedTrackingModes()
Description copied from interface:IPivoSdkThis function returns all supported tracking modes by Pivo- Specified by:
getSupportedTrackingModesin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start Action Tracking.- Specified by:
startActionTrackingin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start Action Tracking.- Specified by:
startActionTrackingin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start human tracking.- Specified by:
starPersonTrackingin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start human tracking.- Specified by:
starPersonTrackingin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start horse tracking.- Specified by:
startHorseTrackingin interfaceIPivoSdk- 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:IPivoSdkThis function is used to start horse tracking.- Specified by:
startHorseTrackingin interfaceIPivoSdk- Parameters:
metadata- is a frame metadata which contains orientation, rotation, width, height, cameraFacing.image- is NV21 byte arraysensitivity- is enum set to control Pivo movement.listener- is a callback of horse tracking.
-
stopTracking
public void stopTracking()
Description copied from interface:IPivoSdkThis function is used to stop tracking.- Specified by:
stopTrackingin interfaceIPivoSdk
-
updateTrackingFrame
public void updateTrackingFrame(Image image, FrameMetadata metadata)
Description copied from interface:IPivoSdkThis function is used to update frames for processing. Please make sure calling startPersonTracking, startActionTracking, or startHorseTracking, and call updateTrackingFrame function.- Specified by:
updateTrackingFramein interfaceIPivoSdk- 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:IPivoSdkThis function is used to update frames for processing. Please make sure calling startPersonTracking, startActionTracking, or startHorseTracking, and call updateTrackingFrame function.- Specified by:
updateTrackingFramein interfaceIPivoSdk- Parameters:
image- is an NV21 image byte array.metadata- is a frame metadata which contains orientation, rotation, width, height, cameraFacing.
-
-