Public Member Functions | Protected Member Functions
GraspIt::GraspItDatabaseManager Class Reference

Superclass for all interfaces which want to access the GraspIt world for database management purposes. More...

#include <GraspItDatabaseManager.h>

Inheritance diagram for GraspIt::GraspItDatabaseManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void getAllLoadedObjectIDs (std::vector< int > &ids) const =0
virtual void getAllLoadedObjectNames (std::vector< std::string > &names) const =0
virtual void getAllLoadedRobotIDs (std::vector< int > &ids) const =0
virtual void getAllLoadedRobotNames (std::vector< std::string > &names) const =0
virtual bool getModelNameAndType (const int modelID, std::string &name, bool &isRobot) const =0
virtual bool getObjectModelID (const std::string &objectName, int &id) const =0
virtual bool getRobotJointNames (const std::string &robotName, std::vector< std::string > &jointNames) const =0
virtual bool getRobotModelID (const std::string &robotName, int &id) const =0
 GraspItDatabaseManager (const std::string &name, const SHARED_PTR< GraspItSceneManager > &interface)
int isModelLoaded (const int modelID) const
virtual int loadObjectToDatabase (const std::string &filename, const std::string &objectName, const bool asGraspable)=0
int loadObjectToWorld (const std::string &objectName, const EigenTransform &transform)
virtual int loadRobotToDatabase (const std::string &filename, const std::string &robotName, const std::vector< std::string > &jointNames)=0
int loadRobotToWorld (const std::string &robotName, const EigenTransform &transform)
int loadToWorld (const int modelID, const EigenTransform &transform)
bool saveLoadedWorld (const std::string &filename, const bool asInventor, const bool createDir=false)
int unloadFromWorld (const int modelID)
int unloadObjectFromWorld (const std::string &objectName)
int unloadRobotFromWorld (const std::string &robotName)
virtual ~GraspItDatabaseManager ()

Protected Member Functions

virtual int getModelType (const int modelID) const =0
virtual Body * getObjectFromDatabase (const std::string &objectName)=0
virtual Body * getObjectFromDatabase (const int modelID)=0
virtual Robot * getRobotFromDatabase (const std::string &robotName)=0
virtual Robot * getRobotFromDatabase (const int modelID)=0
virtual void idleEventFromSceneManager ()=0
virtual void onSceneManagerShutdown ()=0

Detailed Description

Superclass for all interfaces which want to access the GraspIt world for database management purposes.

This interface identifies robots and objects with names (strings) which have to be unique among all robots and among all objects. The names identify a particular robot/object, so several robots or objects of same type can be maintained with different names.

When an object or robot is added to the database, they also get a uniqe model int ID which can be used to access the model, independent of the fact whether it is a robot or an object. The int id's are unique among *both* robots and objects.

In ROS moveit_msgs/GraspPlanning.srv, a body (object/obstacle) has an int ID (see also moveit_msgs/CollisionObject.msg) and a robot/hand has a string name. This interface allows to handle both of these conventions. While robots will then also have an int id, and objects also a string name, it is optional to the user of this interface which of the identifiers to use.

This interface allows to:

Author:
Jennifer Buehler
Date:
January 2016

Definition at line 63 of file GraspItDatabaseManager.h.


Constructor & Destructor Documentation

GraspIt::GraspItDatabaseManager::GraspItDatabaseManager ( const std::string &  name,
const SHARED_PTR< GraspItSceneManager > &  interface 
) [inline]
Parameters:
namethe name of this GraspItDatabaseManager object

Definition at line 69 of file GraspItDatabaseManager.h.

Definition at line 73 of file GraspItDatabaseManager.h.


Member Function Documentation

virtual void GraspIt::GraspItDatabaseManager::getAllLoadedObjectIDs ( std::vector< int > &  ids) const [pure virtual]

Adds the ids of all objects currently loaded in the GraspIt world in the vector Does not clear the vector!

Implemented in GraspIt::GraspItSimpleDBManager.

virtual void GraspIt::GraspItDatabaseManager::getAllLoadedObjectNames ( std::vector< std::string > &  names) const [pure virtual]

Adds the names of all objects currently loaded in the GraspIt world in the vector Does not clear the vector!

