1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @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){
        return offsets.position[i];
    }

private:
    JointData offsets;
    double minimalStep; // [rad]
};

#endif  /* _JointOffsets_H */