GraspTrajectory Class Reference

#include <RobotAPI/libraries/diffik/GraspTrajectory.h>

Classes

class  Keypoint
 
struct  Length
 

Public Types

using Keypoint = GraspTrajectoryKeypoint
 
typedef std::shared_ptr< KeypointKeypointPtr
 
using KeypointPtr = std::shared_ptr< Keypoint >
 

Public Member Functions

void addKeypoint (const Eigen::Matrix4f &tcpTarget, const armarx::NameValueMap &handJointsTarget, float dt, const std::optional< std::string > &shape=std::nullopt)
 
void addKeypoint (const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
 
Length calculateLength () const
 
Length calculateLength () const
 
SimpleDiffIK::Reachability calculateReachability (VirtualRobot::RobotNodeSetPtr rns, VirtualRobot::RobotNodePtr tcp=VirtualRobot::RobotNodePtr(), SimpleDiffIK::Parameters params=SimpleDiffIK::Parameters())
 
SimpleDiffIK::Reachability calculateReachability (VirtualRobot::RobotNodeSetPtr rns, VirtualRobot::RobotNodePtr tcp=VirtualRobot::RobotNodePtr(), SimpleDiffIK::Parameters params=SimpleDiffIK::Parameters())
 
std::vector< Eigen::Matrix3f > getAllKeypointOrientations ()
 
std::vector< Eigen::Matrix3f > getAllKeypointOrientations () const
 
std::vector< Eigen::Matrix4f > getAllKeypointPoses ()
 
std::vector< Eigen::Matrix4f > getAllKeypointPoses () const
 
std::vector< Eigen::Vector3f > getAllKeypointPositions ()
 
std::vector< Eigen::Vector3f > getAllKeypointPositions () const
 
const std::vector< KeypointPtr > & getAllKeypoints () const
 
GraspTrajectoryPtr getClone ()
 
GraspTrajectoryPtr getClone () const
 
float getDuration () const
 
float getDuration () const
 
const std::optional< std::string > & getFrame () const
 
int GetHandJointCount () const
 
Eigen::VectorXf GetHandJointsDerivative (float t)
 
Eigen::Vector3f GetHandJointsDerivative (float t) const
 
Eigen::VectorXf GetHandValues (float t)
 
armarx::NameValueMap GetHandValues (float t) const
 
void getIndex (float t, int &i1, int &i2, float &f)
 
void getIndex (float t, int &i1, int &i2, float &f) const
 
KeypointPtrgetKeypoint (int i)
 
const KeypointPtrgetKeypoint (int i) const
 
size_t getKeypointCount () const
 
size_t getKeypointCount () const
 
Eigen::Matrix3f GetOrientation (float t)
 
Eigen::Matrix3f GetOrientation (float t) const
 
Eigen::Vector3f GetOrientationDerivative (float t)
 
Eigen::Vector3f GetOrientationDerivative (float t) const
 
Eigen::Matrix4f GetPose (float t)
 
Eigen::Matrix4f GetPose (float t) const
 
Eigen::Vector3f GetPosition (float t)
 
Eigen::Vector3f GetPosition (float t) const
 
Eigen::Vector3f GetPositionDerivative (float t)
 
Eigen::Vector3f GetPositionDerivative (float t) const
 
std::optional< std::string > GetShape (float t) const
 
Eigen::Matrix4f getStartPose ()
 
Eigen::Matrix4f getStartPose () const
 
Eigen::Vector6f GetTcpDerivative (float t)
 
Eigen::Matrix< float, 6, 1 > GetTcpDerivative (float t) const
 
GraspTrajectoryPtr getTransformed (const Eigen::Matrix4f &transform)
 
GraspTrajectoryPtr getTransformed (const Eigen::Matrix4f &transform) const
 
GraspTrajectoryPtr getTransformedToGraspPose (const Eigen::Matrix4f &target, const Eigen::Vector3f &handForward=Eigen::Vector3f::UnitZ())
 
GraspTrajectoryPtr getTransformedToGraspPose (const Eigen::Matrix4f &target, const Eigen::Vector3f &handForward=Eigen::Vector3f::UnitZ()) const
 
GraspTrajectoryPtr getTransformedToOtherHand () const
 
GraspTrajectoryPtr getTranslatedAndRotated (const Eigen::Vector3f &translation, const Eigen::Matrix3f &rotation)
 
GraspTrajectoryPtr getTranslatedAndRotated (const Eigen::Vector3f &translation, const Eigen::Matrix3f &rotation) const
 
 GraspTrajectory ()=default
 
 GraspTrajectory (const Eigen::Matrix4f &tcpStart, const armarx::NameValueMap &handJointsStart, const std::optional< std::string > &shape=std::nullopt)
 
 GraspTrajectory (const Eigen::Matrix4f &tcpStart, const Eigen::VectorXf &handJointsStart)
 
 GraspTrajectory (const std::vector< Keypoint > &keypoints)
 
void insertKeypoint (size_t index, const Eigen::Matrix4f &tcpTarget, const armarx::NameValueMap &handJointsTarget, float dt, const std::optional< std::string > &shape=std::nullopt)
 
void insertKeypoint (size_t index, const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
 
KeypointPtrlastKeypoint ()
 
const KeypointPtrlastKeypoint () const
 
void removeKeypoint (size_t index)
 
void removeKeypoint (size_t index)
 
void replaceKeypoint (size_t index, const Eigen::Matrix4f &tcpTarget, const armarx::NameValueMap &handJointsTarget, float dt, const std::optional< std::string > &shape=std::nullopt)
 
void replaceKeypoint (size_t index, const Eigen::Matrix4f &tcpTarget, const Eigen::VectorXf &handJointsTarget, float dt)
 
void setFrame (const std::string &frame)
 
void setKeypointDt (size_t index, float dt)
 
void setKeypointDt (size_t index, float dt)
 
void writeToFile (const std::string &filename)
 
void writeToFile (const std::string &filename)
 

Static Public Member Functions

static GraspTrajectoryPtr ReadFromFile (const grasping::GraspCandidatePtr &cnd)
 
static GraspTrajectoryPtr ReadFromFile (const std::string &filename)
 
static GraspTrajectoryPtr ReadFromFile (const std::string &filename)
 
static GraspTrajectoryPtr ReadFromJSON (const std::string &filename)
 
static GraspTrajectoryPtr ReadFromReader (const RapidXmlReaderPtr &reader)
 
static GraspTrajectoryPtr ReadFromReader (const RapidXmlReaderPtr &reader)
 
static GraspTrajectoryPtr ReadFromString (const std::string &xml)
 
static GraspTrajectoryPtr ReadFromString (const std::string &xml)
 

Detailed Description

Definition at line 53 of file GraspTrajectory.h.

Member Typedef Documentation

◆ Keypoint

Definition at line 80 of file GraspTrajectory.h.

◆ KeypointPtr [1/2]

typedef std::shared_ptr<Keypoint> KeypointPtr

Definition at line 56 of file GraspTrajectory.h.

◆ KeypointPtr [2/2]

using KeypointPtr = std::shared_ptr<Keypoint>

Definition at line 81 of file GraspTrajectory.h.

Constructor & Destructor Documentation

◆ GraspTrajectory() [1/4]

GraspTrajectory ( const Eigen::Matrix4f &  tcpStart,
const Eigen::VectorXf &  handJointsStart 
)

Definition at line 80 of file GraspTrajectory.cpp.

◆ GraspTrajectory() [2/4]

GraspTrajectory ( )
default
+ Here is the caller graph for this function:

◆ GraspTrajectory() [3/4]

GraspTrajectory ( const std::vector< Keypoint > &  keypoints)

Definition at line 247 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GraspTrajectory() [4/4]

GraspTrajectory ( const Eigen::Matrix4f &  tcpStart,
const armarx::NameValueMap &  handJointsStart,
const std::optional< std::string > &  shape = std::nullopt 
)

Definition at line 237 of file GraspTrajectory.cpp.

Member Function Documentation

◆ addKeypoint() [1/2]

void addKeypoint ( const Eigen::Matrix4f &  tcpTarget,
const armarx::NameValueMap &  handJointsTarget,
float  dt,
const std::optional< std::string > &  shape = std::nullopt 
)

Definition at line 267 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ addKeypoint() [2/2]

void addKeypoint ( const Eigen::Matrix4f &  tcpTarget,
const Eigen::VectorXf &  handJointsTarget,
float  dt 
)

Definition at line 87 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateLength() [1/2]

GraspTrajectory::Length calculateLength ( ) const

Definition at line 307 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ calculateLength() [2/2]

Length calculateLength ( ) const

◆ calculateReachability() [1/2]

SimpleDiffIK::Reachability calculateReachability ( VirtualRobot::RobotNodeSetPtr  rns,
VirtualRobot::RobotNodePtr  tcp = VirtualRobot::RobotNodePtr(),
SimpleDiffIK::Parameters  params = SimpleDiffIK::Parameters() 
)

Definition at line 373 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ calculateReachability() [2/2]

SimpleDiffIK::Reachability calculateReachability ( VirtualRobot::RobotNodeSetPtr  rns,
VirtualRobot::RobotNodePtr  tcp = VirtualRobot::RobotNodePtr(),
SimpleDiffIK::Parameters  params = SimpleDiffIK::Parameters() 
)

◆ getAllKeypointOrientations() [1/2]

std::vector< Eigen::Matrix3f > getAllKeypointOrientations ( )

Definition at line 251 of file GraspTrajectory.cpp.

◆ getAllKeypointOrientations() [2/2]

std::vector<Eigen::Matrix3f> getAllKeypointOrientations ( ) const

◆ getAllKeypointPoses() [1/2]

std::vector< Eigen::Matrix4f > getAllKeypointPoses ( )

Definition at line 231 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ getAllKeypointPoses() [2/2]

std::vector<Eigen::Matrix4f> getAllKeypointPoses ( ) const

◆ getAllKeypointPositions() [1/2]

std::vector< Eigen::Vector3f > getAllKeypointPositions ( )

Definition at line 241 of file GraspTrajectory.cpp.

◆ getAllKeypointPositions() [2/2]

std::vector<Eigen::Vector3f> getAllKeypointPositions ( ) const

◆ getAllKeypoints()

const std::vector< GraspTrajectory::KeypointPtr > & getAllKeypoints ( ) const

Definition at line 289 of file GraspTrajectory.cpp.

◆ getClone() [1/2]

GraspTrajectoryPtr getClone ( )

Definition at line 354 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getClone() [2/2]

GraspTrajectoryPtr getClone ( ) const

◆ getDuration() [1/2]

float getDuration ( ) const

Definition at line 302 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ getDuration() [2/2]

float getDuration ( ) const

◆ getFrame()

const std::optional< std::string > & getFrame ( ) const

Definition at line 777 of file GraspTrajectory.cpp.

◆ GetHandJointCount()

int GetHandJointCount ( ) const

Definition at line 327 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ GetHandJointsDerivative() [1/2]

Eigen::VectorXf GetHandJointsDerivative ( float  t)

Definition at line 294 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetHandJointsDerivative() [2/2]

Eigen::Vector3f GetHandJointsDerivative ( float  t) const

Definition at line 550 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetHandValues() [1/2]

Eigen::VectorXf GetHandValues ( float  t)

Definition at line 261 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetHandValues() [2/2]

armarx::NameValueMap GetHandValues ( float  t) const

Definition at line 489 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getIndex() [1/2]

void getIndex ( float  t,
int &  i1,
int &  i2,
float f 
)

Definition at line 179 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ getIndex() [2/2]

void getIndex ( float  t,
int &  i1,
int &  i2,
float f 
) const

Definition at line 392 of file GraspTrajectory.cpp.

◆ getKeypoint() [1/2]

GraspTrajectory::KeypointPtr & getKeypoint ( int  i)

Definition at line 169 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ getKeypoint() [2/2]

const GraspTrajectory::KeypointPtr & getKeypoint ( int  i) const

Definition at line 378 of file GraspTrajectory.cpp.

◆ getKeypointCount() [1/2]

size_t getKeypointCount ( ) const

Definition at line 98 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ getKeypointCount() [2/2]

size_t getKeypointCount ( ) const

◆ GetOrientation() [1/2]

Eigen::Matrix3f GetOrientation ( float  t)

Definition at line 211 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOrientation() [2/2]

Eigen::Matrix3f GetOrientation ( float  t) const

Definition at line 429 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetOrientationDerivative() [1/2]

Eigen::Vector3f GetOrientationDerivative ( float  t)

Definition at line 278 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOrientationDerivative() [2/2]

Eigen::Vector3f GetOrientationDerivative ( float  t) const

Definition at line 530 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetPose() [1/2]

Eigen::Matrix4f GetPose ( float  t)

Definition at line 226 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetPose() [2/2]

Eigen::Matrix4f GetPose ( float  t) const

Definition at line 446 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetPosition() [1/2]

Eigen::Vector3f GetPosition ( float  t)

Definition at line 203 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPosition() [2/2]

Eigen::Vector3f GetPosition ( float  t) const

Definition at line 418 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetPositionDerivative() [1/2]

Eigen::Vector3f GetPositionDerivative ( float  t)

Definition at line 270 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPositionDerivative() [2/2]

Eigen::Vector3f GetPositionDerivative ( float  t) const

Definition at line 520 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetShape()

std::optional< std::string > GetShape ( float  t) const

Definition at line 508 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getStartPose() [1/2]

Eigen::Matrix4f getStartPose ( )

Definition at line 174 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStartPose() [2/2]

Eigen::Matrix4f getStartPose ( ) const

◆ GetTcpDerivative() [1/2]

Eigen::Vector6f GetTcpDerivative ( float  t)

Definition at line 286 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ GetTcpDerivative() [2/2]

Eigen::Matrix< float, 6, 1 > GetTcpDerivative ( float  t) const

Definition at line 540 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTransformed() [1/2]

GraspTrajectoryPtr getTransformed ( const Eigen::Matrix4f &  transform)

Definition at line 343 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTransformed() [2/2]

GraspTrajectoryPtr getTransformed ( const Eigen::Matrix4f &  transform) const

Definition at line 610 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTransformedToGraspPose() [1/2]

GraspTrajectoryPtr getTransformedToGraspPose ( const Eigen::Matrix4f &  target,
const Eigen::Vector3f &  handForward = Eigen::Vector3f::UnitZ() 
)

Definition at line 359 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTransformedToGraspPose() [2/2]

GraspTrajectoryPtr getTransformedToGraspPose ( const Eigen::Matrix4f &  target,
const Eigen::Vector3f &  handForward = Eigen::Vector3f::UnitZ() 
) const

Definition at line 632 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTransformedToOtherHand()

GraspTrajectoryPtr getTransformedToOtherHand ( ) const

Definition at line 654 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTranslatedAndRotated() [1/2]

GraspTrajectoryPtr getTranslatedAndRotated ( const Eigen::Vector3f &  translation,
const Eigen::Matrix3f &  rotation 
)

Definition at line 332 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ getTranslatedAndRotated() [2/2]

GraspTrajectoryPtr getTranslatedAndRotated ( const Eigen::Vector3f &  translation,
const Eigen::Matrix3f &  rotation 
) const

Definition at line 589 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ insertKeypoint() [1/2]

void insertKeypoint ( size_t  index,
const Eigen::Matrix4f &  tcpTarget,
const armarx::NameValueMap &  handJointsTarget,
float  dt,
const std::optional< std::string > &  shape = std::nullopt 
)

Definition at line 295 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ insertKeypoint() [2/2]

void insertKeypoint ( size_t  index,
const Eigen::Matrix4f &  tcpTarget,
const Eigen::VectorXf &  handJointsTarget,
float  dt 
)

Definition at line 103 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ lastKeypoint() [1/2]

const GraspTrajectory::KeypointPtr & lastKeypoint ( )

Definition at line 164 of file GraspTrajectory.cpp.

+ Here is the caller graph for this function:

◆ lastKeypoint() [2/2]

const KeypointPtr& lastKeypoint ( ) const

◆ ReadFromFile() [1/3]

GraspTrajectoryPtr ReadFromFile ( const grasping::GraspCandidatePtr &  cnd)
static

Definition at line 393 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ ReadFromFile() [2/3]

GraspTrajectoryPtr ReadFromFile ( const std::string &  filename)
static

Definition at line 442 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ ReadFromFile() [3/3]

static GraspTrajectoryPtr ReadFromFile ( const std::string &  filename)
static

◆ ReadFromJSON()

GraspTrajectoryPtr ReadFromJSON ( const std::string &  filename)
static

Definition at line 199 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ ReadFromReader() [1/2]

GraspTrajectoryPtr ReadFromReader ( const RapidXmlReaderPtr reader)
static

Definition at line 401 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadFromReader() [2/2]

static GraspTrajectoryPtr ReadFromReader ( const RapidXmlReaderPtr reader)
static

◆ ReadFromString() [1/2]

GraspTrajectoryPtr ReadFromString ( const std::string &  xml)
static

Definition at line 447 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ ReadFromString() [2/2]

static GraspTrajectoryPtr ReadFromString ( const std::string &  xml)
static

◆ removeKeypoint() [1/2]

void removeKeypoint ( size_t  index)

Definition at line 122 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ removeKeypoint() [2/2]

void removeKeypoint ( size_t  index)

◆ replaceKeypoint() [1/2]

void replaceKeypoint ( size_t  index,
const Eigen::Matrix4f &  tcpTarget,
const armarx::NameValueMap &  handJointsTarget,
float  dt,
const std::optional< std::string > &  shape = std::nullopt 
)

Definition at line 338 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ replaceKeypoint() [2/2]

void replaceKeypoint ( size_t  index,
const Eigen::Matrix4f &  tcpTarget,
const Eigen::VectorXf &  handJointsTarget,
float  dt 
)

Definition at line 138 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ setFrame()

void setFrame ( const std::string &  frame)

Definition at line 771 of file GraspTrajectory.cpp.

◆ setKeypointDt() [1/2]

void setKeypointDt ( size_t  index,
float  dt 
)

Definition at line 152 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ setKeypointDt() [2/2]

void setKeypointDt ( size_t  index,
float  dt 
)

◆ writeToFile() [1/2]

void writeToFile ( const std::string &  filename)

Definition at line 378 of file GraspTrajectory.cpp.

+ Here is the call graph for this function:

◆ writeToFile() [2/2]

void writeToFile ( const std::string &  filename)

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