Package app.pivo.android.prosdk.util
Interface IPivoSdk
- All Known Implementing Classes:
PivoProSdk
public interface IPivoSdk
PivoSDK interface
-
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.voidgetMacAddress()This method is used to get mac address of the Pivo.StringgetPivoVersion()Deprecated.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.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[] byteArray, 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[] byteArray, 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[] byteArray, 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[] byteArray, 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
-
unlockWithLicenseKey
void unlockWithLicenseKey(String licenseContent) throws PackageNameException, LicenseDateException, LicenseNotProvidedException, InvalidLicenseException, SdkPlanTypeExceptionThis function is used to put license content. Please get license content and pass as parameter to this function without modifying it- 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
void scan()This function is used to scan for Pivo devices -
connectTo
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-
-
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
-
turnLeft
void turnLeft(int angle, int speed)This function is used to turn Pivo to left.- Parameters:
angle- is angle to rotatespeed- is specified speed
-
turnRight
void turnRight(int angle)This function is used to turn Pivo to right.- Parameters:
angle- is angle to rotate
-
turnRight
void turnRight(int angle, int speed)This function is used to turn Pivo to right.- Parameters:
angle- is angle to rotatespeed- is specified speed
-
turnRightContinuously
void turnRightContinuously()This function is used to rotate continuously to right with the current speed. -
turnRightContinuously
void turnRightContinuously(int speed)This function is used to rotate continuously to right with the specified speed.- Parameters:
speed- is Pivo speed
-
turnLeftContinuously
void turnLeftContinuously()This function is used to rotate continuously to left with the current speed. -
turnLeftContinuously
void turnLeftContinuously(int speed)This function is used to rotate continuously to left with the specified speed.- Parameters:
speed- is Pivo 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
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.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 arraysensitivity- is enum set to control Pivo movement.listener- is a callback of horse tracking.
-
updateTrackingFrame
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
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 PivoVersionand type.- Returns:
- pivo version
-
getMacAddress
void getMacAddress()This 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.
-