Package edu.tufts.hrilab.vision.stm
Class MemoryObjectUtil
java.lang.Object
edu.tufts.hrilab.vision.stm.MemoryObjectUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
applyDefinition
(MemoryObject mo, Term name, List<Term> descriptors) static Grasp
convertMemoryObjectToGrasp
(MemoryObject graspMO) static double
getAngleFromAngle
(Grasp grasp, javax.vecmath.Vector3d angleVector) Helper method to get the angle (in radians) between the grasp orientation and the passed in vector..static double
getAngleFromAngle
(MemoryObject mo, javax.vecmath.Vector3d angleVector) Helper method to get the angle (in radians) between the mo orientation and the passed in vector..static double
static double
Helper method to get the angle (in radians) between the mo orientation and the vertical (0,0,-1) orientation.Helper method to get an entire bound scene graph description given the root of the scene graph.getConfidence
(MemoryObject rootMO, List<? extends Term> constraints, Map<Variable, Symbol> bindings) Get the highest confidence value for each term in list along with the bindings (variable to memory object identifier (e.g., object26)) for the returned confidence values.static Grasp
static Grasp
getGraspFor
(MemoryObject o, Comparator<Grasp> comparator) static Grasp
getGraspFor
(MemoryObject o, Function<Grasp, Boolean> filter) static Grasp
getGraspFor
(MemoryObject o, Function<Grasp, Boolean> filter, Comparator<Grasp> comparator) getGraspsFor
(MemoryObject o, Comparator<Grasp> comparator) getGraspsFor
(MemoryObject o, Function<Grasp, Boolean> filter) getGraspsFor
(MemoryObject o, Function<Grasp, Boolean> filter, Comparator<Grasp> comparator) static boolean
getMemoryObjectBindings
(MemoryObject mo, Term constraints, List<Map<Variable, MemoryObject>> bindings) Convenience method to pass in a single constraint.static boolean
getMemoryObjectBindings
(MemoryObject mo, List<? extends Term> constraints, List<Map<Variable, MemoryObject>> bindings) Get list of MemoryObject bindings from the scene graph that meet the constraints.static boolean
getMemoryObjectIdentifierBindings
(MemoryObject mo, Term constraints, List<Map<Variable, Symbol>> bindings) Convenience method to pass in a single constraint.static boolean
getMemoryObjectIdentifierBindings
(MemoryObject mo, List<? extends Term> constraints, List<Map<Variable, Symbol>> bindings) Get list of MemoryObject identifier bindings (e.g., object31) from the scene graph that meet the constraints.Helper method to get an entire scene graph description (i.e., unbound descriptors) given the root of the scene graph.
-
Constructor Details
-
MemoryObjectUtil
public MemoryObjectUtil()
-
-
Method Details
-
convertMemoryObjectToGrasp
-
getAngleFromVertical
Helper method to get the angle (in radians) between the mo orientation and the vertical (0,0,-1) orientation.- Parameters:
mo
-- Returns:
-
getAngleFromAngle
Helper method to get the angle (in radians) between the mo orientation and the passed in vector..- Parameters:
mo
-- Returns:
-
getAngleFromAngle
Helper method to get the angle (in radians) between the grasp orientation and the passed in vector..- Parameters:
grasp
-- Returns:
-
getAngleFromCurrent
-
getConfidence
public static List<Float> getConfidence(MemoryObject rootMO, List<? extends Term> constraints, Map<Variable, Symbol> bindings) Get the highest confidence value for each term in list along with the bindings (variable to memory object identifier (e.g., object26)) for the returned confidence values.- Parameters:
rootMO
- root of the scene graph to be searchedconstraints
- to be satisfiedbindings
- return bindings for highest confidence match- Returns:
- list of confidence values, one for each constraint Term
-
getMemoryObjectBindings
public static boolean getMemoryObjectBindings(MemoryObject mo, List<? extends Term> constraints, List<Map<Variable, MemoryObject>> bindings) Get list of MemoryObject bindings from the scene graph that meet the constraints.- Parameters:
mo
-constraints
-bindings
-- Returns:
- if bindings were found for all free variables
-
getMemoryObjectIdentifierBindings
public static boolean getMemoryObjectIdentifierBindings(MemoryObject mo, List<? extends Term> constraints, List<Map<Variable, Symbol>> bindings) Get list of MemoryObject identifier bindings (e.g., object31) from the scene graph that meet the constraints.- Parameters:
mo
-constraints
-bindings
-- Returns:
- if bindings were found for all free variables
-
getMemoryObjectBindings
public static boolean getMemoryObjectBindings(MemoryObject mo, Term constraints, List<Map<Variable, MemoryObject>> bindings) Convenience method to pass in a single constraint.- Parameters:
mo
-constraints
-bindings
-- Returns:
-
getMemoryObjectIdentifierBindings
public static boolean getMemoryObjectIdentifierBindings(MemoryObject mo, Term constraints, List<Map<Variable, Symbol>> bindings) Convenience method to pass in a single constraint.- Parameters:
mo
-constraints
-bindings
-- Returns:
- if bindings were found for all free variables
-
applyDefinition
-
getBoundSceneGraphDescriptors
Helper method to get an entire bound scene graph description given the root of the scene graph.- Parameters:
mo
-- Returns:
-
getSceneGraphDescriptors
Helper method to get an entire scene graph description (i.e., unbound descriptors) given the root of the scene graph.- Parameters:
mo
-
-
getGraspsFor
public static List<Grasp> getGraspsFor(MemoryObject o, Function<Grasp, Boolean> filter, Comparator<Grasp> comparator) -
getGraspsFor
-
getGraspsFor
-
getGraspsFor
-
getGraspFor
public static Grasp getGraspFor(MemoryObject o, Function<Grasp, Boolean> filter, Comparator<Grasp> comparator) -
getGraspFor
-
getGraspFor
-
getGraspFor
-