Package edu.tufts.hrilab.temi
Class MockTemiV3Component
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.temi.MockTemiV3Component
- All Implemented Interfaces:
TemiV3Interface
-
Field Summary
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>Command line options available in sub-class.voidbackupLocations(Symbol collectionName) voidLinked to Language "charge"
Behavior which is automatically enacted upon battery reaching a certain percent threshold.voidcheckInKiosk(Symbol location) voidreturns temi tablet to main screenvoidsignals videoDone lock allowingTemiV3Interface.playVideo(edu.tufts.hrilab.fol.Symbol)to end and clears the screenconvertPredToReadable(String predString) voiddeleteLocation(Symbol location) deletes location with label @locationvoiddeleteLocationBackup(Symbol collectionName) voidvoidvoidvoidvoidvoidvoidLinked to language "display" or "display message" Navigates to display fragment with supplied message, not blockingvoidzno displays alert signalling that new tasks cannot be submitted while zno is chargingvoidvoidvoidvoidvoidvoidvoidvoidvoidsets acknowledged to truevoidvoidvoidvoidUtility func for interrupting goToLocation in case we are currently repositioningvoidfollowMe()voidBlocking version of followMe (waits for acknowledgement)voidDuplicate function necessary for scoping between freeze and underlying paused action acknowledgementsintintintGets Temi's current x and y coordinates on the map.intintintGets the value stored in SharedPreferences with the key "escortWaitAttempts".longGets the value stored in SharedPreferences with the key "escortWaitDuration".for control appgetLocationNameFromReference(Symbol locRef) booleanHelper function to exit with correct failure predicate in case goToLocation fails due to repositioning errorsbooleanchecks that location is saved then goes to that location.booleanGoes to desired coordinates.booleanignoreTentativeAccept(Predicate goalPred) protected voidinit()Perform any component initialization.voidvoidvoidvoidbooleanbooleanknowsLocation(Symbol location) Checks whether the temi has stored the supplied location as a known location.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.voidplay video, blocking untilTemiV3Interface.closeVideo()is calledbooleanrelocalize(boolean sayText) voidvoidvoidrestoreLocations(Symbol collectionName) voidsaveLocation(Symbol location) Stores robots current locationvoidvoidsayTextDialogueHistory(String message) voidsayTextDialogueHistory(String message, boolean wait) voidvoidvoidvoidsetAppointmentListEmptyMessage(Symbol message) voidsetAppointmentLoadErrorMessage(Symbol message) voidsetBatteryAbortLevel(Symbol abortLevel) Sets the value stored in SharedPreferences with the key "chargeActionPercent".voidsetBatteryChargedLevel(Symbol chargedLevel) Sets the value stored in SharedPreferences with the key "chargeAbortPercent".voidsetBatteryWarnLevel(Symbol warnLevel) Sets the value stored in SharedPreferences with the key "chargeWarningPercent".voidsetBirthdayMessage(Symbol message) voidsetBirthdayMessageRange(Symbol range) voidsetCheckInHeaderMessage(Symbol message) voidvoidvoidsetEarlyAppointmentMessage(Symbol message) voidsetEscortWaitAttempts(int waitAttempts) voidsetEscortWaitAttempts(Symbol waitAttempts) Sets the value stored in SharedPreferences with the key "escortWaitAttempts".voidsetEscortWaitDuration(long waitDuration) voidsetEscortWaitDuration(Symbol waitDuration) Sets the value stored in SharedPreferences with the key "escortWaitDuration".voidsetHardButtons(boolean disabled) Disables/enables hardButtons on the temi.booleansetKioskLocation(Symbol location) voidsetKioskTimeout(Symbol timeout) voidsetLateAppointmentMessage(Symbol message) voidsetSayTextBlocks(boolean value) voidsetSuccessfulCheckInMessage(Symbol message) voidCalls setVolume from temi sdkvoidshow top bar on temi tabletprotected voidAny component that needs particular shutdown logic needs to override this method andbooleanskipsQueue(String funcName) voidstartAcknowledgeDisplay(String message) Blocks until acknowledged is set to truevoidstartQRCodeDisplay(String url, String header) voidStop moving.voidupdateFirebaseDoc(Map<String, Object> goalInfo) voidupdateHomeBase(boolean overwriteMap) voiduploadMap(boolean overwrite) Sends temi map data to firebasevoidwait for Temi to detect a personMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown
-
Constructor Details
-
MockTemiV3Component
public MockTemiV3Component()
-
-
Method Details
-
additionalUsageInfo
Description copied from class:DiarcComponentCommand line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponentCalled directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- Overrides:
parseArgsin classDiarcComponent
-
init
protected void init()Description copied from class:DiarcComponentPerform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
initin classDiarcComponent
-
getLocationReferenceFromName
-
getLocationNameFromReference
- Specified by:
getLocationNameFromReferencein interfaceTemiV3Interface
-
goToLoc
Description copied from interface:TemiV3Interfacechecks that location is saved then goes to that location.- Specified by:
goToLocin interfaceTemiV3Interface- Parameters:
location- label for location to go to
-
interruptGoToLocation
public void interruptGoToLocation()- Specified by:
interruptGoToLocationin interfaceTemiV3Interface
-
goToPos
Description copied from interface:TemiV3InterfaceGoes to desired coordinates.
Used when fetch script is enacted from an unknown starting location- Specified by:
goToPosin interfaceTemiV3Interface- Parameters:
goalCoords- coordinates to go to
-
followMe
public void followMe()- Specified by:
followMein interfaceTemiV3Interface
-
followMeBlocking
public void followMeBlocking()Description copied from interface:TemiV3InterfaceBlocking version of followMe (waits for acknowledgement)- Specified by:
followMeBlockingin interfaceTemiV3Interface
-
interruptFollowBlocking
public void interruptFollowBlocking()- Specified by:
interruptFollowBlockingin interfaceTemiV3Interface
-
stopMoving
public void stopMoving()Description copied from interface:TemiV3InterfaceStop moving. Has side effect of causing goToLocationStatus and ReposeStatus to be set to ABORT. We additionally unlock the goToLoc() condition to prevent deadlock upon temi primitives failing.- Specified by:
stopMovingin interfaceTemiV3Interface
-
saveLocation
Description copied from interface:TemiV3InterfaceStores robots current location- Specified by:
saveLocationin interfaceTemiV3Interface- Parameters:
location- label for current location
-
interruptSaveLocation
public void interruptSaveLocation()- Specified by:
interruptSaveLocationin interfaceTemiV3Interface
-
deleteLocation
Description copied from interface:TemiV3Interfacedeletes location with label @location- Specified by:
deleteLocationin interfaceTemiV3Interface- Parameters:
location- label for location to be deleted
-
knowsLocation
Description copied from interface:TemiV3InterfaceChecks whether the temi has stored the supplied location as a known location. Used to exit goToLocation script when appropriate with the correct failure predicate.- Specified by:
knowsLocationin interfaceTemiV3Interface- Parameters:
location- location name to check against temi's known location- Returns:
- true if there exists a matching location, false otherwise
-
getKnownLocationNames
Description copied from interface:TemiV3Interfacefor control app- Specified by:
getKnownLocationNamesin interfaceTemiV3Interface- Returns:
- list of temi's known location names
-
setEscortWaitDuration
Description copied from interface:TemiV3InterfaceSets the value stored in SharedPreferences with the key "escortWaitDuration". Used to determine the duration to wait for acknowledgement between requests within the escort script.- Specified by:
setEscortWaitDurationin interfaceTemiV3Interface
-
setEscortWaitDuration
public void setEscortWaitDuration(long waitDuration) -
setEscortWaitAttempts
Description copied from interface:TemiV3InterfaceSets the value stored in SharedPreferences with the key "escortWaitAttempts". Used to determine the number of times the temi calls out the patient name and waits for acknowledgement within the escort script.- Specified by:
setEscortWaitAttemptsin interfaceTemiV3Interface
-
setEscortWaitAttempts
public void setEscortWaitAttempts(int waitAttempts) -
getEscortWaitDuration
public long getEscortWaitDuration()Description copied from interface:TemiV3InterfaceGets the value stored in SharedPreferences with the key "escortWaitDuration". Used to determine the duration to wait for acknowledgement between requests within the escort script.- Specified by:
getEscortWaitDurationin interfaceTemiV3Interface
-
getEscortWaitAttempts
public int getEscortWaitAttempts()Description copied from interface:TemiV3InterfaceGets the value stored in SharedPreferences with the key "escortWaitAttempts". Used to determine the number of times the temi calls out the patient name and waits for acknowledgement within the escort script.- Specified by:
getEscortWaitAttemptsin interfaceTemiV3Interface
-
sayText
- Specified by:
sayTextin interfaceTemiV3Interface
-
sayTextDialogueHistory
- Specified by:
sayTextDialogueHistoryin interfaceTemiV3Interface
-
sayTextDialogueHistory
- Specified by:
sayTextDialogueHistoryin interfaceTemiV3Interface
-
startQRCodeDisplay
- Specified by:
startQRCodeDisplayin interfaceTemiV3Interface
-
endQRCodeDisplay
public void endQRCodeDisplay()- Specified by:
endQRCodeDisplayin interfaceTemiV3Interface
-
startAcknowledgeDisplay
Description copied from interface:TemiV3InterfaceBlocks until acknowledged is set to true- Specified by:
startAcknowledgeDisplayin interfaceTemiV3Interface
-
endAcknowledgeDisplay
public void endAcknowledgeDisplay()Description copied from interface:TemiV3Interfacesets acknowledged to true- Specified by:
endAcknowledgeDisplayin interfaceTemiV3Interface
-
setSayTextBlocks
public void setSayTextBlocks(boolean value) - Specified by:
setSayTextBlocksin interfaceTemiV3Interface
-
sendPositionUpdate
public void sendPositionUpdate()- Specified by:
sendPositionUpdatein interfaceTemiV3Interface
-
relocalize
public boolean relocalize(boolean sayText) - Specified by:
relocalizein interfaceTemiV3Interface
-
isLocalized
public boolean isLocalized()- Specified by:
isLocalizedin interfaceTemiV3Interface
-
checkInKiosk
- Specified by:
checkInKioskin interfaceTemiV3Interface
-
interruptCheckIn
public void interruptCheckIn()- Specified by:
interruptCheckInin interfaceTemiV3Interface
-
enableKioskMode
public void enableKioskMode()- Specified by:
enableKioskModein interfaceTemiV3Interface
-
disableKioskMode
public void disableKioskMode()- Specified by:
disableKioskModein interfaceTemiV3Interface
-
setKioskTimeout
- Specified by:
setKioskTimeoutin interfaceTemiV3Interface
-
setKioskLocation
- Specified by:
setKioskLocationin interfaceTemiV3Interface
-
setDisplayAppointmentsSince
- Specified by:
setDisplayAppointmentsSincein interfaceTemiV3Interface
-
getDisplayAppointmentsSince
public int getDisplayAppointmentsSince()- Specified by:
getDisplayAppointmentsSincein interfaceTemiV3Interface
-
setAllowAppointmentsSince
- Specified by:
setAllowAppointmentsSincein interfaceTemiV3Interface
-
getAllowAppointmentsSince
public int getAllowAppointmentsSince()- Specified by:
getAllowAppointmentsSincein interfaceTemiV3Interface
-
setLateAppointmentMessage
- Specified by:
setLateAppointmentMessagein interfaceTemiV3Interface
-
getLateAppointmentMessage
- Specified by:
getLateAppointmentMessagein interfaceTemiV3Interface
-
setDisplayAppointmentsUntil
- Specified by:
setDisplayAppointmentsUntilin interfaceTemiV3Interface
-
getDisplayAppointmentsUntil
public int getDisplayAppointmentsUntil()- Specified by:
getDisplayAppointmentsUntilin interfaceTemiV3Interface
-
setAllowAppointmentsUntil
- Specified by:
setAllowAppointmentsUntilin interfaceTemiV3Interface
-
getAllowAppointmentsUntil
public int getAllowAppointmentsUntil()- Specified by:
getAllowAppointmentsUntilin interfaceTemiV3Interface
-
setEarlyAppointmentMessage
- Specified by:
setEarlyAppointmentMessagein interfaceTemiV3Interface
-
getEarlyAppointmentMessage
- Specified by:
getEarlyAppointmentMessagein interfaceTemiV3Interface
-
setSuccessfulCheckInMessage
- Specified by:
setSuccessfulCheckInMessagein interfaceTemiV3Interface
-
getSuccessfulCheckInMessage
- Specified by:
getSuccessfulCheckInMessagein interfaceTemiV3Interface
-
setBirthdayMessageRange
- Specified by:
setBirthdayMessageRangein interfaceTemiV3Interface
-
getBirthdayMessageRange
public int getBirthdayMessageRange()- Specified by:
getBirthdayMessageRangein interfaceTemiV3Interface
-
setBirthdayMessage
- Specified by:
setBirthdayMessagein interfaceTemiV3Interface
-
getBirthdayMessage
- Specified by:
getBirthdayMessagein interfaceTemiV3Interface
-
setAppointmentLoadErrorMessage
- Specified by:
setAppointmentLoadErrorMessagein interfaceTemiV3Interface
-
getAppointmentLoadErrorMessage
- Specified by:
getAppointmentLoadErrorMessagein interfaceTemiV3Interface
-
setAppointmentListEmptyMessage
- Specified by:
setAppointmentListEmptyMessagein interfaceTemiV3Interface
-
getAppointmentListEmptyMessage
- Specified by:
getAppointmentListEmptyMessagein interfaceTemiV3Interface
-
setCheckInHeaderMessage
- Specified by:
setCheckInHeaderMessagein interfaceTemiV3Interface
-
getCheckInHeaderMessage
- Specified by:
getCheckInHeaderMessagein interfaceTemiV3Interface
-
displayFreezeScreen
public void displayFreezeScreen()- Specified by:
displayFreezeScreenin interfaceTemiV3Interface
-
endDisplayFreezeScreen
public void endDisplayFreezeScreen()- Specified by:
endDisplayFreezeScreenin interfaceTemiV3Interface
-
freezeTemi
public void freezeTemi()Description copied from interface:TemiV3InterfaceDuplicate function necessary for scoping between freeze and underlying paused action acknowledgements- Specified by:
freezeTemiin interfaceTemiV3Interface
-
endFreezeTemi
public void endFreezeTemi()- Specified by:
endFreezeTemiin interfaceTemiV3Interface
-
getCurrentPosition
Description copied from interface:TemiV3InterfaceGets Temi's current x and y coordinates on the map. Used in fetch script to store coordinates to return to when called from an unknown location.- Specified by:
getCurrentPositionin interfaceTemiV3Interface- Returns:
- Temi's x,y coordinates
-
endRepositionLoop
public void endRepositionLoop()Description copied from interface:TemiV3InterfaceUtility func for interrupting goToLocation in case we are currently repositioning- Specified by:
endRepositionLoopin interfaceTemiV3Interface
-
getRepositionFailure
public boolean getRepositionFailure()Description copied from interface:TemiV3InterfaceHelper function to exit with correct failure predicate in case goToLocation fails due to repositioning errors- Specified by:
getRepositionFailurein interfaceTemiV3Interface- Returns:
-
backupLocations
- Specified by:
backupLocationsin interfaceTemiV3Interface
-
restoreLocations
- Specified by:
restoreLocationsin interfaceTemiV3Interface
-
deleteLocationBackup
- Specified by:
deleteLocationBackupin interfaceTemiV3Interface
-
getLocationBackupCollections
- Specified by:
getLocationBackupCollectionsin interfaceTemiV3Interface
-
waitForDetection
public void waitForDetection()Description copied from interface:TemiV3Interfacewait for Temi to detect a person- Specified by:
waitForDetectionin interfaceTemiV3Interface
-
playVideo
Description copied from interface:TemiV3Interfaceplay video, blocking untilTemiV3Interface.closeVideo()is called- Specified by:
playVideoin interfaceTemiV3Interface
-
closeVideo
public void closeVideo()Description copied from interface:TemiV3Interfacesignals videoDone lock allowingTemiV3Interface.playVideo(edu.tufts.hrilab.fol.Symbol)to end and clears the screen- Specified by:
closeVideoin interfaceTemiV3Interface
-
display
Description copied from interface:TemiV3InterfaceLinked to language "display" or "display message" Navigates to display fragment with supplied message, not blocking- Specified by:
displayin interfaceTemiV3Interface- Parameters:
message- message to display on screen
-
clearScreen
public void clearScreen()Description copied from interface:TemiV3Interfacereturns temi tablet to main screen- Specified by:
clearScreenin interfaceTemiV3Interface
-
showTopBar
public void showTopBar()Description copied from interface:TemiV3Interfaceshow top bar on temi tablet- Specified by:
showTopBarin interfaceTemiV3Interface
-
uploadMap
public void uploadMap(boolean overwrite) Description copied from interface:TemiV3InterfaceSends temi map data to firebase- Specified by:
uploadMapin interfaceTemiV3Interface
-
updateHomeBase
public void updateHomeBase(boolean overwriteMap) - Specified by:
updateHomeBasein interfaceTemiV3Interface
-
chargeTemi
public void chargeTemi()Description copied from interface:TemiV3InterfaceLinked to Language "charge"
Behavior which is automatically enacted upon battery reaching a certain percent threshold. Informs the user that the charge behavior is being enacted, then proceeds to navigate to home base and wait either for acknowledgement or to reach back up to a certain battery level. The associated language command "charge" will also cause dialogue to clear the current goal queue, ensuring this task is either immediately executed or first on the queue.- Specified by:
chargeTemiin interfaceTemiV3Interface
-
displayChargingAlert
public void displayChargingAlert()Description copied from interface:TemiV3Interfacezno displays alert signalling that new tasks cannot be submitted while zno is charging- Specified by:
displayChargingAlertin interfaceTemiV3Interface
-
setBatteryWarnLevel
Description copied from interface:TemiV3InterfaceSets the value stored in SharedPreferences with the key "chargeWarningPercent". Used to determine battery level upon which to perform a warning sayText to indicate the temi will clear tasks to charge soon- Specified by:
setBatteryWarnLevelin interfaceTemiV3Interface
-
setBatteryAbortLevel
Description copied from interface:TemiV3InterfaceSets the value stored in SharedPreferences with the key "chargeActionPercent". Used to determine battery level upon which the temi enacts its charge behavior- Specified by:
setBatteryAbortLevelin interfaceTemiV3Interface
-
setBatteryChargedLevel
Description copied from interface:TemiV3InterfaceSets the value stored in SharedPreferences with the key "chargeAbortPercent". Used to determine battery level upon which the temi enacts its charge behavior- Specified by:
setBatteryChargedLevelin interfaceTemiV3Interface
-
setVolume
Description copied from interface:TemiV3InterfaceCalls setVolume from temi sdk- Specified by:
setVolumein interfaceTemiV3Interface- Parameters:
volume- value to set volume to
-
setHardButtons
public void setHardButtons(boolean disabled) Description copied from interface:TemiV3InterfaceDisables/enables hardButtons on the temi. Currently only acts on the volume buttons and the main top bar, does not affect the power button- Specified by:
setHardButtonsin interfaceTemiV3Interface- Parameters:
disabled- true to disable the hardButtons, false to enable them
-
enablePrivacyMode
public void enablePrivacyMode()- Specified by:
enablePrivacyModein interfaceTemiV3Interface
-
disablePrivacyMode
public void disablePrivacyMode()- Specified by:
disablePrivacyModein interfaceTemiV3Interface
-
requestPermissions
public void requestPermissions()- Specified by:
requestPermissionsin interfaceTemiV3Interface
-
restartApp
public void restartApp()- Specified by:
restartAppin interfaceTemiV3Interface
-
enableVoiceAck
public void enableVoiceAck()- Specified by:
enableVoiceAckin interfaceTemiV3Interface
-
disableVoiceAck
public void disableVoiceAck()- Specified by:
disableVoiceAckin interfaceTemiV3Interface
-
enableButtons
public void enableButtons()- Specified by:
enableButtonsin interfaceTemiV3Interface
-
disableButtons
public void disableButtons()- Specified by:
disableButtonsin interfaceTemiV3Interface
-
enableObstacleNotifications
public void enableObstacleNotifications()- Specified by:
enableObstacleNotificationsin interfaceTemiV3Interface
-
disableObstacleNotifications
public void disableObstacleNotifications()- Specified by:
disableObstacleNotificationsin interfaceTemiV3Interface
-
enableKidsMode
public void enableKidsMode()- Specified by:
enableKidsModein interfaceTemiV3Interface
-
disableKidsMode
public void disableKidsMode()- Specified by:
disableKidsModein interfaceTemiV3Interface
-
displayFace
public void displayFace()- Specified by:
displayFacein interfaceTemiV3Interface
-
convertPredToReadable
- Specified by:
convertPredToReadablein interfaceTemiV3Interface
-
updateFirebaseDoc
-
ignoreTentativeAccept
- Specified by:
ignoreTentativeAcceptin interfaceTemiV3Interface
-
skipsQueue
- Specified by:
skipsQueuein interfaceTemiV3Interface
-
shutdownComponent
protected void shutdownComponent()Description copied from class:DiarcComponentAny component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponentin classDiarcComponent
-