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.void
backupLocations
(Symbol collectionName) void
Linked to Language "charge"
Behavior which is automatically enacted upon battery reaching a certain percent threshold.void
checkInKiosk
(Symbol location) void
returns temi tablet to main screenvoid
signals videoDone lock allowingTemiV3Interface.playVideo(edu.tufts.hrilab.fol.Symbol)
to end and clears the screenconvertPredToReadable
(String predString) void
deleteLocation
(Symbol location) deletes location with label @locationvoid
deleteLocationBackup
(Symbol collectionName) void
void
void
void
void
void
void
Linked to language "display" or "display message" Navigates to display fragment with supplied message, not blockingvoid
zno displays alert signalling that new tasks cannot be submitted while zno is chargingvoid
void
void
void
void
void
void
void
void
sets acknowledged to truevoid
void
void
void
Utility func for interrupting goToLocation in case we are currently repositioningvoid
followMe()
void
Blocking version of followMe (waits for acknowledgement)void
Duplicate function necessary for scoping between freeze and underlying paused action acknowledgementsint
int
int
Gets Temi's current x and y coordinates on the map.int
int
int
Gets the value stored in SharedPreferences with the key "escortWaitAttempts".long
Gets the value stored in SharedPreferences with the key "escortWaitDuration".for control appgetLocationNameFromReference
(Symbol locRef) boolean
Helper function to exit with correct failure predicate in case goToLocation fails due to repositioning errorsboolean
checks that location is saved then goes to that location.boolean
Goes to desired coordinates.boolean
ignoreTentativeAccept
(Predicate goalPred) protected void
init()
Perform any component initialization.void
void
void
void
boolean
boolean
knowsLocation
(Symbol location) Checks whether the temi has stored the supplied location as a known location.protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.void
play video, blocking untilTemiV3Interface.closeVideo()
is calledboolean
relocalize
(boolean sayText) void
void
void
restoreLocations
(Symbol collectionName) void
saveLocation
(Symbol location) Stores robots current locationvoid
void
sayTextDialogueHistory
(String message) void
sayTextDialogueHistory
(String message, boolean wait) void
void
void
void
setAppointmentListEmptyMessage
(Symbol message) void
setAppointmentLoadErrorMessage
(Symbol message) void
setBatteryAbortLevel
(Symbol abortLevel) Sets the value stored in SharedPreferences with the key "chargeActionPercent".void
setBatteryChargedLevel
(Symbol chargedLevel) Sets the value stored in SharedPreferences with the key "chargeAbortPercent".void
setBatteryWarnLevel
(Symbol warnLevel) Sets the value stored in SharedPreferences with the key "chargeWarningPercent".void
setBirthdayMessage
(Symbol message) void
setBirthdayMessageRange
(Symbol range) void
setCheckInHeaderMessage
(Symbol message) void
void
void
setEarlyAppointmentMessage
(Symbol message) void
setEscortWaitAttempts
(int waitAttempts) void
setEscortWaitAttempts
(Symbol waitAttempts) Sets the value stored in SharedPreferences with the key "escortWaitAttempts".void
setEscortWaitDuration
(long waitDuration) void
setEscortWaitDuration
(Symbol waitDuration) Sets the value stored in SharedPreferences with the key "escortWaitDuration".void
setHardButtons
(boolean disabled) Disables/enables hardButtons on the temi.boolean
setKioskLocation
(Symbol location) void
setKioskTimeout
(Symbol timeout) void
setLateAppointmentMessage
(Symbol message) void
setSayTextBlocks
(boolean value) void
setSuccessfulCheckInMessage
(Symbol message) void
Calls setVolume from temi sdkvoid
show top bar on temi tabletprotected void
Any component that needs particular shutdown logic needs to override this method andboolean
skipsQueue
(String funcName) void
startAcknowledgeDisplay
(String message) Blocks until acknowledged is set to truevoid
startQRCodeDisplay
(String url, String header) void
Stop moving.void
updateFirebaseDoc
(Map<String, Object> goalInfo) void
updateHomeBase
(boolean overwriteMap) void
uploadMap
(boolean overwrite) Sends temi map data to firebasevoid
wait 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:DiarcComponent
Command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponent
Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- Overrides:
parseArgs
in classDiarcComponent
-
init
protected void init()Description copied from class:DiarcComponent
Perform 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:
init
in classDiarcComponent
-
getLocationReferenceFromName
-
getLocationNameFromReference
- Specified by:
getLocationNameFromReference
in interfaceTemiV3Interface
-
goToLoc
Description copied from interface:TemiV3Interface
checks that location is saved then goes to that location.- Specified by:
goToLoc
in interfaceTemiV3Interface
- Parameters:
location
- label for location to go to
-
interruptGoToLocation
public void interruptGoToLocation()- Specified by:
interruptGoToLocation
in interfaceTemiV3Interface
-
goToPos
Description copied from interface:TemiV3Interface
Goes to desired coordinates.
Used when fetch script is enacted from an unknown starting location- Specified by:
goToPos
in interfaceTemiV3Interface
- Parameters:
goalCoords
- coordinates to go to
-
followMe
public void followMe()- Specified by:
followMe
in interfaceTemiV3Interface
-
followMeBlocking
public void followMeBlocking()Description copied from interface:TemiV3Interface
Blocking version of followMe (waits for acknowledgement)- Specified by:
followMeBlocking
in interfaceTemiV3Interface
-
interruptFollowBlocking
public void interruptFollowBlocking()- Specified by:
interruptFollowBlocking
in interfaceTemiV3Interface
-
stopMoving
public void stopMoving()Description copied from interface:TemiV3Interface
Stop 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:
stopMoving
in interfaceTemiV3Interface
-
saveLocation
Description copied from interface:TemiV3Interface
Stores robots current location- Specified by:
saveLocation
in interfaceTemiV3Interface
- Parameters:
location
- label for current location
-
interruptSaveLocation
public void interruptSaveLocation()- Specified by:
interruptSaveLocation
in interfaceTemiV3Interface
-
deleteLocation
Description copied from interface:TemiV3Interface
deletes location with label @location- Specified by:
deleteLocation
in interfaceTemiV3Interface
- Parameters:
location
- label for location to be deleted
-
knowsLocation
Description copied from interface:TemiV3Interface
Checks 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:
knowsLocation
in 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:TemiV3Interface
for control app- Specified by:
getKnownLocationNames
in interfaceTemiV3Interface
- Returns:
- list of temi's known location names
-
setEscortWaitDuration
Description copied from interface:TemiV3Interface
Sets 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:
setEscortWaitDuration
in interfaceTemiV3Interface
-
setEscortWaitDuration
public void setEscortWaitDuration(long waitDuration) -
setEscortWaitAttempts
Description copied from interface:TemiV3Interface
Sets 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:
setEscortWaitAttempts
in interfaceTemiV3Interface
-
setEscortWaitAttempts
public void setEscortWaitAttempts(int waitAttempts) -
getEscortWaitDuration
public long getEscortWaitDuration()Description copied from interface:TemiV3Interface
Gets 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:
getEscortWaitDuration
in interfaceTemiV3Interface
-
getEscortWaitAttempts
public int getEscortWaitAttempts()Description copied from interface:TemiV3Interface
Gets 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:
getEscortWaitAttempts
in interfaceTemiV3Interface
-
sayText
- Specified by:
sayText
in interfaceTemiV3Interface
-
sayTextDialogueHistory
- Specified by:
sayTextDialogueHistory
in interfaceTemiV3Interface
-
sayTextDialogueHistory
- Specified by:
sayTextDialogueHistory
in interfaceTemiV3Interface
-
startQRCodeDisplay
- Specified by:
startQRCodeDisplay
in interfaceTemiV3Interface
-
endQRCodeDisplay
public void endQRCodeDisplay()- Specified by:
endQRCodeDisplay
in interfaceTemiV3Interface
-
startAcknowledgeDisplay
Description copied from interface:TemiV3Interface
Blocks until acknowledged is set to true- Specified by:
startAcknowledgeDisplay
in interfaceTemiV3Interface
-
endAcknowledgeDisplay
public void endAcknowledgeDisplay()Description copied from interface:TemiV3Interface
sets acknowledged to true- Specified by:
endAcknowledgeDisplay
in interfaceTemiV3Interface
-
setSayTextBlocks
public void setSayTextBlocks(boolean value) - Specified by:
setSayTextBlocks
in interfaceTemiV3Interface
-
sendPositionUpdate
public void sendPositionUpdate()- Specified by:
sendPositionUpdate
in interfaceTemiV3Interface
-
relocalize
public boolean relocalize(boolean sayText) - Specified by:
relocalize
in interfaceTemiV3Interface
-
isLocalized
public boolean isLocalized()- Specified by:
isLocalized
in interfaceTemiV3Interface
-
checkInKiosk
- Specified by:
checkInKiosk
in interfaceTemiV3Interface
-
interruptCheckIn
public void interruptCheckIn()- Specified by:
interruptCheckIn
in interfaceTemiV3Interface
-
enableKioskMode
public void enableKioskMode()- Specified by:
enableKioskMode
in interfaceTemiV3Interface
-
disableKioskMode
public void disableKioskMode()- Specified by:
disableKioskMode
in interfaceTemiV3Interface
-
setKioskTimeout
- Specified by:
setKioskTimeout
in interfaceTemiV3Interface
-
setKioskLocation
- Specified by:
setKioskLocation
in interfaceTemiV3Interface
-
setDisplayAppointmentsSince
- Specified by:
setDisplayAppointmentsSince
in interfaceTemiV3Interface
-
getDisplayAppointmentsSince
public int getDisplayAppointmentsSince()- Specified by:
getDisplayAppointmentsSince
in interfaceTemiV3Interface
-
setAllowAppointmentsSince
- Specified by:
setAllowAppointmentsSince
in interfaceTemiV3Interface
-
getAllowAppointmentsSince
public int getAllowAppointmentsSince()- Specified by:
getAllowAppointmentsSince
in interfaceTemiV3Interface
-
setLateAppointmentMessage
- Specified by:
setLateAppointmentMessage
in interfaceTemiV3Interface
-
getLateAppointmentMessage
- Specified by:
getLateAppointmentMessage
in interfaceTemiV3Interface
-
setDisplayAppointmentsUntil
- Specified by:
setDisplayAppointmentsUntil
in interfaceTemiV3Interface
-
getDisplayAppointmentsUntil
public int getDisplayAppointmentsUntil()- Specified by:
getDisplayAppointmentsUntil
in interfaceTemiV3Interface
-
setAllowAppointmentsUntil
- Specified by:
setAllowAppointmentsUntil
in interfaceTemiV3Interface
-
getAllowAppointmentsUntil
public int getAllowAppointmentsUntil()- Specified by:
getAllowAppointmentsUntil
in interfaceTemiV3Interface
-
setEarlyAppointmentMessage
- Specified by:
setEarlyAppointmentMessage
in interfaceTemiV3Interface
-
getEarlyAppointmentMessage
- Specified by:
getEarlyAppointmentMessage
in interfaceTemiV3Interface
-
setSuccessfulCheckInMessage
- Specified by:
setSuccessfulCheckInMessage
in interfaceTemiV3Interface
-
getSuccessfulCheckInMessage
- Specified by:
getSuccessfulCheckInMessage
in interfaceTemiV3Interface
-
setBirthdayMessageRange
- Specified by:
setBirthdayMessageRange
in interfaceTemiV3Interface
-
getBirthdayMessageRange
public int getBirthdayMessageRange()- Specified by:
getBirthdayMessageRange
in interfaceTemiV3Interface
-
setBirthdayMessage
- Specified by:
setBirthdayMessage
in interfaceTemiV3Interface
-
getBirthdayMessage
- Specified by:
getBirthdayMessage
in interfaceTemiV3Interface
-
setAppointmentLoadErrorMessage
- Specified by:
setAppointmentLoadErrorMessage
in interfaceTemiV3Interface
-
getAppointmentLoadErrorMessage
- Specified by:
getAppointmentLoadErrorMessage
in interfaceTemiV3Interface
-
setAppointmentListEmptyMessage
- Specified by:
setAppointmentListEmptyMessage
in interfaceTemiV3Interface
-
getAppointmentListEmptyMessage
- Specified by:
getAppointmentListEmptyMessage
in interfaceTemiV3Interface
-
setCheckInHeaderMessage
- Specified by:
setCheckInHeaderMessage
in interfaceTemiV3Interface
-
getCheckInHeaderMessage
- Specified by:
getCheckInHeaderMessage
in interfaceTemiV3Interface
-
displayFreezeScreen
public void displayFreezeScreen()- Specified by:
displayFreezeScreen
in interfaceTemiV3Interface
-
endDisplayFreezeScreen
public void endDisplayFreezeScreen()- Specified by:
endDisplayFreezeScreen
in interfaceTemiV3Interface
-
freezeTemi
public void freezeTemi()Description copied from interface:TemiV3Interface
Duplicate function necessary for scoping between freeze and underlying paused action acknowledgements- Specified by:
freezeTemi
in interfaceTemiV3Interface
-
endFreezeTemi
public void endFreezeTemi()- Specified by:
endFreezeTemi
in interfaceTemiV3Interface
-
getCurrentPosition
Description copied from interface:TemiV3Interface
Gets 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:
getCurrentPosition
in interfaceTemiV3Interface
- Returns:
- Temi's x,y coordinates
-
endRepositionLoop
public void endRepositionLoop()Description copied from interface:TemiV3Interface
Utility func for interrupting goToLocation in case we are currently repositioning- Specified by:
endRepositionLoop
in interfaceTemiV3Interface
-
getRepositionFailure
public boolean getRepositionFailure()Description copied from interface:TemiV3Interface
Helper function to exit with correct failure predicate in case goToLocation fails due to repositioning errors- Specified by:
getRepositionFailure
in interfaceTemiV3Interface
- Returns:
-
backupLocations
- Specified by:
backupLocations
in interfaceTemiV3Interface
-
restoreLocations
- Specified by:
restoreLocations
in interfaceTemiV3Interface
-
deleteLocationBackup
- Specified by:
deleteLocationBackup
in interfaceTemiV3Interface
-
getLocationBackupCollections
- Specified by:
getLocationBackupCollections
in interfaceTemiV3Interface
-
waitForDetection
public void waitForDetection()Description copied from interface:TemiV3Interface
wait for Temi to detect a person- Specified by:
waitForDetection
in interfaceTemiV3Interface
-
playVideo
Description copied from interface:TemiV3Interface
play video, blocking untilTemiV3Interface.closeVideo()
is called- Specified by:
playVideo
in interfaceTemiV3Interface
-
closeVideo
public void closeVideo()Description copied from interface:TemiV3Interface
signals videoDone lock allowingTemiV3Interface.playVideo(edu.tufts.hrilab.fol.Symbol)
to end and clears the screen- Specified by:
closeVideo
in interfaceTemiV3Interface
-
display
Description copied from interface:TemiV3Interface
Linked to language "display" or "display message" Navigates to display fragment with supplied message, not blocking- Specified by:
display
in interfaceTemiV3Interface
- Parameters:
message
- message to display on screen
-
clearScreen
public void clearScreen()Description copied from interface:TemiV3Interface
returns temi tablet to main screen- Specified by:
clearScreen
in interfaceTemiV3Interface
-
showTopBar
public void showTopBar()Description copied from interface:TemiV3Interface
show top bar on temi tablet- Specified by:
showTopBar
in interfaceTemiV3Interface
-
uploadMap
public void uploadMap(boolean overwrite) Description copied from interface:TemiV3Interface
Sends temi map data to firebase- Specified by:
uploadMap
in interfaceTemiV3Interface
-
updateHomeBase
public void updateHomeBase(boolean overwriteMap) - Specified by:
updateHomeBase
in interfaceTemiV3Interface
-
chargeTemi
public void chargeTemi()Description copied from interface:TemiV3Interface
Linked 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:
chargeTemi
in interfaceTemiV3Interface
-
displayChargingAlert
public void displayChargingAlert()Description copied from interface:TemiV3Interface
zno displays alert signalling that new tasks cannot be submitted while zno is charging- Specified by:
displayChargingAlert
in interfaceTemiV3Interface
-
setBatteryWarnLevel
Description copied from interface:TemiV3Interface
Sets 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:
setBatteryWarnLevel
in interfaceTemiV3Interface
-
setBatteryAbortLevel
Description copied from interface:TemiV3Interface
Sets the value stored in SharedPreferences with the key "chargeActionPercent". Used to determine battery level upon which the temi enacts its charge behavior- Specified by:
setBatteryAbortLevel
in interfaceTemiV3Interface
-
setBatteryChargedLevel
Description copied from interface:TemiV3Interface
Sets the value stored in SharedPreferences with the key "chargeAbortPercent". Used to determine battery level upon which the temi enacts its charge behavior- Specified by:
setBatteryChargedLevel
in interfaceTemiV3Interface
-
setVolume
Description copied from interface:TemiV3Interface
Calls setVolume from temi sdk- Specified by:
setVolume
in interfaceTemiV3Interface
- Parameters:
volume
- value to set volume to
-
setHardButtons
public void setHardButtons(boolean disabled) Description copied from interface:TemiV3Interface
Disables/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:
setHardButtons
in interfaceTemiV3Interface
- Parameters:
disabled
- true to disable the hardButtons, false to enable them
-
enablePrivacyMode
public void enablePrivacyMode()- Specified by:
enablePrivacyMode
in interfaceTemiV3Interface
-
disablePrivacyMode
public void disablePrivacyMode()- Specified by:
disablePrivacyMode
in interfaceTemiV3Interface
-
requestPermissions
public void requestPermissions()- Specified by:
requestPermissions
in interfaceTemiV3Interface
-
restartApp
public void restartApp()- Specified by:
restartApp
in interfaceTemiV3Interface
-
enableVoiceAck
public void enableVoiceAck()- Specified by:
enableVoiceAck
in interfaceTemiV3Interface
-
disableVoiceAck
public void disableVoiceAck()- Specified by:
disableVoiceAck
in interfaceTemiV3Interface
-
enableButtons
public void enableButtons()- Specified by:
enableButtons
in interfaceTemiV3Interface
-
disableButtons
public void disableButtons()- Specified by:
disableButtons
in interfaceTemiV3Interface
-
enableObstacleNotifications
public void enableObstacleNotifications()- Specified by:
enableObstacleNotifications
in interfaceTemiV3Interface
-
disableObstacleNotifications
public void disableObstacleNotifications()- Specified by:
disableObstacleNotifications
in interfaceTemiV3Interface
-
enableKidsMode
public void enableKidsMode()- Specified by:
enableKidsMode
in interfaceTemiV3Interface
-
disableKidsMode
public void disableKidsMode()- Specified by:
disableKidsMode
in interfaceTemiV3Interface
-
displayFace
public void displayFace()- Specified by:
displayFace
in interfaceTemiV3Interface
-
convertPredToReadable
- Specified by:
convertPredToReadable
in interfaceTemiV3Interface
-
updateFirebaseDoc
-
ignoreTentativeAccept
- Specified by:
ignoreTentativeAccept
in interfaceTemiV3Interface
-
skipsQueue
- Specified by:
skipsQueue
in interfaceTemiV3Interface
-
shutdownComponent
protected void shutdownComponent()Description copied from class:DiarcComponent
Any component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponent
in classDiarcComponent
-