Implemented in GraspIt::GraspItSimpleDBManager.

virtual void GraspIt::GraspItDatabaseManager::getAllLoadedRobotIDs ( std::vector< int > &  ids) const [pure virtual]

Adds the ids of all robots currently loaded in the GraspIt world in the vector Does not clear the vector!

Implemented in GraspIt::GraspItSimpleDBManager.

virtual void GraspIt::GraspItDatabaseManager::getAllLoadedRobotNames ( std::vector< std::string > &  names) const [pure virtual]

Adds the names of all robots currently loaded in the GraspIt world in the vector. Does not clear the vector!

Implemented in GraspIt::GraspItSimpleDBManager.

virtual bool GraspIt::GraspItDatabaseManager::getModelNameAndType ( const int  modelID,
std::string &  name,
bool &  isRobot 
) const [pure virtual]

Returns the name and type of the model with this ID which is also used in the GraspIt world.

Parameters:
isRobottrue if model is a robot, false if it is an object.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual int GraspIt::GraspItDatabaseManager::getModelType ( const int  modelID) const [protected, pure virtual]

Checks whether this model ID is a robot or an object

Return values:
2is an object
1is a robot
-1does not exist

Implemented in GraspIt::GraspItSimpleDBManager.

virtual Body* GraspIt::GraspItDatabaseManager::getObjectFromDatabase ( const std::string &  objectName) [protected, pure virtual]

Retrieves the Body object from the database, if it exists in there.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual Body* GraspIt::GraspItDatabaseManager::getObjectFromDatabase ( const int  modelID) [protected, pure virtual]

Retrieves the Body object from the database, if it exists in there.

Returns:
return NULL if not in the database, or a robot and not an object.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual bool GraspIt::GraspItDatabaseManager::getObjectModelID ( const std::string &  objectName,
int &  id 
) const [pure virtual]
Parameters:
idthe model ID of the object with this name
Returns:
false if this object is not in the database.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual Robot* GraspIt::GraspItDatabaseManager::getRobotFromDatabase ( const std::string &  robotName) [protected, pure virtual]

Retrieves the Robot object from the database, if it exists in there.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual Robot* GraspIt::GraspItDatabaseManager::getRobotFromDatabase ( const int  modelID) [protected, pure virtual]

Retrieves the Robot object from the database, if it exists in there.

Returns:
return NULL if not in the database, or an object and not a robot.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual bool GraspIt::GraspItDatabaseManager::getRobotJointNames ( const std::string &  robotName,
std::vector< std::string > &  jointNames 
) const [pure virtual]

Returns the joint names for this robot as used in loadRobotToDatabase(). These are all joints that are involved in resulting grasps, so mostly these are only the fingers.

Returns:
false if this robot is not in the database.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual bool GraspIt::GraspItDatabaseManager::getRobotModelID ( const std::string &  robotName,
int &  id 
) const [pure virtual]
Parameters:
idthe model ID of the robot with this name
Returns:
false if this robot is not in the database.

Implemented in GraspIt::GraspItSimpleDBManager.

virtual void GraspIt::GraspItDatabaseManager::idleEventFromSceneManager ( ) [protected, pure virtual]

This class is meant to remain abstract. Subclasses can decide whether they need access to the inventor thread.

Implements GraspIt::GraspItAccessor.

Implemented in GraspIt::GraspItSimpleDBManager.

int GraspItDatabaseManager::isModelLoaded ( const int  modelID) const

Checks if this model is currently loaded in the graspit world

Return values:
1model is loaded
0model is not loaded
-1model ID could not be found in database

Definition at line 223 of file GraspItDatabaseManager.cpp.

virtual int GraspIt::GraspItDatabaseManager::loadObjectToDatabase ( const std::string &  filename,
const std::string &  objectName,
const bool  asGraspable 
) [pure virtual]

Loads an object from XML file and adds it to the database. See also GraspItSceneManager::loadObject(). After it has been loaded to the database, it is open to the actual GraspItDatabaseManager implementation wheter the object is left in the graspit world, or removed from it.

