Go to the documentation of this file.
30 #include <VirtualRobot/ManipulationObject.h>
31 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
32 #include <VirtualRobot/XML/RobotIO.h>
115 const std::string& filesDBName);
132 const std::string& filesDBName);
151 const std::string& ivFNameCollision,
152 const std::string& filesDBName);
161 void setModelIVFiles(
const std::string& ivFNameVis,
const std::string& ivFNameCollision);
196 float heatmapMinVariance,
197 float heatmapDensityThreshold,
198 int heatmapGridSize);
205 void clear(
bool removeFiles =
true);
214 std::vector<std::string>& storeFilenames,
215 const std::string& origFile =
"");
230 static void FindIvTextures(
const std::string& ivFName, NameList& textures);
243 VirtualRobot::CoinVisualizationFactoryPtr coinVisFactory;
244 mutable VirtualRobot::ManipulationObjectPtr simoxObject;
245 VirtualRobot::RobotIO::RobotDescription loadMode;
246 std::filesystem::path cachePath;
247 std::string moTempFile;
250 float ellipseRadiusInSigmas;
251 float heatmapMinVariance;
252 float heatmapDensityThreshold;
255 void loadSimoxObject()
const;
257 std::string cacheAttributeFile(
const std::string& attrName,
258 bool preserveOriginalFName =
false)
const;
259 bool cacheAttributeFiles(
const std::string& attrName,
260 bool preserveOriginalFName =
false)
const;
262 VirtualRobot::ManipulationObjectPtr
263 loadManipulationObjectFile(
const std::string& xmlFName)
const;
264 VirtualRobot::ManipulationObjectPtr
265 createManipulationObjectFromIvFiles(
const std::string& objName,
266 const std::string& ivFNameVis,
267 const std::string& ivFNameCollision)
const;
269 std::string storeManipulationObject(
const VirtualRobot::ManipulationObjectPtr mo,
270 const std::string& filesDBName);
271 void storeEntityIVFiles(
const std::string& visuFName,
272 const std::string& collisionFName,
273 const std::string& filesDBName,
274 bool processTextures =
true);
276 VirtualRobot::VisualizationNodePtr
277 getUncertaintyEllipsesVisu(GaussianMixtureDistributionBasePtr posGM,
278 const Eigen::Vector3f& objPos,
279 const VirtualRobot::ColorMap& cmap,
281 VirtualRobot::VisualizationNodePtr
282 getUncertaintyHeatVisu(GaussianMixtureDistributionBasePtr posGM,
283 const Eigen::Vector3f& objPos,
285 const VirtualRobot::ColorMap& cmap);
287 float evaluate2DGaussian(
const Eigen::Vector2f& point,
288 const Eigen::Vector2f&
mean,
290 float covDetSqrtInv);
291 float evaluate3DGaussian(
const Eigen::Vector3f& point,
292 const Eigen::Vector3f&
mean,
296 VirtualRobot::ColorMap getUncertaintyColorMap();
297 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.
~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
MatrixXX< 3, 3, float > Matrix3f
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.