Go to the documentation of this file.
30 #include <VirtualRobot/ManipulationObject.h>
31 #include <VirtualRobot/XML/RobotIO.h>
32 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
146 void setAndStoreModelIVFiles(
const std::string& ivFNameVis,
const std::string& ivFNameCollision,
const std::string& filesDBName);
155 void setModelIVFiles(
const std::string& ivFNameVis,
const std::string& ivFNameCollision);
190 float heatmapDensityThreshold,
int heatmapGridSize);
197 void clear(
bool removeFiles =
true);
205 static void GetAllFilenames(SoNode* node, std::vector<std::string>& storeFilenames,
const std::string& origFile =
"");
220 static void FindIvTextures(
const std::string& ivFName, NameList& textures);
232 VirtualRobot::CoinVisualizationFactoryPtr coinVisFactory;
233 mutable VirtualRobot::ManipulationObjectPtr simoxObject;
234 VirtualRobot::RobotIO::RobotDescription loadMode;
235 std::filesystem::path cachePath;
236 std::string moTempFile;
239 float ellipseRadiusInSigmas;
240 float heatmapMinVariance;
241 float heatmapDensityThreshold;
244 void loadSimoxObject()
const;
246 std::string cacheAttributeFile(
const std::string& attrName,
bool preserveOriginalFName =
false)
const;
247 bool cacheAttributeFiles(
const std::string& attrName,
bool preserveOriginalFName =
false)
const;
249 VirtualRobot::ManipulationObjectPtr loadManipulationObjectFile(
const std::string& xmlFName)
const;
250 VirtualRobot::ManipulationObjectPtr createManipulationObjectFromIvFiles(
const std::string& objName,
251 const std::string& ivFNameVis,
const std::string& ivFNameCollision)
const;
253 std::string storeManipulationObject(
const VirtualRobot::ManipulationObjectPtr mo,
const std::string& filesDBName);
254 void storeEntityIVFiles(
const std::string& visuFName,
const std::string& collisionFName,
const std::string& filesDBName,
bool processTextures =
true);
256 VirtualRobot::VisualizationNodePtr getUncertaintyEllipsesVisu(GaussianMixtureDistributionBasePtr posGM,
const Eigen::Vector3f& objPos,
257 const VirtualRobot::ColorMap& cmap,
float transparency);
258 VirtualRobot::VisualizationNodePtr getUncertaintyHeatVisu(GaussianMixtureDistributionBasePtr posGM,
const Eigen::Vector3f& objPos,
bool heatSurface,
259 const VirtualRobot::ColorMap& cmap);
261 float evaluate2DGaussian(
const Eigen::Vector2f& point,
const Eigen::Vector2f&
mean,
const Eigen::Matrix2f& covInv,
float covDetSqrtInv);
262 float evaluate3DGaussian(
const Eigen::Vector3f& point,
const Eigen::Vector3f&
mean,
const Eigen::Matrix3f& covInv,
float covDet);
264 VirtualRobot::ColorMap getUncertaintyColorMap();
265 float getUncertaintyEllipseTransparency();
void refreshVisuPose()
Update object visualization using the current values of pose and position uncertainty from the wrappe...
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.
Eigen::Vector3f getPutdownOrientationRPY()
Returns the orientation of the object that it should have when it is being put down e....
void setUncertaintyVisuParams(float ellipseRadiusInSigmas, float heatmapMinVariance, float heatmapDensityThreshold, int heatmapGridSize)
Set parameters for uncertainty visualization.
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...
void setManipulationObject(const VirtualRobot::ManipulationObjectPtr mo)
Set Simox ManipulationObject in the wrapped entity.
Ice::ObjectPtr ice_clone() const override
void clear(bool removeFiles=true)
Clears the Simox ManipulationObject and optionally removes the corresponding files from GridFS.
VirtualRobot::ManipulationObjectPtr getManipulationObject() const
Retrieve the complete Simox ManipulationObject.
std::string setAndStoreManipulationObject(const VirtualRobot::ManipulationObjectPtr mo, const std::string &filesDBName)
Store Simox ManipulationObject in the wrapped entity.
SimoxObjectWrapper(const GridFileManagerPtr &gfm, VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eFull)
Constructs new SimoxObjectWrapper.
VirtualRobot::CollisionModelPtr getCollisionModel() const
Retrieve collision model.
VirtualRobot::VisualizationNodePtr getVisualization() const
Retrieve visualization model.
std::optional< float > mean(const boost::circular_buffer< NameValueMap > &buffer, const std::string &key)
MatrixXX< 2, 2, float > Matrix2f
void setPutdownOrientationRPY(Eigen::Vector3f &rpy)
Sets the orientation of the object that it should have when it is being put down e....
SimoxObjectWrapper offers a simplified access to the Simox ManipulationObject (i.e visualization,...
void setUncertaintyVisuType(UncertaintyVisuType visuType)
Set visualization type for position uncertainty.
void setAndStoreManipulationFile(const std::string &xmlFName, const std::string &filesDBName)
Create Simox ManipulationObject from an XML file and store it in the wrapped entity.
MatrixXX< 3, 3, float > Matrix3f
~SimoxObjectWrapper() override
std::shared_ptr< GridFileManager > GridFileManagerPtr
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.
void updateFromEntity(const EntityBasePtr &entity)
Update the Simox object using attribute values (position, orientation etc) from the entity,...
std::shared_ptr< Object > ObjectPtr
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,...
std::string getManipulationObjectFileName() const
Retrieve the Simox MainpulationObjects file name in local cache.
static std::string GetAbsolutePath(SbString filename, const std::string &origFile)
GetAbsolutePath prepend filename with origFile and append it to storeFilenames (does nothing if filen...
void setManipulationFile(const std::string &xmlFName)
Create Simox ManipulationObject from an XML file, but do not store it in the wrapped entity.