Package app.pivo.android.prosdk
Class PivoProSdk
java.lang.Object
app.pivo.android.prosdk.PivoProSdk
- All Implemented Interfaces:
IPivoSdk
public class PivoProSdk extends Object implements IPivoSdk
-
Method Summary
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.static PivoProSdkgetInstance()voidgetMacAddress()This method is used to get mac address of the Pivo.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.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.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.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 Details
-
getInstance
-
init
-
unlockWithLicenseKey
public void unlockWithLicenseKey(String licenseContent) throws PackageNameException, LicenseDateException, LicenseNotProvidedException, InvalidLicenseException, SdkPlanTypeExceptionDescription 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
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
-
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)Description copied from interface:IPivoSdkThis function is used to turn Pivo to left. -
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)Description copied from interface:IPivoSdkThis function is used to turn Pivo to right. -
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)Description 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
-
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)Description 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
-
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
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
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
Description copied from interface:IPivoSdkThis method is used to get PivoVersionand type.- Specified by:
getVersionin interfaceIPivoSdk- Returns:
- pivo version
-
getMacAddress
public void getMacAddress()Description copied from interface:IPivoSdkThis method is used to get mac address of the Pivo. It returns bluetooth mac address of the Pivo device if the Pivo version is above 5 or equal.- Specified by:
getMacAddressin interfaceIPivoSdk
-
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
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
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.
-