YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
GazeControl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_GAZECONTROL_H
8#define YARP_DEV_GAZECONTROL_H
9
10#include <string>
11
12#include <yarp/os/Bottle.h>
13#include <yarp/os/Stamp.h>
14#include <yarp/dev/api.h>
15#include <yarp/sig/Vector.h>
16
21namespace yarp::dev {
22struct GazeEventParameters;
23struct GazeEventVariables;
24class GazeEvent;
25class IGazeControl;
26}
27
28
63
64
71{
76 std::string type;
77
82 double time;
83
89};
90
91
122
123
133{
134public:
138 virtual ~IGazeControl();
139
152 virtual bool setTrackingMode(const bool f) = 0;
153
160 virtual bool getTrackingMode(bool *f) = 0;
161
170 virtual bool setStabilizationMode(const bool f) = 0;
171
178 virtual bool getStabilizationMode(bool *f) = 0;
179
188 virtual bool getFixationPoint(yarp::sig::Vector &fp, yarp::os::Stamp *stamp = NULL) = 0;
189
205 virtual bool getAngles(yarp::sig::Vector &ang, yarp::os::Stamp *stamp = NULL) = 0;
206
214 virtual bool lookAtFixationPoint(const yarp::sig::Vector &fp) = 0;
215
228 virtual bool lookAtAbsAngles(const yarp::sig::Vector &ang) = 0;
229
243 virtual bool lookAtRelAngles(const yarp::sig::Vector &ang) = 0;
244
260 virtual bool lookAtMonoPixel(const int camSel,
261 const yarp::sig::Vector &px,
262 const double z = 1.0) = 0;
263
274 virtual bool lookAtMonoPixelWithVergence(const int camSel,
275 const yarp::sig::Vector &px,
276 const double ver) = 0;
277
294 virtual bool lookAtStereoPixels(const yarp::sig::Vector &pxl,
295 const yarp::sig::Vector &pxr) = 0;
296
304 virtual bool lookAtFixationPointSync(const yarp::sig::Vector &fp) = 0;
305
318 virtual bool lookAtAbsAnglesSync(const yarp::sig::Vector &ang) = 0;
319
333 virtual bool lookAtRelAnglesSync(const yarp::sig::Vector &ang) = 0;
334
350 virtual bool lookAtMonoPixelSync(const int camSel,
351 const yarp::sig::Vector &px,
352 const double z = 1.0) = 0;
353
364 virtual bool lookAtMonoPixelWithVergenceSync(const int camSel,
365 const yarp::sig::Vector &px,
366 const double ver) = 0;
367
385 const yarp::sig::Vector &pxr) = 0;
386
393 virtual bool getNeckTrajTime(double *t) = 0;
394
401 virtual bool getEyesTrajTime(double *t) = 0;
402
409 virtual bool getVORGain(double *gain) = 0;
410
417 virtual bool getOCRGain(double *gain) = 0;
418
425 virtual bool getSaccadesMode(bool *f) = 0;
426
433 virtual bool getSaccadesInhibitionPeriod(double *period) = 0;
434
441 virtual bool getSaccadesActivationAngle(double *angle) = 0;
442
455 yarp::os::Stamp *stamp = NULL) = 0;
456
469 yarp::os::Stamp *stamp = NULL) = 0;
470
489 yarp::os::Stamp *stamp = NULL) = 0;
490
502 virtual bool get2DPixel(const int camSel,
503 const yarp::sig::Vector &x,
504 yarp::sig::Vector &px) = 0;
505
519 virtual bool get3DPoint(const int camSel,
520 const yarp::sig::Vector &px,
521 const double z,
522 yarp::sig::Vector &x) = 0;
523
540 virtual bool get3DPointOnPlane(const int camSel,
541 const yarp::sig::Vector &px,
542 const yarp::sig::Vector &plane,
543 yarp::sig::Vector &x) = 0;
544
556 virtual bool get3DPointFromAngles(const int mode,
557 const yarp::sig::Vector &ang,
558 yarp::sig::Vector &x) = 0;
559
572 yarp::sig::Vector &ang) = 0;
573
589 virtual bool triangulate3DPoint(const yarp::sig::Vector &pxl,
590 const yarp::sig::Vector &pxr,
591 yarp::sig::Vector &x) = 0;
592
600 virtual bool getJointsDesired(yarp::sig::Vector &qdes) = 0;
601
609 virtual bool getJointsVelocities(yarp::sig::Vector &qdot) = 0;
610
623 virtual bool getStereoOptions(yarp::os::Bottle &options) = 0;
624
634 virtual bool setNeckTrajTime(const double t) = 0;
635
642 virtual bool setEyesTrajTime(const double t) = 0;
643
652 virtual bool setVORGain(const double gain) = 0;
653
662 virtual bool setOCRGain(const double gain) = 0;
663
673 virtual bool setSaccadesMode(const bool f) = 0;
674
681 virtual bool setSaccadesInhibitionPeriod(const double period) = 0;
682
689 virtual bool setSaccadesActivationAngle(const double angle) = 0;
690
708 virtual bool setStereoOptions(const yarp::os::Bottle &options) = 0;
709
717 virtual bool bindNeckPitch(const double min, const double max) = 0;
718
728 virtual bool blockNeckPitch(const double val) = 0;
729
737 virtual bool blockNeckPitch() = 0;
738
746 virtual bool bindNeckRoll(const double min, const double max) = 0;
747
757 virtual bool blockNeckRoll(const double val) = 0;
758
766 virtual bool blockNeckRoll() = 0;
767
775 virtual bool bindNeckYaw(const double min, const double max) = 0;
776
786 virtual bool blockNeckYaw(const double val) = 0;
787
795 virtual bool blockNeckYaw() = 0;
796
804 virtual bool blockEyes(const double ver) = 0;
805
811 virtual bool blockEyes() = 0;
812
821 virtual bool getNeckPitchRange(double *min, double *max) = 0;
822
831 virtual bool getNeckRollRange(double *min, double *max) = 0;
832
841 virtual bool getNeckYawRange(double *min, double *max) = 0;
842
852 virtual bool getBlockedVergence(double *ver) = 0;
853
858 virtual bool clearNeckPitch() = 0;
859
864 virtual bool clearNeckRoll() = 0;
865
870 virtual bool clearNeckYaw() = 0;
871
876 virtual bool clearEyes() = 0;
877
890 virtual bool getNeckAngleUserTolerance(double *angle) = 0;
891
898 virtual bool setNeckAngleUserTolerance(const double angle) = 0;
899
906 virtual bool checkMotionDone(bool *f) = 0;
907
918 virtual bool waitMotionDone(const double period=0.1, const double timeout=0.0) = 0;
919
925 virtual bool checkSaccadeDone(bool *f) = 0;
926
937 virtual bool waitSaccadeDone(const double period=0.1, const double timeout=0.0) = 0;
938
943 virtual bool stopControl() = 0;
944
954 virtual bool storeContext(int *id) = 0;
955
966 virtual bool restoreContext(const int id) = 0;
967
973 virtual bool deleteContext(const int id) = 0;
974
981 virtual bool getInfo(yarp::os::Bottle &info) = 0;
982
991 virtual bool registerEvent(yarp::dev::GazeEvent &event) = 0;
992
998 virtual bool unregisterEvent(yarp::dev::GazeEvent &event) = 0;
999
1009 virtual bool tweakSet(const yarp::os::Bottle &options) = 0;
1010
1021 virtual bool tweakGet(yarp::os::Bottle &options) = 0;
1022};
1023
1024#endif // YARP_DEV_GAZECONTROL_H
contains the definition of a Vector type
Interface for a event notified by the gaze controller.
Definition GazeControl.h:98
yarp::dev::GazeEventVariables gazeEventVariables
The event handler fills this structure with useful information at run-time.
yarp::dev::GazeEventParameters gazeEventParameters
The user fills this structure to establish the event parameters.
virtual void gazeEventCallback()=0
Event callback to be overridden by the user.
virtual ~GazeEvent()
Destructor.
Interface for a gaze controller.
virtual bool lookAtMonoPixel(const int camSel, const yarp::sig::Vector &px, const double z=1.0)=0
Move the gaze to a location specified by a pixel within the image plane.
virtual bool lookAtMonoPixelWithVergenceSync(const int camSel, const yarp::sig::Vector &px, const double ver)=0
Move the gaze to a location specified by a pixel within the image plane using the vergence.
virtual bool lookAtRelAngles(const yarp::sig::Vector &ang)=0
Move the gaze to a specified gazing angles configuration given in the relative reference frame.
virtual bool getVORGain(double *gain)=0
Get the current gain used to weigh the vestibulo-ocular reflex (VOR).
virtual bool getStereoOptions(yarp::os::Bottle &options)=0
Return the current options used by the stereo approach.
virtual bool clearEyes()=0
Unblock the eyes.
virtual bool setNeckTrajTime(const double t)=0
Set the duration of the trajectory for the neck actuators.
virtual bool getJointsVelocities(yarp::sig::Vector &qdot)=0
Get the joints velocities commanded by the controller.
virtual bool setEyesTrajTime(const double t)=0
Set the duration of the trajectory for the eyes actuators.
virtual ~IGazeControl()
Destructor.
virtual bool tweakSet(const yarp::os::Bottle &options)=0
Tweak low-level controller's parameters.
virtual bool getTrackingMode(bool *f)=0
Get the current controller mode.
virtual bool triangulate3DPoint(const yarp::sig::Vector &pxl, const yarp::sig::Vector &pxr, yarp::sig::Vector &x)=0
Triangulate two points given in the image planes to find the corresponding 3-d point in the space.
virtual bool lookAtFixationPointSync(const yarp::sig::Vector &fp)=0
Move the gaze to a specified fixation point in cartesian space.
virtual bool setStabilizationMode(const bool f)=0
Turn on/off the gaze stabilization.
virtual bool deleteContext(const int id)=0
Delete a specified controller context.
virtual bool stopControl()=0
Ask for an immediate stop of the motion.
virtual bool setVORGain(const double gain)=0
Set the gain used to weigh the vestibulo-ocular reflex (VOR).
virtual bool setSaccadesActivationAngle(const double angle)=0
Set the activation angle for saccadic movements.
virtual bool lookAtMonoPixelWithVergence(const int camSel, const yarp::sig::Vector &px, const double ver)=0
Move the gaze to a location specified by a pixel within the image plane using the vergence.
virtual bool get3DPoint(const int camSel, const yarp::sig::Vector &px, const double z, yarp::sig::Vector &x)=0
Get the 3-d point whose pixel projection and z-component in the camera frame are given.
virtual bool getHeadPose(yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL)=0
Get the current pose of the head frame.
virtual bool bindNeckPitch(const double min, const double max)=0
Bind the neck pitch within a specified range.
virtual bool getNeckYawRange(double *min, double *max)=0
Return the current neck yaw range.
virtual bool getJointsDesired(yarp::sig::Vector &qdes)=0
Get the joints target values where the controller is moving the system to.
virtual bool blockNeckRoll()=0
Block the neck roll at the current angle.
virtual bool lookAtRelAnglesSync(const yarp::sig::Vector &ang)=0
Move the gaze to a specified gazing angles configuration given in the relative reference frame.
virtual bool bindNeckYaw(const double min, const double max)=0
Bind the neck yaw within a specified range.
virtual bool getNeckAngleUserTolerance(double *angle)=0
Return the current tolerance defined by the user to gaze at the target with the neck,...
virtual bool getNeckTrajTime(double *t)=0
Get the current trajectory duration for the neck actuators.
virtual bool blockNeckYaw(const double val)=0
Block the neck yaw at a specified angle.
virtual bool clearNeckPitch()=0
Unblock the neck pitch.
virtual bool waitSaccadeDone(const double period=0.1, const double timeout=0.0)=0
Wait until the current saccade is terminated.
virtual bool getOCRGain(double *gain)=0
Get the current gain used to weigh the oculo-collic reflex (OCR).
virtual bool get3DPointFromAngles(const int mode, const yarp::sig::Vector &ang, yarp::sig::Vector &x)=0
Get the 3-d coordinates corresponding to the angular positions.
virtual bool setSaccadesMode(const bool f)=0
Enable/disable the use of very fast eyes movements (saccades).
virtual bool setTrackingMode(const bool f)=0
Set the controller in tracking or non-tracking mode.
virtual bool tweakGet(yarp::os::Bottle &options)=0
Return low-level controller's parameters.
virtual bool setOCRGain(const double gain)=0
Set the gain used to weigh the oculo-collic reflex (OCR).
virtual bool get3DPointOnPlane(const int camSel, const yarp::sig::Vector &px, const yarp::sig::Vector &plane, yarp::sig::Vector &x)=0
Get the 3-d point - whose pixel projection is given - that results from the projection into a plane s...
virtual bool getNeckRollRange(double *min, double *max)=0
Return the current neck roll range.
virtual bool setStereoOptions(const yarp::os::Bottle &options)=0
Update the options used by the stereo approach.
virtual bool blockEyes()=0
Block the eyes to look always straight ahead (the tilt can vary) with the current vergence angle.
virtual bool blockNeckYaw()=0
Block the neck yaw at the current angle.
virtual bool getBlockedVergence(double *ver)=0
Return the current vergence angle used to block the eyes.
virtual bool getSaccadesMode(bool *f)=0
Query whether the very fast eyes movements (saccades) will be employed or not.
virtual bool setSaccadesInhibitionPeriod(const double period)=0
Set the inhibition period for saccadic movements.
virtual bool getAnglesFrom3DPoint(const yarp::sig::Vector &x, yarp::sig::Vector &ang)=0
Get the absolute angular coordinates corresponding to the 3-d point.
virtual bool lookAtAbsAnglesSync(const yarp::sig::Vector &ang)=0
Move the gaze to a specified gazing angles configuration given in the absolute reference frame.
virtual bool getFixationPoint(yarp::sig::Vector &fp, yarp::os::Stamp *stamp=NULL)=0
Get the current fixation point.
virtual bool blockEyes(const double ver)=0
Block the eyes to look always straight ahead (the tilt can vary) with a specified vergence angle.
virtual bool checkMotionDone(bool *f)=0
Check once if the current trajectory is terminated.
virtual bool getAngles(yarp::sig::Vector &ang, yarp::os::Stamp *stamp=NULL)=0
Get the current gaze configuration in terms of azimuth and elevation angles wrt to the absolute refer...
virtual bool lookAtStereoPixels(const yarp::sig::Vector &pxl, const yarp::sig::Vector &pxr)=0
Move the gaze to a location specified by two pixels representing the same 3-d point as seen from with...
virtual bool getStabilizationMode(bool *f)=0
Get the current stabilization mode.
virtual bool lookAtAbsAngles(const yarp::sig::Vector &ang)=0
Move the gaze to a specified gazing angles configuration given in the absolute reference frame.
virtual bool lookAtFixationPoint(const yarp::sig::Vector &fp)=0
Move the gaze to a specified fixation point in cartesian space.
virtual bool blockNeckRoll(const double val)=0
Block the neck roll at a specified angle.
virtual bool restoreContext(const int id)=0
Restore the controller context previously stored.
virtual bool storeContext(int *id)=0
Store the controller context.
virtual bool getNeckPitchRange(double *min, double *max)=0
Return the current neck pitch range.
virtual bool getEyesTrajTime(double *t)=0
Get the current trajectory duration for the eyes actuators.
virtual bool registerEvent(yarp::dev::GazeEvent &event)=0
Register an event.
virtual bool blockNeckPitch(const double val)=0
Block the neck pitch at a specified angle.
virtual bool bindNeckRoll(const double min, const double max)=0
Bind the neck roll within a specified range.
virtual bool unregisterEvent(yarp::dev::GazeEvent &event)=0
Unregister an event.
virtual bool checkSaccadeDone(bool *f)=0
Check once if the saccade is terminated.
virtual bool get2DPixel(const int camSel, const yarp::sig::Vector &x, yarp::sig::Vector &px)=0
Get the 2-d pixel point - whose cartesian coordinates are given wrt the root reference frame - that r...
virtual bool getLeftEyePose(yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL)=0
Get the current pose of the left eye frame.
virtual bool getRightEyePose(yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL)=0
Get the current pose of the right eye frame.
virtual bool blockNeckPitch()=0
Block the neck pitch at the current angle.
virtual bool lookAtStereoPixelsSync(const yarp::sig::Vector &pxl, const yarp::sig::Vector &pxr)=0
Move the gaze to a location specified by two pixels representing the same 3-d point as seen from with...
virtual bool getSaccadesInhibitionPeriod(double *period)=0
Get the current inhibition period for saccadic movements.
virtual bool setNeckAngleUserTolerance(const double angle)=0
Specify a new tolerance to gaze at the target with the neck.
virtual bool clearNeckRoll()=0
Unblock the neck roll.
virtual bool waitMotionDone(const double period=0.1, const double timeout=0.0)=0
Wait until the current trajectory is terminated.
virtual bool clearNeckYaw()=0
Unblock the neck yaw.
virtual bool getInfo(yarp::os::Bottle &info)=0
Return useful info on the operating state of the controller.
virtual bool lookAtMonoPixelSync(const int camSel, const yarp::sig::Vector &px, const double z=1.0)=0
Move the gaze to a location specified by a pixel within the image plane.
virtual bool getSaccadesActivationAngle(double *angle)=0
Get the current activation angle for saccadic movements.
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
Structure for configuring a gaze event.
Definition GazeControl.h:35
double motionOngoingCheckPoint
The user specifies the motion check-point that raises a "motion-ongoing" event through this parameter...
Definition GazeControl.h:61
std::string type
The signature of the event as specified by the user.
Definition GazeControl.h:54
Structure for retrieving information from a gaze event.
Definition GazeControl.h:71
double time
Contain the time instant of the source when the event took place, as filled by the event handler.
Definition GazeControl.h:82
double motionOngoingCheckPoint
Contain the motion check-point that raised a "motion-ongoing" event.
Definition GazeControl.h:88
std::string type
The signature of the received event as filled by the event handler.
Definition GazeControl.h:76
#define YARP_dev_API
Definition api.h:18