RobWorkProject  24.12.4-
Public Types | Public Member Functions | Static Public Member Functions | List of all members
AssemblyResult Class Reference

A specification of the result from an execution of an AssemblyTask. More...

#include <AssemblyResult.hpp>

Public Types

enum  Error { NONE , SIMULATION_ERROR , OTHER }
 Different error codes. More...
 
typedef rw::core::Ptr< AssemblyResultPtr
 smart pointer type to this class
 
typedef enum rwlibs::assembly::AssemblyResult::Error Error
 Different error codes.
 

Public Member Functions

 AssemblyResult ()
 Constructor for empty result.
 
 AssemblyResult (rw::core::Ptr< rwlibs::task::CartesianTask > task)
 Construct result from a CartesianTask representation. More...
 
virtual ~AssemblyResult ()
 Destructor.
 
AssemblyResult::Ptr clone () const
 Clone the result. More...
 
rw::core::Ptr< rwlibs::task::CartesianTasktoCartesianTask ()
 Convert to the CartesianTask format. More...
 

Static Public Member Functions

static void saveRWResult (AssemblyResult::Ptr result, const std::string &name)
 Store a result to a file. More...
 
static void saveRWResult (std::vector< AssemblyResult::Ptr > results, const std::string &name)
 Store a list of results to a file. More...
 
static std::vector< AssemblyResult::Ptrload (const std::string &name)
 Load a list of results from a file. More...
 
static std::vector< AssemblyResult::Ptrload (std::istringstream &inputStream)
 Load a list of results from a input stream. More...
 
static std::string toString (const Error &error)
 Convert an error to string format. More...
 
static Error toError (const std::string &string)
 Convert a string to a specific error. More...
 

Public Attributes

Mandatory settings

These values should always be set in an assembly result.

bool success
 True or false depending on if the two objects where assembled as specified in the task.
 
Error error
 Indication of an error.
 
rw::math::Transform3D femaleTmaleEnd
 The final relative transformation between the objects (with respect to the TCP frames set in the task).
 
Context & Metadata (optional)

Information about the context of the task, and additional information.

std::string taskID
 The id of the task.
 
std::string resultID
 An id of this result.
 
Additional data (optional)

Extra detailed data about the trajectory followed.

rw::trajectory::Path< rw::trajectory::Timed< AssemblyState > > realState
 A TimedPath of AssemblyState objects for the real trajectory.
 
rw::trajectory::Path< rw::trajectory::Timed< AssemblyState > > assumedState
 A TimedPath of AssemblyState objects for the assumed trajectory.
 
rw::math::Transform3D approach
 The approach pose used.
 
std::string errorMessage
 Detailed error message.
 

Detailed Description

A specification of the result from an execution of an AssemblyTask.

The class provides serialization through the CartesianTask format.

Member Enumeration Documentation

◆ Error

enum Error

Different error codes.

Enumerator
NONE 

No error.

SIMULATION_ERROR 

Failure of physics engine.

OTHER 

Other unspecified error.

Constructor & Destructor Documentation

◆ AssemblyResult()

Construct result from a CartesianTask representation.

Parameters
task[in] the CartesianTask to construct result from.

Member Function Documentation

◆ clone()

AssemblyResult::Ptr clone ( ) const

Clone the result.

Returns
a new cloned result.

◆ load() [1/2]

static std::vector<AssemblyResult::Ptr> load ( const std::string &  name)
static

Load a list of results from a file.

Parameters
name[in] the file to load from.
Returns
a list of results.

◆ load() [2/2]

static std::vector<AssemblyResult::Ptr> load ( std::istringstream &  inputStream)
static

Load a list of results from a input stream.

Parameters
inputStream[in] the stream to load from.
Returns
a list of results.

◆ saveRWResult() [1/2]

static void saveRWResult ( AssemblyResult::Ptr  result,
const std::string &  name 
)
static

Store a result to a file.

Parameters
result[in] the result to store.
name[in] the file to save to (normally with the extension .assembly.xml).

◆ saveRWResult() [2/2]

static void saveRWResult ( std::vector< AssemblyResult::Ptr results,
const std::string &  name 
)
static

Store a list of results to a file.

Parameters
results[in] the list of results to store.
name[in] the file to save to (normally with the extension .assembly.xml).

◆ toCartesianTask()

Convert to the CartesianTask format.

Returns
a CartesianTask representing the AssemblyResult.

◆ toError()

static Error toError ( const std::string &  string)
static

Convert a string to a specific error.

Parameters
string[in] the string to convert.
Returns
an error enum.

◆ toString()

static std::string toString ( const Error error)
static

Convert an error to string format.

Parameters
error[in] the error to convert.
Returns
a string representation.

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