|
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>
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 |
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.
enum UncertaintyVisuType |
Enumerator | |
---|---|
eEllipse | |
eHeatMap | |
eHeatSurface |
Definition at line 49 of file SimoxObjectWrapper.h.
SimoxObjectWrapper | ( | const GridFileManagerPtr & | gfm, |
VirtualRobot::RobotIO::RobotDescription | loadMode = VirtualRobot::RobotIO::eFull |
||
) |
Constructs new SimoxObjectWrapper.
gfm | GridFileManager to store/load files |
loadMode | eFull 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.
|
override |
Definition at line 101 of file SimoxObjectWrapper.cpp.
void clear | ( | bool | removeFiles = true | ) |
Clears the Simox ManipulationObject and optionally removes the corresponding files from GridFS.
removeFiles | whether GridFS files (.iv models, textures, MO XML) should be deleted as well |
Definition at line 620 of file SimoxObjectWrapper.cpp.
|
static |
FindIvTextures scans the given ivFName
for texture files and returns them in the textures
string list.
ivFName | path to Inventor file to scan for textures |
textures | vector of strings containing the paths to texture files |
Definition at line 868 of file SimoxObjectWrapper.cpp.
|
static |
GetAbsolutePath prepend filename
with origFile
and append it to storeFilenames
(does nothing if filename
is NULL)
filename | SbString of the filename to check |
origFile | string containing the original filename |
storeFilenames | vector filename strings to which the result should be appended |
Definition at line 1027 of file SimoxObjectWrapper.cpp.
|
static |
GetAllFilenames walks node
and appends absolute paths of all found SoFile, SoImage, and SoTexture2 node filenames to storeFilenames
.
node | SoNode which is analyzed |
storeFilenames | vector to which the found filenames are appended |
origFile | name 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.
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.
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.
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.
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.
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.
|
override |
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.
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.
xmlFName | name of XML file with manipulation object definition |
filesDBName | Mongo database name to store additional files into |
Definition at line 173 of file SimoxObjectWrapper.cpp.
std::string setAndStoreManipulationObject | ( | const VirtualRobot::ManipulationObjectPtr | mo, |
const std::string & | filesDBName | ||
) |
Store Simox ManipulationObject in the wrapped entity.
Namely, this function does the following:
mo | manipulation object |
filesDBName | Mongo database name to store additional files into |
Definition at line 161 of file SimoxObjectWrapper.cpp.
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.
ivFNameVis | name of .iv file for visualization model |
ivFNameCollision | name of .iv file for collision model |
filesDBName | Mongo database name to store additional files into |
Definition at line 197 of file SimoxObjectWrapper.cpp.
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.
xmlFName | name of XML file with manipulation object definition |
Definition at line 187 of file SimoxObjectWrapper.cpp.
void setManipulationObject | ( | const VirtualRobot::ManipulationObjectPtr | mo | ) |
Set Simox ManipulationObject in the wrapped entity.
The object is not stored to GridFS.
mo | manipulation object |
Definition at line 167 of file SimoxObjectWrapper.cpp.
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.
ivFNameVis | name of .iv file for visualization model |
ivFNameCollision | name of .iv file for collision model |
Definition at line 205 of file SimoxObjectWrapper.cpp.
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.
void setUncertaintyVisuParams | ( | float | ellipseRadiusInSigmas, |
float | heatmapMinVariance, | ||
float | heatmapDensityThreshold, | ||
int | heatmapGridSize | ||
) |
Set parameters for uncertainty visualization.
ellipseRadiusInSigmas | |
heatmapMinVariance | |
heatmapDensityThreshold |
Definition at line 216 of file SimoxObjectWrapper.cpp.
void setUncertaintyVisuType | ( | UncertaintyVisuType | visuType | ) |
Set visualization type for position uncertainty.
visuType | one 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.
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.
entity | entity to get attribute values from |
Definition at line 292 of file SimoxObjectWrapper.cpp.