rci::JointImpedance Class Reference
[Compliance]
Domain object, representing JointImpedance, consisting of JointStiffness and JointDamping. More...
#include <JointImpedance.h>
Public Member Functions | |
JointImpedance () | |
Empty constructor Initializes JointImpedance with no values. | |
JointImpedance (double stiffness, double damping) | |
Initializes one-dimensional JointImpedance with given stiffness and damping. | |
JointImpedance (const nemo::RealVector &values) | |
Constructor from double vector. | |
JointImpedance (const nemo::RealVector &stiffness, const nemo::RealVector &damping) | |
Constructor from double vector. | |
JointImpedance (JointStiffness stiffness, JointDamping damping) | |
Constructor from JointStiffness and JointDamping. | |
JointStiffness | getStiffness () const |
Get JointStiffness of all joints. | |
unsigned int | getDimension () const |
JointStiffness | getStiffness (unsigned int index) const |
Get JointStiffness of a single joint. | |
JointDamping | getDamping () const |
Get JointDamping of all joints. | |
JointDamping | getDamping (unsigned int index) const |
Get JointDamping of a single joint. | |
JointImpedance | operator[] (unsigned int index) const |
virtual double | asDouble (unsigned int index) const |
Access impedance values as untyped doubles. | |
virtual nemo::RealVector | asDoubleVector () const |
Access impedance values as untyped double vector. | |
virtual void | setValue (unsigned int index, double value) |
Setting value at given index. | |
template<class DTOType > | |
void | merge (std::vector< boost::shared_ptr< DTOType > > &inputDTOs) |
Merging several low-dimensional JointImpedance DTOs into one single high-dimensional JointImpedance DTO. | |
template<class DTOType > | |
std::vector< JointImpedancePtr > | split () const |
Split this DTO into several one-dimensional DTOs. | |
Static Public Member Functions | |
static JointImpedancePtr | copy (const JointImpedance &impedance) |
Copy from JointImpedance. | |
static JointImpedancePtr | create (const nemo::RealVector &values) |
Crate JointImpedancePtr from values vector. | |
Protected Member Functions | |
virtual std::string | print () const |
Print function. | |
Protected Attributes | |
JointStiffness | _stiffness |
Stiffness value. | |
JointDamping | _damping |
Stiffness value. |
Detailed Description
Domain object, representing JointImpedance, consisting of JointStiffness and JointDamping.
Definition at line 169 of file JointImpedance.h.
Constructor & Destructor Documentation
rci::JointImpedance::JointImpedance | ( | ) |
Empty constructor Initializes JointImpedance with no values.
Definition at line 34 of file JointImpedance.cpp.
Referenced by copy(), operator[](), and split().
rci::JointImpedance::JointImpedance | ( | double | stiffness, | |
double | damping | |||
) |
Initializes one-dimensional JointImpedance with given stiffness and damping.
Definition at line 38 of file JointImpedance.cpp.
rci::JointImpedance::JointImpedance | ( | const nemo::RealVector & | values | ) |
Constructor from double vector.
Initializes JointImpedance with given values from double vector. Vector has to be twice the number of joints, stiffness and damping alternating.
- Parameters:
-
values Double vector with stiffness and damping values (in that order, units are (, ..., ???)
- Todo:
- what is SI metric unit for rotatory damping?
rci::JointImpedance::JointImpedance | ( | const nemo::RealVector & | stiffness, | |
const nemo::RealVector & | damping | |||
) |
Constructor from double vector.
Initializes JointImpedance with given values from double vector. Vector has to be twice the number of joints, stiffness and damping alternating.
- Parameters:
-
stiffness Double vector with stiffness in damping Double vector with stiffness in ???
rci::JointImpedance::JointImpedance | ( | JointStiffness | stiffness, | |
JointDamping | damping | |||
) |
Constructor from JointStiffness and JointDamping.
Dimensions if stiffness and damping must agree.
- Parameters:
-
stiffness Joint stiffness damping Joint damping
Definition at line 70 of file JointImpedance.cpp.
Member Function Documentation
double rci::JointImpedance::asDouble | ( | unsigned int | index | ) | const [virtual] |
Access impedance values as untyped doubles.
Valid indices are twice the impedance dimension, you get stiffness values for every even indices (including zero) and damping values for all uneven indices.
- Parameters:
-
index Index of value to get. You get stiffness values for every even indices (including zero), and damping values for every even indices.
- Returns:
- Stiffness (even index, including zero) or damping (uneven index) value
Definition at line 98 of file JointImpedance.cpp.
References _damping, and _stiffness.
Referenced by merge(), and split().
nemo::RealVector rci::JointImpedance::asDoubleVector | ( | ) | const [virtual] |
Access impedance values as untyped double vector.
Size of the vector is twice the size of the impedance DTO`s dimension. Even indices (including zero) are stiffness value, uneven indices are damping values.
- Returns:
- Stiffness (even index, including zero) or damping (uneven index) values in a vector.
Definition at line 106 of file JointImpedance.cpp.
References _damping, _stiffness, and getDimension().
JointImpedancePtr rci::JointImpedance::copy | ( | const JointImpedance & | impedance | ) | [static] |
Copy from JointImpedance.
- Parameters:
-
impedance JointImpedance to copy
- Returns:
- Shared pointer to the copy
Definition at line 58 of file JointImpedance.cpp.
References JointImpedance().
static JointImpedancePtr rci::JointImpedance::create | ( | const nemo::RealVector & | values | ) | [static] |
Crate JointImpedancePtr from values vector.
- Parameters:
-
values Vector of raw values.
- Returns:
- Newly created JointImpedancePtr
JointDamping rci::JointImpedance::getDamping | ( | unsigned int | index | ) | const |
Get JointDamping of a single joint.
- Parameters:
-
index Index of joint
- Returns:
- Damping of specified joint
Definition at line 86 of file JointImpedance.cpp.
References _damping.
JointDamping rci::JointImpedance::getDamping | ( | ) | const |
Get JointDamping of all joints.
- Returns:
- Damping of all joints
Definition at line 82 of file JointImpedance.cpp.
References _damping.
Referenced by operator[]().
unsigned int rci::JointImpedance::getDimension | ( | ) | const |
- Returns:
Definition at line 66 of file JointImpedance.cpp.
References _stiffness.
Referenced by asDoubleVector(), merge(), and split().
JointStiffness rci::JointImpedance::getStiffness | ( | unsigned int | index | ) | const |
Get JointStiffness of a single joint.
- Parameters:
-
index Index of joint
- Returns:
- Stiffness of specified joint
Definition at line 78 of file JointImpedance.cpp.
References _stiffness.
JointStiffness rci::JointImpedance::getStiffness | ( | ) | const |
Get JointStiffness of all joints.
- Returns:
- Stiffness of all joints
Definition at line 74 of file JointImpedance.cpp.
References _stiffness.
Referenced by operator[]().
void rci::JointImpedance::merge | ( | std::vector< boost::shared_ptr< DTOType > > & | inputDTOs | ) | [inline] |
Merging several low-dimensional JointImpedance DTOs into one single high-dimensional JointImpedance DTO.
Unfortunately this method has to have a template parameter to be compatible to the generic method in ContainingDoubles.
- Template Parameters:
-
DTOType Type of input DTOs (automatically inferred from inputs if left blank)
- Parameters:
-
inputDTOs Vector of JointImpedancePtr, that should be merged (in-place)
Definition at line 340 of file JointImpedance.h.
References _damping, _stiffness, asDouble(), and getDimension().
JointImpedance rci::JointImpedance::operator[] | ( | unsigned int | index | ) | const |
- Parameters:
-
index
- Returns:
Definition at line 115 of file JointImpedance.cpp.
References getDamping(), getStiffness(), and JointImpedance().
std::string rci::JointImpedance::print | ( | ) | const [protected, virtual] |
Print function.
Reimplemented from rci::JointValues.
Definition at line 119 of file JointImpedance.cpp.
References _damping, and _stiffness.
void rci::JointImpedance::setValue | ( | unsigned int | index, | |
double | value | |||
) | [virtual] |
Setting value at given index.
- Parameters:
-
index Index of the value to set/ change. Even values (including zero) set stiffness values, uneven values set damping values. value Value to set
Definition at line 90 of file JointImpedance.cpp.
References _damping, and _stiffness.
std::vector<JointImpedancePtr> rci::JointImpedance::split | ( | ) | const [inline] |
Split this DTO into several one-dimensional DTOs.
- Template Parameters:
-
DTOType Type of input and return DTOs. Has to be JointImpedance but unfortunately has to be explicit to be compatible to the generic method in ContainingDoubles.
- Returns:
- Vector of one-dimensional JointImpedancePtr
Definition at line 380 of file JointImpedance.h.
References asDouble(), getDimension(), and JointImpedance().
Member Data Documentation
JointDamping rci::JointImpedance::_damping [protected] |
Stiffness value.
Definition at line 406 of file JointImpedance.h.
Referenced by asDouble(), asDoubleVector(), getDamping(), merge(), print(), and setValue().
JointStiffness rci::JointImpedance::_stiffness [protected] |
Stiffness value.
Definition at line 401 of file JointImpedance.h.
Referenced by asDouble(), asDoubleVector(), getDimension(), getStiffness(), merge(), print(), and setValue().
The documentation for this class was generated from the following files:
- rci/dto/JointImpedance.h
- rci/dto/JointImpedance.cpp
Generated on Thu Aug 2 14:03:02 2012 for RCI by 1.6.3