ObjectFinder Class Reference

Used to find objects in the ArmarX objects repository [1] (formerly [2]). More...

#include <RobotAPI/libraries/ArmarXObjects/ObjectFinder.h>

+ Inheritance diagram for ObjectFinder:

Public Types

using path = std::filesystem::path
 

Public Member Functions

std::vector< armem::articulated_object::ArticulatedObjectDescriptionfindAllArticulatedObjects (bool checkPaths) const
 
std::unordered_map< std::string, std::vector< armem::articulated_object::ArticulatedObjectDescription > > findAllArticulatedObjectsByDataset (bool checkPaths=true) const
 
std::vector< armem::articulated_object::ArticulatedObjectDescriptionfindAllArticulatedObjectsOfDataset (const std::string &dataset, bool checkPaths) const
 
std::vector< ObjectInfofindAllObjects (bool checkPaths=true) const
 
std::map< std::string, std::vector< ObjectInfo > > findAllObjectsByDataset (bool checkPaths=true) const
 
std::vector< ObjectInfofindAllObjectsOfDataset (const std::string &dataset, bool checkPaths=true) const
 
std::optional< ObjectInfofindObject (const ObjectID &id) const
 
std::optional< ObjectInfofindObject (const objpose::ObjectPose &obj) const
 
std::optional< ObjectInfofindObject (const std::string &dataset, const std::string &name) const
 
std::optional< ObjectInfofindObject (const std::string &nameOrID) const
 
std::vector< pathgetDatasetDirectories () const
 
std::vector< std::string > getDatasets () const
 
std::string getPackageName () const
 
VirtualRobot::ManipulationObjectPtr loadManipulationObject (const objpose::ObjectPose &obj) const
 
VirtualRobot::ObstaclePtr loadObstacle (const objpose::ObjectPose &obj) const
 
std::vector< std::string > loadRecognizedNames (const ObjectID &objectID, bool includeClassName=false) const
 Load names to use when matched when recognizing an object by name. More...
 
std::vector< std::string > loadSpokenNames (const ObjectID &objectID, bool includeClassName=false) const
 Load names to use when verbalizing an object name. More...
 
 ObjectFinder (const ObjectFinder &)=default
 
 ObjectFinder (const std::string &objectsPackageName=DefaultObjectsPackageName, const path &relObjectsDir=DefaultObjectsDirectory)
 
 ObjectFinder (ObjectFinder &&)=default
 
ObjectFinderoperator= (const ObjectFinder &)=default
 
ObjectFinderoperator= (ObjectFinder &&)=default
 
void setPath (const std::string &path)
 

Static Public Member Functions

static VirtualRobot::ManipulationObjectPtr loadManipulationObject (const std::optional< ObjectInfo > &ts)
 
static VirtualRobot::ObstaclePtr loadObstacle (const std::optional< ObjectInfo > &ts)
 

Static Public Attributes

static const std::string DefaultObjectsDirectory = "objects"
 
static const std::string DefaultObjectsPackageName = "PriorKnowledgeData"
 

Detailed Description

Used to find objects in the ArmarX objects repository [1] (formerly [2]).

See also
[1] https://git.h2t.iar.kit.edu/sw/armarx/prior-knowledge-data

Definition at line 23 of file ObjectFinder.h.

Member Typedef Documentation

◆ path

using path = std::filesystem::path

Definition at line 27 of file ObjectFinder.h.

Constructor & Destructor Documentation

◆ ObjectFinder() [1/3]

ObjectFinder ( const std::string &  objectsPackageName = DefaultObjectsPackageName,
const path relObjectsDir = DefaultObjectsDirectory 
)

Definition at line 20 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ ObjectFinder() [2/3]

ObjectFinder ( ObjectFinder &&  )
default

◆ ObjectFinder() [3/3]

ObjectFinder ( const ObjectFinder )
default

Member Function Documentation

◆ findAllArticulatedObjects()

std::vector< armem::articulated_object::ArticulatedObjectDescription > findAllArticulatedObjects ( bool  checkPaths) const

Definition at line 166 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ findAllArticulatedObjectsByDataset()

std::unordered_map< std::string, std::vector< armem::articulated_object::ArticulatedObjectDescription > > findAllArticulatedObjectsByDataset ( bool  checkPaths = true) const

Definition at line 233 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ findAllArticulatedObjectsOfDataset()