Parameters:
objectNamethe name to store this object with, and also the name to use for this object in the graspit world.
Return values:
>=0success, and returns int ID of this model (model IDs are for robots and objects)
-1failed to load world with graspit source.
-2graspit not initialized.
-3file does not exist.
-4could not add object to database because it already exists
-5no object name specified
-6other error when adding the object to the database.

Implemented in GraspIt::GraspItSimpleDBManager.

int GraspItDatabaseManager::loadObjectToWorld ( const std::string &  objectName,
const EigenTransform transform 
)

Loads this object into the GraspIt world

Return values:
0success
-1object not in database
-2graspit not initialized or other error adding robot to graspIt

Definition at line 50 of file GraspItDatabaseManager.cpp.

virtual int GraspIt::GraspItDatabaseManager::loadRobotToDatabase ( const std::string &  filename,
const std::string &  robotName,
const std::vector< std::string > &  jointNames 
) [pure virtual]

Loads robot (hand) from XML file and adds it to the database. See also GraspItSceneManager::loadRobot(). After it has been loaded to the database, it is open to the actual GraspItDatabaseManager implementation wheter the robot is left in the graspit world, or removed from it.

Parameters:
robotNamethe name to store this robot with, and also the name to use for this robot in the graspit world.
jointNamesThe URDF names of the joints in the order as they appear in the graspit file These are all joints that are involved in resulting grasps, so mostly these are only the fingers.
Return values:
>=0success, and returns int ID of this model (model IDs are for robots and objects)
-1failed to load world with graspit source.
-2graspit not initialized.
-3file does not exist.
-4could not add robot to database because it already exists
-5no robot name specified
-6other error when adding the robot to the database.

Implemented in GraspIt::GraspItSimpleDBManager.

int GraspItDatabaseManager::loadRobotToWorld ( const std::string &  robotName,
const EigenTransform transform 
)

Loads this robot into the GraspIt world

Return values:
0success
-1robot not in database
-2graspit not initialized or other error adding robot to graspIt

Definition at line 31 of file GraspItDatabaseManager.cpp.

int GraspItDatabaseManager::loadToWorld ( const int  modelID,
const EigenTransform transform 
)

loads the model with this ID (returned by load*ToDatabase() functions) into the graspit world

Return values:
0success
-1model not in database
-2graspit not initialized or other error adding robot to graspIt

Definition at line 69 of file GraspItDatabaseManager.cpp.

virtual void GraspIt::GraspItDatabaseManager::onSceneManagerShutdown ( ) [protected, pure virtual]

This class is meant to remain abstract. Subclasses can decide whether they need access to the inventor thread.

Implements GraspIt::GraspItAccessor.

Implemented in GraspIt::GraspItSimpleDBManager.

bool GraspItDatabaseManager::saveLoadedWorld ( const std::string &  filename,
const bool  asInventor,
const bool  createDir = false 
)

Save the currently loaded world in the given file

Parameters:
asInventorif true, the world is going to be saved as inventor file. Otherwise, it will be saved as $GraspIt XML world file.
createDirif true, the directory in which the file is to be saved is created if it does not exist.

Definition at line 191 of file GraspItDatabaseManager.cpp.

int GraspItDatabaseManager::unloadFromWorld ( const int  modelID)

Unloads this robot or object from the graspit world

Return values:
0success
-1model not loaded in the world
-2model not in the database
-3graspit not initialized or other error removing the model from graspit

Definition at line 137 of file GraspItDatabaseManager.cpp.

int GraspItDatabaseManager::unloadObjectFromWorld ( const std::string &  objectName)

Unloads this object from the graspit world

Return values:
0success
-1object not loaded in the world
-2object not in the database
-3graspit not initialized or other error removing the object from graspit

Definition at line 126 of file GraspItDatabaseManager.cpp.

int GraspItDatabaseManager::unloadRobotFromWorld ( const std::string &  robotName)

Unloads this robot from the graspit world

Return values:
0success
-1robot not loaded in the world
-2robot not in the database
-3graspit not initialized or other error removing the robot from graspIt

Definition at line 115 of file GraspItDatabaseManager.cpp.


The documentation for this class was generated from the following files:


grasp_planning_graspit
Author(s): Jennifer Buehler
autogenerated on Wed May 8 2019 02:53:36