SimoxObjectWrapper Class Reference

SimoxObjectWrapper offers a simplified access to the Simox ManipulationObject (i.e visualization, collision model, grasps) stored in the attributes of MemoryX entity. More...

#include <MemoryX/libraries/helpers/VirtualRobotHelpers/SimoxObjectWrapper.h>

+ Inheritance diagram for SimoxObjectWrapper:

Public Types

enum  UncertaintyVisuType { eEllipse, eHeatMap, eHeatSurface }
 

Public Member Functions

void clear (bool removeFiles=true)
 Clears the Simox ManipulationObject and optionally removes the corresponding files from GridFS. More...
 
VirtualRobot::CollisionModelPtr getCollisionModel () const
 Retrieve collision model. More...
 
VirtualRobot::ManipulationObjectPtr getManipulationObject () const
 Retrieve the complete Simox ManipulationObject. More...
 
std::string getManipulationObjectFileName () const
 Retrieve the Simox MainpulationObjects file name in local cache. More...
 
Eigen::Vector3f getPutdownOrientationRPY ()
 Returns the orientation of the object that it should have when it is being put down e.g. More...
 
VirtualRobot::VisualizationNodePtr getVisualization () const
 Retrieve visualization model. More...
 
Ice::ObjectPtr ice_clone () const override
 
void refreshVisuPose ()
 Update object visualization using the current values of pose and position uncertainty from the wrapped entity. More...
 
void setAndStoreManipulationFile (const std::string &xmlFName, const std::string &filesDBName)
 Create Simox ManipulationObject from an XML file and store it in the wrapped entity. More...
 
std::string setAndStoreManipulationObject (const VirtualRobot::ManipulationObjectPtr mo, const std::string &filesDBName)
 Store Simox ManipulationObject in the wrapped entity. More...
 
void setAndStoreModelIVFiles (const std::string &ivFNameVis, const std::string &ivFNameCollision, const std::string &filesDBName)
 Create Simox ManipulationObject from separate .iv models and store it in the wrapped entity. More...
 
void setManipulationFile (const std::string &xmlFName)
 Create Simox ManipulationObject from an XML file, but do not store it in the wrapped entity. More...
 
void setManipulationObject (const VirtualRobot::ManipulationObjectPtr mo)
 Set Simox ManipulationObject in the wrapped entity. More...
 
void setModelIVFiles (const std::string &ivFNameVis, const std::string &ivFNameCollision)
 Create Simox ManipulationObject from separate .iv models, but do not store it in the wrapped entity. More...
 
void setPutdownOrientationRPY (Eigen::Vector3f &rpy)
 Sets the orientation of the object that it should have when it is being put down e.g. More...
 
void setUncertaintyVisuParams (float ellipseRadiusInSigmas, float heatmapMinVariance, float heatmapDensityThreshold, int heatmapGridSize)
 Set parameters for uncertainty visualization. More...
 
