Public Types | Public Member Functions | Private Attributes | List of all members
xpp::Joints Class Reference

Container to access joint values of each endeffectors. More...

#include <joints.h>

Inheritance diagram for xpp::Joints:
Inheritance graph
[legend]

Public Types

using Base = Endeffectors< VectorXd >
 
using EEOrder = std::vector< EndeffectorID >
 
using JointID = uint
 
- Public Types inherited from xpp::Endeffectors< VectorXd >
using Container = std::deque< VectorXd >
 
using EndeffectorsT = Endeffectors< VectorXd >
 

Public Member Functions

double & GetJoint (JointID joint)
 
double GetJoint (JointID joint) const
 
int GetNumJoints () const
 
int GetNumJointsPerEE () const
 
 Joints (int n_ee, int n_joints_per_ee, double value=0.0)
 Constructs joint values all set to value. More...
 
 Joints (const std::vector< VectorXd > &joints)
 Converts a vector of leg joints into a Joint representation. More...
 
void SetFromVec (const VectorXd &q)
 Sets joints values from Eigen vector. More...
 
void SetFromVec (const VectorXd &q, const EEOrder &ee_order)
 Sets joint values from Eigen vector in specific order. More...
 
VectorXd ToVec () const
 Converts joint values to Eigen vector. More...
 
VectorXd ToVec (const EEOrder &ee_order) const
 Converts joint values to Eigen vector according to specific order. More...
 
virtual ~Joints ()=default
 
- Public Member Functions inherited from xpp::Endeffectors< VectorXd >
VectorXdat (EndeffectorID ee)
 Read/write access to the endeffector stored at index ee. More...
 
const VectorXdat (EndeffectorID ee) const
 Read access to the endeffector stored at index ee. More...
 
 Endeffectors (int n_ee=0)
 
int GetEECount () const
 
std::vector< EndeffectorIDGetEEsOrdered () const
 
bool operator!= (const Endeffectors &other) const
 
const EndeffectorsT operator- (const EndeffectorsT &rhs) const
 
const EndeffectorsT operator/ (double scalar) const
 
void SetAll (const VectorXd &value)
 Sets each endeffector to the same value. More...
 
void SetCount (int n_ee)
 Sets the number of endeffectors. More...
 
Container ToImpl () const
 
virtual ~Endeffectors ()=default
 

Private Attributes

int n_joints_
 
int n_joints_per_leg_
 

Detailed Description

Container to access joint values of each endeffectors.

The idea is that every joint affects only one specific endeffector, so the joints are grouped in this fashion. They can also be transformed to or set from an undiscriminative Eigen::VectorXd. This however is not recommended, as this Cartesian <->joint relationship is then lost/hidden.

Definition at line 48 of file joints.h.

Member Typedef Documentation

Definition at line 50 of file joints.h.

using xpp::Joints::EEOrder = std::vector<EndeffectorID>

Definition at line 53 of file joints.h.

using xpp::Joints::JointID = uint

Definition at line 54 of file joints.h.

Constructor & Destructor Documentation

xpp::Joints::Joints ( int  n_ee,
int  n_joints_per_ee,
double  value = 0.0 
)
explicit

Constructs joint values all set to value.

Parameters
n_eetotal number of endeffectors.
n_joints_per_eenumber of joints for each endeffector.
valuesame joint value set for each joint.

Constructing joints just from the number of joints is not permitted, as we enforce every joint to be assigned to an endeffector. This is restrictive, however it helps to avoid bugs and makes later computations easier.

Definition at line 35 of file joints.cc.

xpp::Joints::Joints ( const std::vector< VectorXd > &  joints)
explicit

Converts a vector of leg joints into a Joint representation.

Parameters
jointsJoint values of each endeffector

Attention: Each endeffector must have the same number of joints.

Definition at line 44 of file joints.cc.

virtual xpp::Joints::~Joints ( )
virtualdefault

Member Function Documentation

double & xpp::Joints::GetJoint ( JointID  joint)
Returns
read/write access of the joint value at index joint.

Definition at line 101 of file joints.cc.

double xpp::Joints::GetJoint ( JointID  joint) const
Returns
read access of the joint value at index joint.

Definition at line 109 of file joints.cc.

int xpp::Joints::GetNumJoints ( ) const

Definition at line 52 of file joints.cc.

int xpp::Joints::GetNumJointsPerEE ( ) const

Definition at line 58 of file joints.cc.

void xpp::Joints::SetFromVec ( const VectorXd q)

Sets joints values from Eigen vector.

Parameters
qThe Eigen Vector of joint values.

The vector q is interpreted as if the top n_joints_per_leg values rows belong to endeffector 0, the next n_joints_per_leg values to endeffector 1 and so on.

Definition at line 95 of file joints.cc.

void xpp::Joints::SetFromVec ( const VectorXd q,
const EEOrder ee_order 
)

Sets joint values from Eigen vector in specific order.

Parameters
qThe Eigen Vector of joint values.
ee_orderDescribes the internal order of q.

Definition at line 78 of file joints.cc.

VectorXd xpp::Joints::ToVec ( ) const

Converts joint values to Eigen vector.

The endeffectors are starting from zero and for each endeffector the joints are appended in the order they where inserted.

Definition at line 89 of file joints.cc.

VectorXd xpp::Joints::ToVec ( const EEOrder ee_order) const

Converts joint values to Eigen vector according to specific order.

Parameters
ee_orderThe order in which the endeffector's joints are appended.

Definition at line 64 of file joints.cc.

Member Data Documentation

int xpp::Joints::n_joints_
private

Definition at line 124 of file joints.h.

int xpp::Joints::n_joints_per_leg_
private

Definition at line 123 of file joints.h.


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


xpp_states
Author(s): Alexander W. Winkler
autogenerated on Tue Dec 8 2020 03:10:29