/**
* @file JointOffsets.h
*
* @author <a href="mailto:kaden@informatik.hu-berlin.de">Steffen Kaden</a>
* @author <a href="mailto:mellmann@informatik.hu-berlin.de">Heinrich Mellmann</a>
*
*/
#ifndef _JointOffsets_H
#define _JointOffsets_H
#include <Representations/Infrastructure/JointData.h>
class JointOffsets
{
public:
JointOffsets():minimalStep(0.0013962634){}
void setMinimalStep(double minStep) {
minimalStep = minStep;
}
void resetOffsets(){
for(int i = 0; i < naoth::JointData::numOfJoint; i++){
offsets.position[i] = 0;
}
}
void increaseOffset(int i){
offsets.position[i] += minimalStep;
}
void decreaseOffset(int i){
offsets.position[i] -= minimalStep;
}
double operator [](int i){<--- Technically the member function 'JointOffsets::operator[]' can be const. [+]The member function 'JointOffsets::operator[]' can be made a const function. Making this function 'const' should not cause compiler errors. Even though the function can be made const function technically it may not make sense conceptually. Think about your design and the task of the function first - is it a function that must not change object internal state?
return offsets.position[i];
}
private:
JointData offsets;
double minimalStep; // [rad]
};
#endif /* _JointOffsets_H */