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::ArticulatedObjectDescription > findAllArticulatedObjects (bool checkPaths) const
 
std::unordered_map< std::string, std::vector< armem::articulated_object::ArticulatedObjectDescription > > findAllArticulatedObjectsByDataset (bool checkPaths=true) const
 
std::vector< armem::articulated_object::ArticulatedObjectDescription > findAllArticulatedObjectsOfDataset (const std::string &dataset, bool checkPaths) const
 
std::vector< ObjectInfo > findAllObjects (bool checkPaths=true) const
 
std::map< std::string, std::vector< ObjectInfo > > findAllObjectsByDataset (bool checkPaths=true) const
 
std::vector< ObjectInfo > findAllObjectsOfDataset (const std::string &dataset, bool checkPaths=true) const
 
std::optional< ObjectInfo > findObject (const ObjectID &id) const
 
std::optional< ObjectInfo > findObject (const objpose::ObjectPose &obj) const
 
std::optional< ObjectInfo > findObject (const std::string &dataset, const std::string &name) const
 
std::optional< ObjectInfo > findObject (const std::string &nameOrID) const
 
std::vector< path > getDatasetDirectories () const
 
std::vector< std::string > getDatasets () const
 
std::string getPackageName () const
 
VirtualRobot::ManipulationObjectPtr loadManipulationObject (const objpose::ObjectPose &obj, VirtualRobot::ObjectIO::ObjectDescription loadMode=VirtualRobot::ObjectIO::ObjectDescription::eFull) 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.
 
std::vector< std::string > loadSpokenNames (const ObjectID &objectID, bool includeClassName=false) const
 Load names to use when verbalizing an object name.
 
 ObjectFinder (const ObjectFinder &)=default
 
 ObjectFinder (const std::string &objectsPackageName=DefaultObjectsPackageName, const path &relObjectsDir=DefaultObjectsDirectory)
 
 ObjectFinder (ObjectFinder &&)=default
 
ObjectFinder & operator= (const ObjectFinder &)=default
 
ObjectFinder & operator= (ObjectFinder &&)=default
 
void setLogObjectDiscoveryError (bool logEnabled)
 
void setPath (const std::string &path)
 

Static Public Member Functions

static VirtualRobot::ManipulationObjectPtr loadManipulationObject (const std::optional< ObjectInfo > &ts, VirtualRobot::ObjectIO::ObjectDescription loadMode=VirtualRobot::ObjectIO::ObjectDescription::eFull)
 
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

Member Typedef Documentation

◆ path

using path = std::filesystem::path

Constructor & Destructor Documentation

◆ ObjectFinder() [1/3]

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

◆ 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

◆ findAllArticulatedObjectsByDataset()

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

◆ findAllArticulatedObjectsOfDataset()

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

◆ findAllObjects()

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

◆ findAllObjectsByDataset()

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

◆ findAllObjectsOfDataset()

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

◆ findObject() [1/4]

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

◆ findObject() [2/4]

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

◆ findObject() [3/4]

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

◆ findObject() [4/4]

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

◆ getDatasetDirectories()

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

◆ getDatasets()

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

◆ getPackageName()

std::string getPackageName ( ) const

◆ loadManipulationObject() [1/2]

VirtualRobot::ManipulationObjectPtr loadManipulationObject ( const objpose::ObjectPose & obj,
VirtualRobot::ObjectIO::ObjectDescription loadMode = VirtualRobot::ObjectIO::ObjectDescription::eFull ) const

◆ loadManipulationObject() [2/2]

VirtualRobot::ManipulationObjectPtr loadManipulationObject ( const std::optional< ObjectInfo > & ts,
VirtualRobot::ObjectIO::ObjectDescription loadMode = VirtualRobot::ObjectIO::ObjectDescription::eFull )
static

◆ loadObstacle() [1/2]

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

◆ loadObstacle() [2/2]

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

◆ 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()

◆ 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()

◆ operator=() [1/2]

ObjectFinder & operator= ( const ObjectFinder & )
default

◆ operator=() [2/2]

ObjectFinder & operator= ( ObjectFinder && )
default

◆ setLogObjectDiscoveryError()

void setLogObjectDiscoveryError ( bool logEnabled)

◆ setPath()

void setPath ( const std::string & path)

Member Data Documentation

◆ DefaultObjectsDirectory

const std::string DefaultObjectsDirectory = "objects"
inlinestatic

◆ DefaultObjectsPackageName

const std::string DefaultObjectsPackageName = "PriorKnowledgeData"
inlinestatic

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