RobWorkProject
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GraspTask Class Reference

A container for describing one or multiple grasping tasks. It is based on the rwlibs::tasks library. More...

#include <GraspTask.hpp>

Public Types

typedef rw::common::Ptr< GraspTaskPtr
 Smart pointer to this type of class.
 
typedef GraspResult::TestStatus TestStatus
 

Public Member Functions

 GraspTask ()
 Default constructor.
 
 GraspTask (rwlibs::task::CartesianTask::Ptr task)
 Constructs task from CartesianTask.
 
rwlibs::task::CartesianTask::Ptr toCartesianTask ()
 Converts GraspTask to CartesianTask.
 
std::string getGripperID ()
 
std::string getTCPID ()
 
std::string getGraspControllerID ()
 
void setGripperID (const std::string &id)
 
void setTCPID (const std::string &id)
 
void setGraspControllerID (const std::string &id)
 
void addSubTask (class GraspSubTask &stask)
 
std::vector< class GraspSubTask > & getSubTasks ()
 
void filterTasks (std::vector< GraspResult::TestStatus > &includeMask)
 Filters targets of the task to include only those whose status is included in the filtering mask. New target list is created for the task, including only targets whose status matches one of the provided in the includeMask.
 
std::vector< std::pair< class GraspSubTask *, class GraspTarget * > > getAllTargets ()
 Iterates the grasptask and assemble all targets and the GraspSubTask that they are associated to. More...
 
GraspTask::Ptr clone ()
 makes the copy of a task More...
 

Static Public Member Functions

static std::string toString (GraspResult::TestStatus status)
 Returns textual representation of given TestStatus. More...
 
static void saveUIBK (GraspTask::Ptr task, const std::string &name)
 save as UIBK format More...
 
static void saveRWTask (GraspTask::Ptr task, const std::string &name)
 
static void saveRWTask (GraspTask::Ptr task, std::ostream &stream)
 Save a task in RobWork XML format. More...
 
static void saveText (GraspTask::Ptr task, const std::string &name)
 save grasp task in a comma seperated format More...
 
static GraspTask::Ptr load (const std::string &name)
 load a GraspTask from file More...
 
static GraspTask::Ptr load (std::istringstream &inputStream)
 load a GraspTask from istream More...
 

Detailed Description

A container for describing one or multiple grasping tasks. It is based on the rwlibs::tasks library.

Definition of GraspTask xml format

GraspTask

Member Typedef Documentation

◆ TestStatus

Defines outcome of a single grasp result.

Deprecated:
Use GraspResult::TestStatus instead.

Member Function Documentation

◆ clone()

GraspTask::Ptr clone ( )
inline

makes the copy of a task

Copies over only the gripper ID, tcp ID, and the grasp controller ID. Targets are NOT copied.

◆ getAllTargets()

std::vector<std::pair<class GraspSubTask*, class GraspTarget*> > getAllTargets ( )

Iterates the grasptask and assemble all targets and the GraspSubTask that they are associated to.

Returns
vector of subtask and target pairs.

◆ load() [1/2]

static GraspTask::Ptr load ( const std::string &  name)
static

load a GraspTask from file

Parameters
name
Returns

◆ load() [2/2]

static GraspTask::Ptr load ( std::istringstream &  inputStream)
static

load a GraspTask from istream

Parameters
inputStream
Returns

◆ saveRWTask() [1/2]

static void saveRWTask ( GraspTask::Ptr  task,
const std::string &  name 
)
static
Parameters
task
name

◆ saveRWTask() [2/2]

static void saveRWTask ( GraspTask::Ptr  task,
std::ostream &  stream 
)
static

Save a task in RobWork XML format.

Parameters
task[in] the task to write.
stream[out] the stream to write to.

◆ saveText()

static void saveText ( GraspTask::Ptr  task,
const std::string &  name 
)
static

save grasp task in a comma seperated format

Parameters
task
name

◆ saveUIBK()

static void saveUIBK ( GraspTask::Ptr  task,
const std::string &  name 
)
static

save as UIBK format

Parameters
task
name

◆ toString()

static std::string toString ( GraspResult::TestStatus  status)
inlinestatic

Returns textual representation of given TestStatus.

Deprecated:
Use GraspResult::toString() method instead.

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