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 (const std::vector< VectorXd > &joints)
 Converts a vector of leg joints into a Joint representation. More...
 
 Joints (int n_ee, int n_joints_per_ee, double value=0.0)
 Constructs joint values all set to value. 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 75 of file joints.h.

Member Typedef Documentation

◆ Base

Definition at line 104 of file joints.h.

◆ EEOrder

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

Definition at line 107 of file joints.h.

◆ JointID

using xpp::Joints::JointID = uint

Definition at line 108 of file joints.h.

Constructor & Destructor Documentation

◆ Joints() [1/2]

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 62 of file joints.cc.

◆ Joints() [2/2]

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 71 of file joints.cc.

◆ ~Joints()

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

Member Function Documentation

◆ GetJoint() [1/2]

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

Definition at line 128 of file joints.cc.

◆ GetJoint() [2/2]

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

Definition at line 136 of file joints.cc.

◆ GetNumJoints()

int xpp::Joints::GetNumJoints ( ) const

Definition at line 79 of file joints.cc.

◆ GetNumJointsPerEE()

int xpp::Joints::GetNumJointsPerEE ( ) const

Definition at line 85 of file joints.cc.

◆ SetFromVec() [1/2]

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 122 of file joints.cc.

◆ SetFromVec() [2/2]

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 105 of file joints.cc.

◆ ToVec() [1/2]

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 116 of file joints.cc.

◆ ToVec() [2/2]

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 91 of file joints.cc.

Member Data Documentation

◆ n_joints_

int xpp::Joints::n_joints_
private

Definition at line 178 of file joints.h.

◆ n_joints_per_leg_

int xpp::Joints::n_joints_per_leg_
private

Definition at line 177 of file joints.h.


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


xpp_states
Author(s): Alexander W. Winkler
autogenerated on Wed Mar 2 2022 01:14:14