void setUncertaintyVisuType (UncertaintyVisuType visuType)
 Set visualization type for position uncertainty. More...
 
 SimoxObjectWrapper (const GridFileManagerPtr &gfm, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
 Constructs new SimoxObjectWrapper. More...
 
void updateFromEntity (const EntityBasePtr &entity)
 Update the Simox object using attribute values (position, orientation etc) from the entity, but reusing the existing visualization. More...
 
 ~SimoxObjectWrapper () override
 
- Public Member Functions inherited from AbstractFileEntityWrapper
 AbstractFileEntityWrapper (GridFileManagerPtr fileManager)
 
- Public Member Functions inherited from AbstractEntityWrapper
 AbstractEntityWrapper ()
 
EntityBasePtr getEntity () const
 Get the stored name of the stored entity. More...
 
std::string getId () const
 Get the identifier of the stored entity. More...
 
std::string getName () const
 Get the name of the stored entity. More...
 
void setEntity (const EntityBasePtr &entity)
 Replace the stored entity with a new one. More...
 
 ~AbstractEntityWrapper () override
 

Static Public Member Functions

static void FindIvTextures (const std::string &ivFName, NameList &textures)
 FindIvTextures scans the given ivFName for texture files and returns them in the textures string list. More...
 
static std::string GetAbsolutePath (SbString filename, const std::string &origFile)
 GetAbsolutePath prepend filename with origFile and append it to storeFilenames (does nothing if filename is NULL) More...
 
static void GetAllFilenames (SoNode *node, std::vector< std::string > &storeFilenames, const std::string &origFile="")
 GetAllFilenames walks node and appends absolute paths of all found SoFile, SoImage, and SoTexture2 node filenames to storeFilenames. More...
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractFileEntityWrapper
std::string cacheAttributeFile (const std::string &attrName, bool preserveOriginalFName=false) const
 
void cleanUpAttributeFiles (EntityAttributeBasePtr oldAttr, EntityAttributeBasePtr newAttr)
 cleanUpAttributeFiles compares the files attached to the two given attributes and removes the files of the oldAttr, if they dont match. More...
 
void removeAttributeFiles (const memoryx::EntityAttributeBasePtr &attr)
 removes all files of an attribute from the gridfs More...
 
- Protected Attributes inherited from AbstractFileEntityWrapper
GridFileManagerPtr fileManager
 

Detailed Description

SimoxObjectWrapper offers a simplified access to the Simox ManipulationObject (i.e visualization, collision model, grasps) stored in the attributes of MemoryX entity.

Definition at line 46 of file SimoxObjectWrapper.h.

Member Enumeration Documentation

◆ UncertaintyVisuType

Enumerator
eEllipse 
eHeatMap 
eHeatSurface 

Definition at line 49 of file SimoxObjectWrapper.h.

Constructor & Destructor Documentation

◆ SimoxObjectWrapper()

SimoxObjectWrapper ( const GridFileManagerPtr gfm,
VirtualRobot::RobotIO::RobotDescription  loadMode = VirtualRobot::RobotIO::eFull 
)

Constructs new SimoxObjectWrapper.

Parameters
gfmGridFileManager to store/load files
loadModeeFull or eCollisionModel. If eFull, then both, visualization and collision model is loaded. If eCollisionModel then only the collision model will be loaded.

Definition at line 81 of file SimoxObjectWrapper.cpp.

+ Here is the caller graph for this function:

◆ ~SimoxObjectWrapper()

~SimoxObjectWrapper ( )
override

Definition at line 101 of file SimoxObjectWrapper.cpp.

Member Function Documentation

◆ clear()

void clear ( bool  removeFiles = true)

Clears the Simox ManipulationObject and optionally removes the corresponding files from GridFS.

Parameters
removeFileswhether GridFS files (.iv models, textures, MO XML) should be deleted as well

Definition at line 620 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ FindIvTextures()

void FindIvTextures ( const std::string &  ivFName,
NameList &  textures 
)
static

FindIvTextures scans the given ivFName for texture files and returns them in the textures string list.

Parameters
ivFNamepath to Inventor file to scan for textures
texturesvector of strings containing the paths to texture files

Definition at line 868 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ GetAbsolutePath()

std::string GetAbsolutePath ( SbString  filename,
const std::string &  origFile 
)
static

GetAbsolutePath prepend filename with origFile and append it to storeFilenames (does nothing if filename is NULL)

Parameters
filenameSbString of the filename to check
origFilestring containing the original filename
storeFilenamesvector filename strings to which the result should be appended

Definition at line 1027 of file SimoxObjectWrapper.cpp.

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

◆ GetAllFilenames()

void GetAllFilenames ( SoNode *  node,
std::vector< std::string > &  storeFilenames,
const std::string &  origFile = "" 
)
static

GetAllFilenames walks node and appends absolute paths of all found SoFile, SoImage, and SoTexture2 node filenames to storeFilenames.

Parameters
nodeSoNode which is analyzed
storeFilenamesvector to which the found filenames are appended
origFilename of the original file used to load node (can be used to retrieve absolute paths like texture filenames which are stored as relative paths in Coin3D).

Definition at line 917 of file SimoxObjectWrapper.cpp.

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

◆ getCollisionModel()

VirtualRobot::CollisionModelPtr getCollisionModel ( ) const

Retrieve collision model.

Corresponding files will be fetched and cached locally, if needed.

Definition at line 124 of file SimoxObjectWrapper.cpp.

◆ getManipulationObject()

VirtualRobot::ManipulationObjectPtr getManipulationObject ( ) const

Retrieve the complete Simox ManipulationObject.

Corresponding files will be fetched and cached locally, if needed.

Definition at line 138 of file SimoxObjectWrapper.cpp.

+ Here is the caller graph for this function:

◆ getManipulationObjectFileName()

std::string getManipulationObjectFileName ( ) const

Retrieve the Simox MainpulationObjects file name in local cache.

File is cached when this method is called.

Definition at line 150 of file SimoxObjectWrapper.cpp.

◆ getPutdownOrientationRPY()

Eigen::Vector3f getPutdownOrientationRPY ( )

Returns the orientation of the object that it should have when it is being put down e.g.

onto the table by the robot.

Definition at line 886 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ getVisualization()

VirtualRobot::VisualizationNodePtr getVisualization ( ) const

Retrieve visualization model.

Corresponding files will be fetched and cached locally, if needed.

Definition at line 110 of file SimoxObjectWrapper.cpp.

◆ ice_clone()

Ice::ObjectPtr ice_clone ( ) const
override

Definition at line 105 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ refreshVisuPose()

void refreshVisuPose ( )

Update object visualization using the current values of pose and position uncertainty from the wrapped entity.

Definition at line 299 of file SimoxObjectWrapper.cpp.

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

◆ setAndStoreManipulationFile()

void setAndStoreManipulationFile ( const std::string &  xmlFName,
const std::string &  filesDBName 
)

Create Simox ManipulationObject from an XML file and store it in the wrapped entity.

See setManipulationObject for details.

Parameters
xmlFNamename of XML file with manipulation object definition
filesDBNameMongo database name to store additional files into

Definition at line 173 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ setAndStoreManipulationObject()

std::string setAndStoreManipulationObject ( const VirtualRobot::ManipulationObjectPtr  mo,
const std::string &  filesDBName 
)

Store Simox ManipulationObject in the wrapped entity.

Namely, this function does the following:

  • 1. Clears previous manipulation object, if any. Corresponding files are deleted from GridFS as well.
  • 2. Saves all files in the GridFS
  • 2.1. Manipulation object XML file
  • 2.2. Visualization model file (normally, *.iv)
  • 2.3. Collision model file (normally, *.iv)
  • 2.4. Any textures used by 2.2. and 2.3.
  • 3. Stores references to the files from 2. in corresponding attributes of the wrapped enity
Parameters
momanipulation object
filesDBNameMongo database name to store additional files into
Returns
MongoDB Id of the stored object

Definition at line 161 of file SimoxObjectWrapper.cpp.

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

◆ setAndStoreModelIVFiles()

void setAndStoreModelIVFiles ( const std::string &  ivFNameVis,
const std::string &  ivFNameCollision,
const std::string &  filesDBName 
)

Create Simox ManipulationObject from separate .iv models and store it in the wrapped entity.

See setManipulationObject for details.

Parameters
ivFNameVisname of .iv file for visualization model
ivFNameCollisionname of .iv file for collision model
filesDBNameMongo database name to store additional files into

Definition at line 197 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ setManipulationFile()

void setManipulationFile ( const std::string &  xmlFName)

Create Simox ManipulationObject from an XML file, but do not store it in the wrapped entity.

See setManipulationObject for details.

Parameters
xmlFNamename of XML file with manipulation object definition

Definition at line 187 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ setManipulationObject()

void setManipulationObject ( const VirtualRobot::ManipulationObjectPtr  mo)

Set Simox ManipulationObject in the wrapped entity.

The object is not stored to GridFS.

Parameters
momanipulation object

Definition at line 167 of file SimoxObjectWrapper.cpp.

+ Here is the caller graph for this function:

◆ setModelIVFiles()

void setModelIVFiles ( const std::string &  ivFNameVis,
const std::string &  ivFNameCollision 
)

Create Simox ManipulationObject from separate .iv models, but do not store it in the wrapped entity.

See setManipulationObject for details.

Parameters
ivFNameVisname of .iv file for visualization model
ivFNameCollisionname of .iv file for collision model

Definition at line 205 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ setPutdownOrientationRPY()

void setPutdownOrientationRPY ( Eigen::Vector3f &  rpy)

Sets the orientation of the object that it should have when it is being put down e.g.

onto the table by the robot.

Definition at line 908 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

◆ setUncertaintyVisuParams()

void setUncertaintyVisuParams ( float  ellipseRadiusInSigmas,
float  heatmapMinVariance,
float  heatmapDensityThreshold,
int  heatmapGridSize 
)

Set parameters for uncertainty visualization.

Parameters
ellipseRadiusInSigmas
heatmapMinVariance
heatmapDensityThreshold

Definition at line 216 of file SimoxObjectWrapper.cpp.

◆ setUncertaintyVisuType()

void setUncertaintyVisuType ( UncertaintyVisuType  visuType)

Set visualization type for position uncertainty.

Parameters
visuTypeone of: eEllipse - ellipsoids, full 3d uncertainty shown eHeatMap - flat colored map, XY uncertainty only eHeatSurface - 3d surface,

Definition at line 211 of file SimoxObjectWrapper.cpp.

◆ updateFromEntity()

void updateFromEntity ( const EntityBasePtr &  entity)

Update the Simox object using attribute values (position, orientation etc) from the entity, but reusing the existing visualization.

This method meant to be used with subsequent observations of the same entity. For new entity instances, create new SimoxObjectWrapper object instead.

Parameters
entityentity to get attribute values from

Definition at line 292 of file SimoxObjectWrapper.cpp.

+ Here is the call graph for this function:

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