Simox  2.3.74.0
VirtualRobot::ObjectIO Class Reference
Inheritance diagram for VirtualRobot::ObjectIO:
VirtualRobot::BaseIO

Static Public Member Functions

static ObstaclePtr loadObstacle (const std::string &xmlFile)
 
static ObstaclePtr loadObstacle (const std::ifstream &xmlFile, const std::string &basePath="")
 
static ManipulationObjectPtr loadManipulationObject (const std::string &xmlFile)
 
static ManipulationObjectPtr loadManipulationObject (const char *xmlFile)
 
static ManipulationObjectPtr loadManipulationObject (const std::filesystem::path &xmlFile)
 
static ManipulationObjectPtr loadManipulationObject (const std::ifstream &xmlFile, const std::string &basePath="")
 
static bool saveManipulationObject (ManipulationObjectPtr object, const std::string &xmlFile)
 
static ManipulationObjectPtr createManipulationObjectFromString (const std::string &xmlString, const std::string &basePath="")
 
static ObstaclePtr createObstacleFromString (const std::string &xmlString, const std::string &basePath="")
 
static ObstaclePtr processObstacle (rapidxml::xml_node< char > *objectXMLNode, const std::string &basePath)
 
static ManipulationObjectPtr processManipulationObject (rapidxml::xml_node< char > *objectXMLNode, const std::string &basePath)
 
static bool writeSTL (TriMeshModelPtr t, const std::string &filename, const std::string &objectName, float scaling=0.001f)
 writeSTL Write ascii stl file. More...
 
- Static Public Member Functions inherited from VirtualRobot::BaseIO
static void makeAbsolutePath (const std::string &basePath, std::string &filename)
 
static void makeRelativePath (const std::string &basePath, std::string &filename)
 
static bool writeXMLFile (const std::string &filename, const std::string &content, bool overwrite=true)
 
static bool isTrue (const char *s)
 
static float convertToFloat (const char *s)
 
static int convertToInt (const char *s)
 
static void processNodeList (rapidxml::xml_node< char > *parentNode, RobotPtr robot, std::vector< RobotNodePtr > &nodeList, bool clearList=true)
 
static void processLimitsNode (rapidxml::xml_node< char > *limitsXMLNode, float &jointLimitLo, float &jointLimitHi)
 
static std::string processFileNode (rapidxml::xml_node< char > *fileNode, const std::string &basePath)
 
static void processTransformNode (rapidxml::xml_node< char > *transformXMLNode, const std::string &nodeName, Eigen::Matrix4f &transform)
 
static Units getUnitsAttribute (rapidxml::xml_node< char > *node, Units::UnitsType u)
 
static std::string processNameAttribute (rapidxml::xml_node< char > *node, bool allowOtherAttributes=false)
 
static float processFloatAttribute (const std::string &attributeName, rapidxml::xml_node< char > *node, bool allowOtherAttributes=false)
 
static int processIntAttribute (const std::string &attributeName, rapidxml::xml_node< char > *node, bool allowOtherAttributes=false)
 
static float getFloatByAttributeName (rapidxml::xml_node< char > *xmlNode, const std::string &attributeName)
 
static float getOptionalFloatByAttributeName (rapidxml::xml_node< char > *xmlNode, const std::string &attributeName, float standardValue)
 
static bool processConfigurationNode (rapidxml::xml_node< char > *configXMLNode, std::vector< RobotConfig::Configuration > &storeConfigDefinitions, std::string &storeConfigName)
 
static bool processConfigurationNodeList (rapidxml::xml_node< char > *configXMLNode, std::vector< std::vector< RobotConfig::Configuration > > &configDefinitions, std::vector< std::string > &configNames, std::vector< std::string > &tcpNames)
 
static std::string getLowerCase (const char *c)
 
static void getLowerCase (std::string &aString)
 
static std::string processStringAttribute (const std::string &attributeName, rapidxml::xml_node< char > *node, bool allowOtherAttributes=false)
 
static VisualizationNodePtr processVisualizationTag (rapidxml::xml_node< char > *visuXMLNode, const std::string &tagName, const std::string &basePath, bool &useAsColModel)
 
static CollisionModelPtr processCollisionTag (rapidxml::xml_node< char > *colXMLNode, const std::string &tagName, const std::string &basePath)
 
static std::vector< Primitive::PrimitivePtrprocessPrimitives (rapidxml::xml_node< char > *primitivesXMLNode)
 
static void processPhysicsTag (rapidxml::xml_node< char > *physicsXMLNode, const std::string &nodeName, SceneObject::Physics &physics)
 
static RobotNodeSetPtr processRobotNodeSet (rapidxml::xml_node< char > *setXMLNode, RobotPtr robo, const std::string &robotRootNode, int &robotNodeSetCounter)
 
static TrajectoryPtr processTrajectory (rapidxml::xml_node< char > *trajectoryXMLNode, std::vector< RobotPtr > &robots)
 
static Eigen::Matrix3f process3x3Matrix (rapidxml::xml_node< char > *matrixXMLNode)
 
static bool processFloatValueTags (rapidxml::xml_node< char > *XMLNode, int dim, Eigen::VectorXf &stroreResult)
 
static bool hasUnitsAttribute (rapidxml::xml_node< char > *node)
 
static std::vector< UnitsgetUnitsAttributes (rapidxml::xml_node< char > *node)
 
static void getAllAttributes (rapidxml::xml_node< char > *node, const std::string &attrString, std::vector< std::string > &storeValues)
 
static void processDHNode (rapidxml::xml_node< char > *dhXMLNode, DHParameter &dh)
 
static NodeMapping processNodeMapping (rapidxml::xml_node< char > *XMLNode, RobotPtr robot)
 
