Aikido
aikido::perception::AssetDatabase Class Reference

Instantiation of AssetDatabase that reads of JSON file containing the information that maps object keys to visual assets and resources. More...

#include <aikido/perception/AssetDatabase.hpp>

Public Member Functions

 AssetDatabase (const dart::common::ResourceRetrieverPtr &resourceRetriever, const dart::common::Uri &configDataURI)
 Construct a AssetDatabase that uses ResourceRetriever to load configuration data from a JSON file at URI configDataURI. More...
 
virtual ~AssetDatabase ()=default
 
void getAssetByKey (const std::string &assetKey, dart::common::Uri &assetResource, Eigen::Isometry3d &assetOffset) const
 Get the object name, resource, and offset from database by objectKey. More...
 

Private Attributes

YAML::Node mAssetData
 The map of asset keys to object names and resources for models. More...
 

Detailed Description

Instantiation of AssetDatabase that reads of JSON file containing the information that maps object keys to visual assets and resources.

The JSON file should have a map with object keys. Each such key points to a nested map, where the keys are 'resource' and 'name'. The values for each of the nested keys for a particular object key are to be returned to the calling method via the callback.

Here is an example entry in a JSON file:

"asset_key": {
"resource": "package://pr_assets/data/objects/obj_filename.urdf",
"name": "asset_name",
"offset": [
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
]
}

Constructor & Destructor Documentation

◆ AssetDatabase()

aikido::perception::AssetDatabase::AssetDatabase ( const dart::common::ResourceRetrieverPtr &  resourceRetriever,
const dart::common::Uri &  configDataURI 
)

Construct a AssetDatabase that uses ResourceRetriever to load configuration data from a JSON file at URI configDataURI.

Parameters
[in]resourceRetrieverThe pointer to obtain the configuration file
[in]configDataURIThe URI for the configuration information file

◆ ~AssetDatabase()

virtual aikido::perception::AssetDatabase::~AssetDatabase ( )
virtualdefault

Member Function Documentation

◆ getAssetByKey()

void aikido::perception::AssetDatabase::getAssetByKey ( const std::string &  assetKey,
dart::common::Uri &  assetResource,
Eigen::Isometry3d &  assetOffset 
) const

Get the object name, resource, and offset from database by objectKey.

Parameters
[in]assetKeyThe key (string) of an object in AssetDatabase
[out]assetResourceThe retrieved uri of the object
[out]assetOffsetThe retrieved offset matrix of the object e.g. the offset between a tag and the actual origin of an object

Member Data Documentation

◆ mAssetData

YAML::Node aikido::perception::AssetDatabase::mAssetData
private

The map of asset keys to object names and resources for models.