std::vector< armem::articulated_object::ArticulatedObjectDescription > findAllArticulatedObjectsOfDataset ( const std::string &  dataset,
bool  checkPaths 
) const

Definition at line 257 of file ObjectFinder.cpp.

+ Here is the caller graph for this function:

◆ findAllObjects()

std::vector< ObjectInfo > findAllObjects ( bool  checkPaths = true) const

Definition at line 143 of file ObjectFinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAllObjectsByDataset()

std::map< std::string, std::vector< ObjectInfo > > findAllObjectsByDataset ( bool  checkPaths = true) const

Definition at line 189 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ findAllObjectsOfDataset()

std::vector< ObjectInfo > findAllObjectsOfDataset ( const std::string &  dataset,
bool  checkPaths = true 
) const

Definition at line 200 of file ObjectFinder.cpp.

+ Here is the caller graph for this function:

◆ findObject() [1/4]

std::optional< ObjectInfo > findObject ( const ObjectID id) const

Definition at line 103 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ findObject() [2/4]

std::optional< ObjectInfo > findObject ( const objpose::ObjectPose obj) const

Definition at line 107 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ findObject() [3/4]

std::optional< ObjectInfo > findObject ( const std::string &  dataset,
const std::string &  name 
) const

Definition at line 65 of file ObjectFinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findObject() [4/4]

std::optional< ObjectInfo > findObject ( const std::string &  nameOrID) const

Definition at line 98 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ getDatasetDirectories()

std::vector< ObjectFinder::path > getDatasetDirectories ( ) const

Definition at line 123 of file ObjectFinder.cpp.

+ Here is the caller graph for this function:

◆ getDatasets()

std::vector< std::string > getDatasets ( ) const

Definition at line 112 of file ObjectFinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPackageName()

std::string getPackageName ( ) const

Definition at line 32 of file ObjectFinder.cpp.

+ Here is the caller graph for this function:

◆ loadManipulationObject() [1/2]

VirtualRobot::ManipulationObjectPtr loadManipulationObject ( const objpose::ObjectPose obj) const

Definition at line 311 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ loadManipulationObject() [2/2]

VirtualRobot::ManipulationObjectPtr loadManipulationObject ( const std::optional< ObjectInfo > &  ts)
static

Definition at line 295 of file ObjectFinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadObstacle() [1/2]

VirtualRobot::ObstaclePtr loadObstacle ( const objpose::ObjectPose obj) const

Definition at line 332 of file ObjectFinder.cpp.

+ Here is the call graph for this function:

◆ loadObstacle() [2/2]

VirtualRobot::ObstaclePtr loadObstacle ( const std::optional< ObjectInfo > &  ts)
static

Definition at line 316 of file ObjectFinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecognizedNames()

std::vector< std::string > loadRecognizedNames ( const ObjectID objectID,
bool  includeClassName = false 
) const

Load names to use when matched when recognizing an object by name.

If the object's names JSON file does not exist, no names will be added from a file. If you would like to detect this case, first findObject(), then use ObjectInfo::loadRecognizedNames(), which returns a std::optional.

Parameters
includeClassNameIf true, include the raw class name in the result.
See also
ObjectInfo::loadRecognizedNames()

Definition at line 359 of file ObjectFinder.cpp.

◆ loadSpokenNames()

std::vector< std::string > loadSpokenNames ( const ObjectID objectID,
bool  includeClassName = false 
) const

Load names to use when verbalizing an object name.

If the object's names JSON file does not exist, no names will be added from a file. If you would like to detect this case, first findObject(), then use ObjectInfo::loadSpokenNames(), which returns a std::optional.

Parameters
includeClassNameIf true, include the raw class name in the result.
See also
ObjectInfo::loadSpokenNames()

Definition at line 366 of file ObjectFinder.cpp.

◆ operator=() [1/2]

ObjectFinder& operator= ( const ObjectFinder )
default

◆ operator=() [2/2]

ObjectFinder& operator= ( ObjectFinder &&  )
default

◆ setPath()

void setPath ( const std::string &  path)

Definition at line 26 of file ObjectFinder.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ DefaultObjectsDirectory

const std::string DefaultObjectsDirectory = "objects"
inlinestatic

Definition at line 29 of file ObjectFinder.h.

◆ DefaultObjectsPackageName

const std::string DefaultObjectsPackageName = "PriorKnowledgeData"
inlinestatic

Definition at line 28 of file ObjectFinder.h.


The documentation for this class was generated from the following files: