Reads and writes URDF and GraspIt! files to disk. More...
#include <FileIO.h>
Public Types | |
typedef baselib_binding::shared_ptr < GraspItConversionResultT > ::type | GraspItConversionResultPtr |
typedef urdf2graspit::ConversionResult | GraspItConversionResultT |
Public Member Functions | |
FileIO (const std::string &_outputDir, const OutputStructure &_outStructure) | |
bool | writeContacts (const std::string &robotName, const std::string &content, const std::string &useFilename) const |
~FileIO () | |
Protected Member Functions | |
std::string | getRobotDir (const std::string &robotName) const |
bool | initGraspItRobotDir (const std::string &robotName, std::string &robotDir) const |
virtual bool | initOutputDirImpl (const std::string &robotName) const |
bool | writeEigen (const std::string &robotName, const std::string &content) const |
bool | writeGraspitMeshFiles (const std::map< std::string, std::string > &meshDescXML) const |
virtual bool | writeImpl (const ConversionResultPtr &data) const |
bool | writeRobotXML (const std::string &robotName, const std::string &content) const |
bool | writeWorldFileTemplate (const std::string &robotName, const std::string &content) const |
Protected Attributes | |
OutputStructure | outStructure |
Private Types | |
typedef urdf2inventor::FileIO < std::string > | ParentT |
Reads and writes URDF and GraspIt! files to disk.
typedef baselib_binding::shared_ptr<GraspItConversionResultT>::type urdf2graspit::FileIO::GraspItConversionResultPtr |
typedef urdf2inventor::FileIO<std::string> urdf2graspit::FileIO::ParentT [private] |
urdf2graspit::FileIO::FileIO | ( | const std::string & | _outputDir, |
const OutputStructure & | _outStructure | ||
) | [inline, explicit] |
_outputDir | directory where to save the files. Within this directory, a sub-directory "models/robot/<robotName>" is created, in which all files are saved. Also, within this directory, a file worlds/{robotName}_world.xml is created which can be used as starting point for world files. |
urdf2graspit::FileIO::~FileIO | ( | ) | [inline, virtual] |
Reimplemented from urdf2inventor::FileIO< std::string >.
std::string urdf2graspit::FileIO::getRobotDir | ( | const std::string & | robotName | ) | const [protected] |
Definition at line 59 of file FileIO.cpp.
bool urdf2graspit::FileIO::initGraspItRobotDir | ( | const std::string & | robotName, |
std::string & | robotDir | ||
) | const [protected] |
Creates the standard GraspIt! directory structure for the robot. in the desired output directory (passed in constructor).
robotDir | the path to the robot directory created (on success) will be returned here. This is the root directory where all the files (robot, constact, eigen, etc.) for this robot will be generated. |
Definition at line 35 of file FileIO.cpp.
bool urdf2graspit::FileIO::initOutputDirImpl | ( | const std::string & | robotName | ) | const [protected, virtual] |
Copyright (C) 2015 Jennifer Buehler
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Reimplemented from urdf2inventor::FileIO< std::string >.
Definition at line 29 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeContacts | ( | const std::string & | robotName, |
const std::string & | content, | ||
const std::string & | useFilename | ||
) | const |
if useName is not empty, use this filename instead of the default determined by OutputStructure set in the constructor.
Definition at line 110 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeEigen | ( | const std::string & | robotName, |
const std::string & | content | ||
) | const [protected] |
Definition at line 91 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeGraspitMeshFiles | ( | const std::map< std::string, std::string > & | meshDescXML | ) | const [protected] |
Definition at line 66 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeImpl | ( | const ConversionResultPtr & | data | ) | const [protected, virtual] |
Reimplemented from urdf2inventor::FileIO< std::string >.
Definition at line 156 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeRobotXML | ( | const std::string & | robotName, |
const std::string & | content | ||
) | const [protected] |
Definition at line 126 of file FileIO.cpp.
bool urdf2graspit::FileIO::writeWorldFileTemplate | ( | const std::string & | robotName, |
const std::string & | content | ||
) | const [protected] |
Definition at line 141 of file FileIO.cpp.
OutputStructure urdf2graspit::FileIO::outStructure [protected] |