static std::string toXML (const Eigen::Matrix4f &m, std::string ident="\)
 
static std::vector< VisualizationNodePtrprocessVisuFiles (rapidxml::xml_node< char > *visualizationXMLNode, const std::string &basePath, std::string &fileType)
 
static GraspSetPtr processGraspSet (rapidxml::xml_node< char > *graspSetXMLNode, const std::string &objName)
 
static GraspPtr processGrasp (rapidxml::xml_node< char > *graspXMLNode, const std::string &robotType, const std::string &eef, const std::string &objName)
 
static bool processSensor (GraspableSensorizedObjectPtr node, rapidxml::xml_node< char > *sensorXMLNode, RobotDescription loadMode, const std::string &basePath)
 

Protected Member Functions

 ObjectIO ()
 
 ~ObjectIO () override
 
- Protected Member Functions inherited from VirtualRobot::BaseIO
 BaseIO ()
 
virtual ~BaseIO ()
 

Static Protected Member Functions

static bool processSceneRobot (rapidxml::xml_node< char > *sceneXMLNode, ScenePtr scene, const std::string &basePath)
 

Friends

class SceneIO
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::BaseIO
enum  RobotDescription {
  eFull, eCollisionModel, eStructure, eStructureStore,
  eFullVisAsCol
}
 
- Static Protected Attributes inherited from VirtualRobot::BaseIO
static std::mutex mutex
 

Constructor & Destructor Documentation

◆ ObjectIO()

VirtualRobot::ObjectIO::ObjectIO ( )
protecteddefault

◆ ~ObjectIO()

VirtualRobot::ObjectIO::~ObjectIO ( )
overrideprotecteddefault

Member Function Documentation

◆ createManipulationObjectFromString()

VirtualRobot::ManipulationObjectPtr VirtualRobot::ObjectIO::createManipulationObjectFromString ( const std::string &  xmlString,
const std::string &  basePath = "" 
)
static

Creates ManipulationObject from string.

Parameters
xmlStringThe input string.
basePathIf file tags are given, the base path for searching the object files can be specified.

◆ createObstacleFromString()

VirtualRobot::ObstaclePtr VirtualRobot::ObjectIO::createObstacleFromString ( const std::string &  xmlString,
const std::string &  basePath = "" 
)
static

Creates Obstacle from string.

Parameters
xmlStringThe input string.
basePathIf file tags are given, the base path for searching the object files can be specified.

◆ loadManipulationObject() [1/4]

VirtualRobot::ManipulationObjectPtr VirtualRobot::ObjectIO::loadManipulationObject ( const std::string &  xmlFile)
static

Load ManipulationObject from file.

Parameters
xmlFileThe file
Returns
Returns an empty pointer, when file access failed.

◆ loadManipulationObject() [2/4]

static ManipulationObjectPtr VirtualRobot::ObjectIO::loadManipulationObject ( const char *  xmlFile)
inlinestatic

◆ loadManipulationObject() [3/4]

static ManipulationObjectPtr VirtualRobot::ObjectIO::loadManipulationObject ( const std::filesystem::path &  xmlFile)
inlinestatic

◆ loadManipulationObject() [4/4]

VirtualRobot::ManipulationObjectPtr VirtualRobot::ObjectIO::loadManipulationObject ( const std::ifstream &  xmlFile,
const std::string &  basePath = "" 
)
static

Load ManipulationObject from a file stream.

Parameters
xmlFileThe file stream
basePathIf file tags are given, the base path for searching the object files can be specified.
Returns
Returns an empty pointer, when file access failed.

◆ loadObstacle() [1/2]

VirtualRobot::ObstaclePtr VirtualRobot::ObjectIO::loadObstacle ( const std::string &  xmlFile)
static

Load Obstacle from file.

Parameters
xmlFileThe file
Returns
Returns an empty pointer, when file access failed.

◆ loadObstacle() [2/2]

VirtualRobot::ObstaclePtr VirtualRobot::ObjectIO::loadObstacle ( const std::ifstream &  xmlFile,
const std::string &  basePath = "" 
)
static

Load Obstacle from a file stream.

Parameters
xmlFileThe file stream
basePathIf file tags are given, the base path for searching the object files can be specified.
Returns
Returns an empty pointer, when file access failed.

◆ processManipulationObject()

ManipulationObjectPtr VirtualRobot::ObjectIO::processManipulationObject ( rapidxml::xml_node< char > *  objectXMLNode,
const std::string &  basePath 
)
static

◆ processObstacle()

ObstaclePtr VirtualRobot::ObjectIO::processObstacle ( rapidxml::xml_node< char > *  objectXMLNode,
const std::string &  basePath 
)
static

◆ processSceneRobot()

static bool VirtualRobot::ObjectIO::processSceneRobot ( rapidxml::xml_node< char > *  sceneXMLNode,
ScenePtr  scene,
const std::string &  basePath 
)
staticprotected

◆ saveManipulationObject()

bool VirtualRobot::ObjectIO::saveManipulationObject ( ManipulationObjectPtr  object,
const std::string &  xmlFile 
)
static

Save ManipulationObject to file.

Parameters
objectThe object
xmlFileThe file
Returns
Returns true on success.

◆ writeSTL()

bool VirtualRobot::ObjectIO::writeSTL ( TriMeshModelPtr  t,
const std::string &  filename,
const std::string &  objectName,
float  scaling = 0.001f 
)
static

writeSTL Write ascii stl file.

Parameters
t
filename
objectName
scalingUsually we scale from the internal mm format to m.
Returns
true on success

Friends And Related Function Documentation

◆ SceneIO

friend class SceneIO
friend