Revision 4bd3e852 server/include/RSB/GazeCallbackWrapper.h
server/include/RSB/GazeCallbackWrapper.h | ||
---|---|---|
30 | 30 |
#include "CallbackWrapper.h" |
31 | 31 |
|
32 | 32 |
//callback handler incoming gaze requests: |
33 |
class GazeCallbackWrapper : public CallbackWrapper<rst::robot::GazeTarget>{
|
|
33 |
class GazeCallbackWrapper : public CallbackWrapper<rst::animation::BinocularHeadGaze>{
|
|
34 | 34 |
public: |
35 | 35 |
GazeCallbackWrapper(Middleware *mw) : CallbackWrapper(mw){} |
36 |
void call(const std::string& method_name, boost::shared_ptr<rst::robot::GazeTarget> input){
|
|
37 |
rst::robot::GazeTarget *gaze = input.get();
|
|
36 |
void call(const std::string& method_name, boost::shared_ptr<rst::animation::BinocularHeadGaze> input){
|
|
37 |
rst::animation::BinocularHeadGaze *gaze = input.get();
|
|
38 | 38 |
//printf("> incoming gaze (p=%3.1f t=%3.1f r=%3.1f / v=%3.1f)\n", gaze->pan(), gaze->tilt(), gaze->roll(), gaze->vergence()); |
39 | 39 |
|
40 | 40 |
humotion::GazeState gaze_state; |
41 | 41 |
|
42 | 42 |
//fill in gaze |
43 |
gaze_state.pan = gaze->pan(); |
|
44 |
gaze_state.tilt = gaze->tilt(); |
|
45 |
gaze_state.roll = gaze->roll(); |
|
43 |
gaze_state.pan = gaze->target().azimuth(); |
|
44 |
gaze_state.tilt = gaze->target().elevation(); |
|
45 |
gaze_state.roll = 0.0; |
|
46 |
|
|
46 | 47 |
//RSB supports only absolute targets for now... |
47 | 48 |
gaze_state.timestamp = 123.45; //FIXME!! |
48 |
gaze_state.type = humotion::GazeState::ABSOLUTE; |
|
49 |
gaze_state.gaze_type = humotion::GazeState::GAZETYPE_ABSOLUTE; |
|
50 |
|
|
49 | 51 |
//vergence |
50 |
gaze_state.vergence = (gaze->has_vergence())?gaze->vergence():0.0; |
|
52 |
gaze_state.vergence = (gaze->has_eye_vergence())?gaze->eye_vergence():0.0; |
|
53 |
|
|
51 | 54 |
//offsets |
52 |
gaze_state.pan_offset = (gaze->has_pan_offset())?gaze->pan_offset():0.0;
|
|
53 |
gaze_state.tilt_offset = (gaze->has_tilt_offset())?gaze->tilt_offset():0.0;
|
|
54 |
|
|
55 |
gaze_state.pan_offset = (gaze->has_offset())?gaze->offset().azimuth():0.0;
|
|
56 |
gaze_state.tilt_offset = (gaze->has_offset())?gaze->offset().elevation():0.0;
|
|
57 |
|
|
55 | 58 |
//send to application: |
56 | 59 |
mw->gaze_callback(gaze_state); |
57 | 60 |
} |
Also available in: Unified diff