Revision 3877047d client/python/hlrc_client/RobotGaze.py
client/python/hlrc_client/RobotGaze.py | ||
---|---|---|
27 | 27 |
import time |
28 | 28 |
|
29 | 29 |
class RobotGaze: |
30 |
GAZETARGET_ABSOLUTE = 0
|
|
31 |
GAZETARGET_RELATIVE = 1
|
|
32 |
|
|
33 |
def __init__(self):
|
|
34 |
self.pan = 0.0
|
|
35 |
self.tilt = 0.0
|
|
36 |
self.roll = 0.0
|
|
37 |
self.vergence = 0.0
|
|
38 |
self.pan_offset = 0.0
|
|
39 |
self.tilt_offset = 0.0
|
|
40 |
self.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE
|
|
41 |
self.timestamp = time.time()
|
|
30 |
GAZETARGET_ABSOLUTE = 0
|
|
31 |
GAZETARGET_RELATIVE = 1
|
|
32 |
|
|
33 |
def __init__(self):
|
|
34 |
self.pan = 0.0 |
|
35 |
self.tilt = 0.0 |
|
36 |
self.roll = 0.0 |
|
37 |
self.vergence = 0.0 |
|
38 |
self.pan_offset = 0.0 |
|
39 |
self.tilt_offset = 0.0 |
|
40 |
self.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE |
|
41 |
self.timestamp = time.time() |
|
42 | 42 |
|
43 | 43 |
def __str__(self): |
44 |
if self.gaze_type == RobotGaze.GAZETARGET_ABSOLUTE:
|
|
45 |
type_s = "ABSOLUTE"
|
|
44 |
if self.gaze_type == RobotGaze.GAZETARGET_ABSOLUTE:
|
|
45 |
type_s = "ABSOLUTE" |
|
46 | 46 |
else: |
47 |
type_s = "RELATIVE"
|
|
48 |
return "RobotGaze = { PTR={%6.2f %6.2f %6.2f} vergence=%6.2f PT_offset={%6.2f %6.2f} [%s]}" \ |
|
49 |
% (self.pan, self.tilt, self.roll, self.vergence, self.pan_offset, self.tilt_offset, type_s)
|
|
47 |
type_s = "RELATIVE"
|
|
48 |
return "RobotGaze = { PTR={%6.2f %6.2f %6.2f} vergence=%6.2f PT_offset={%6.2f %6.2f} [%s]}" \
|
|
49 |
% (self.pan, self.tilt, self.roll, self.vergence, self.pan_offset, self.tilt_offset, type_s) |
|
50 | 50 |
|
Also available in: Unified diff