Revision 62aeb8ce client/cpp/include/RobotGaze.h
| client/cpp/include/RobotGaze.h | ||
|---|---|---|
| 27 | 27 |
*/ |
| 28 | 28 |
|
| 29 | 29 |
#pragma once |
| 30 |
#include <time.h> |
|
| 31 |
|
|
| 30 | 32 |
class RobotGaze{
|
| 31 | 33 |
public: |
| 32 | 34 |
RobotGaze(){
|
| ... | ... | |
| 36 | 38 |
vergence = 0.0; |
| 37 | 39 |
pan_offset = 0.0; |
| 38 | 40 |
tilt_offset = 0.0; |
| 41 |
type = ABSOLUTE; |
|
| 39 | 42 |
} |
| 40 | 43 |
|
| 44 |
static double now(){
|
|
| 45 |
//fetch time |
|
| 46 |
struct timespec tp; |
|
| 47 |
clock_gettime(CLOCK_REALTIME, &tp); |
|
| 48 |
return tp.tv_sec+tp.tv_nsec/1000000000.0; |
|
| 49 |
}; |
|
| 50 |
|
|
| 51 |
enum {
|
|
| 52 |
RELATIVE = 0, |
|
| 53 |
ABSOLUTE = 1 |
|
| 54 |
}; |
|
| 55 |
|
|
| 56 |
double timestamp; |
|
| 57 |
|
|
| 58 |
int type; |
|
| 59 |
|
|
| 41 | 60 |
float pan, tilt, roll, vergence; |
| 42 | 61 |
float pan_offset, tilt_offset; |
| 43 | 62 |
}; |
Also available in: Unified diff