Package edu.tufts.hrilab.interfaces
Interface VisionInterface
- All Known Subinterfaces:
MockVisionInterface,VisionInterface
- All Known Implementing Classes:
MockVisionComponent
public interface VisionInterface
Core interface for vision servers.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDescriptor(long typeId, Symbol descriptor) Add new search constraint (i.e., ImageProcessor) to an existing SearchManager (specified by searchID).booleanconfirmToken(long tokenId) Confirms that the object is still in STM.booleanconfirmToken(MemoryObject token) Confirms that the object is still in STM.This instantiates a new MemoryObjecType (search manager) which can be incrementally configured viaaddDescriptor.voidendDescriptorChanges(long typeId) Signal the end of constraint addition.getDescriptors(Long typeId) Get the descriptors for a particular SearchManager.getToken(long tokenId) Get the MemoryObject with the specified id.Get MemoryObject IDs in STM.getTokenIds(long typeId) Get MemoryObject IDs that have specified SearchManager ID.getTokenIds(List<? extends Symbol> descriptors) Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM.Get MemoryObjects in STM.getTokens(long typeId) Get MemoryObjects of the specified SearchManager ID.Get MemoryObjects *exactly* matching descriptors in STM.Get the SearchManager ID (search ID) based on a Predicate description of the object.Get the SearchManager ID (search ID) based on a Predicate description of the object.Find all SearchManagers containing at least one token in STM.booleannameDescriptors(Long typeId, Symbol typeName) Name the collection of Predicate descriptors referred to by the SearchManager ID (search ID).booleanremoveDescriptor(long typeId, Symbol descriptor) Remove search constraint (i.e., processing descriptor and/or ImageProcessor) to an existing SearchManager (specified by searchID).voidstopAndRemoveType(long typeId) Turns off search for typeId, and removes SearchManager.
-
Method Details
-
getTypeIds
Find all SearchManagers containing at least one token in STM. One each, regardless of how many tokens of a particular type are in STM.- Returns:
- SearchManager IDs
-
getTypeId
Get the SearchManager ID (search ID) based on a Predicate description of the object. The Predicate description must match the SearchManager description exactly. If an existing SearchManager does not match the description, a new SearchManager will be attempted to be built. This assumes that all descriptors refer to the same object. Also starts the SearchManager if not running. NOTE: currently just ignores descriptors that vision doesn't know how to handle.- Parameters:
descriptors- Predicate description of object- Returns:
- SearchManager Id (-1 if there is no match)
-
getTypeId
Get the SearchManager ID (search ID) based on a Predicate description of the object. The Predicate description must match the SearchManager description exactly. If a current SearchManager does not match the description a new SearchManager will be attempted to be built. Also starts the SearchManager if not running. NOTE: This is only a convenience method so a List doesn't need to be passed when only a single Predicate is used.- Parameters:
descriptor- Predicate description of object- Returns:
- SearchManager Id (-1 if there is no match)
-
getDescriptors
Get the descriptors for a particular SearchManager.- Parameters:
typeId-- Returns:
-
nameDescriptors
Name the collection of Predicate descriptors referred to by the SearchManager ID (search ID).- Parameters:
typeId- SearchManager ID (search ID)typeName- Predicate name of object (name will be bound to typeId in VisionComponent)- Returns:
- true if typeId exists, false otherwise
-
getTokenIds
Get MemoryObject IDs in STM. Only considers results from SearchManager searches that are currently running.- Returns:
- List of STM MemoryObject IDs
-
getTokenIds
Get MemoryObject IDs that have specified SearchManager ID. If the specified SearchManager exists but is not running, it will be started before returning results.- Parameters:
typeId- SearchManager ID of tracked objects- Returns:
- List of STM MemoryObject IDs
-
getTokenIds
Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM. If a matching type is found, it will be started (if not already running). If no match exists, a SearchManager will attempt to be built and started before returning. This is largely a convenience method andgetTypeIdshould be used whenever possible.- Parameters:
descriptors- list of Symbol descriptors- Returns:
- List of STM MemoryObject IDs
-
getTokens
List<MemoryObject> getTokens()Get MemoryObjects in STM. Only considers results from SearchManager searches that are currently running.- Returns:
- List of MemoryObjects
-
getTokens
Get MemoryObjects of the specified SearchManager ID. If the specified SearchManager exists but is not running, it will be started before returning results.- Parameters:
typeId- SearchManager ID of tracked objects- Returns:
- List of MemoryObjects
-
getTokens
Get MemoryObjects *exactly* matching descriptors in STM. If a matching type is found, it will be started (if not already running). If no match exists, a SearchManager will attempt to be built and started before returning. This is largely a convenience method andgetTypeIdshould be used whenever possible.- Parameters:
descriptors- list of Symbol descriptors- Returns:
- List of STM MemoryObjects
-
getToken
Get the MemoryObject with the specified id.- Parameters:
tokenId- MemoryObject ID in STM- Returns:
- MemoryObject token (Null if doesn't exist)
-
confirmToken
boolean confirmToken(long tokenId) Confirms that the object is still in STM.- Parameters:
tokenId- MemoryObject ID of the object to be confirmed- Returns:
- true if the MemoryObject is present in STM
-
confirmToken
Confirms that the object is still in STM.- Parameters:
token- MemoryObject to be confirmed- Returns:
- true if the object is present in STM
-
createNewType
Long createNewType()This instantiates a new MemoryObjecType (search manager) which can be incrementally configured viaaddDescriptor.- Returns:
- SearchManager ID (search id)
-
addDescriptor
Add new search constraint (i.e., ImageProcessor) to an existing SearchManager (specified by searchID).- Parameters:
typeId- - unique ID returned bycreateNewTypedescriptor- - predicate describing visual search attribute (e.g., "red", "round")
-
removeDescriptor
Remove search constraint (i.e., processing descriptor and/or ImageProcessor) to an existing SearchManager (specified by searchID).- Parameters:
typeId-descriptor- - to remove- Returns:
- - if removal was successful
-
endDescriptorChanges
void endDescriptorChanges(long typeId) Signal the end of constraint addition. Descriptors/constraints can no longer be added to the SearchManager after this has been called. This also starts the Detector and Tracker and will choose the "object" Detector if one hasn't already been selected.- Parameters:
typeId-
-
stopAndRemoveType
void stopAndRemoveType(long typeId) Turns off search for typeId, and removes SearchManager.- Parameters:
typeId-
-