icub-test
Loading...
Searching...
No Matches
Public Member Functions
GazeControlSimpleLookTest Class Reference

This test verifies the simple gaze movements. More...

#include <GazeControlSimpleLookTest.h>

Inherits yarp::robottestingframework::TestCase.

Public Member Functions

virtual bool setup (yarp::os::Property &property)
 
virtual void tearDown ()
 
virtual void run ()
 

Detailed Description

This test verifies the simple gaze movements.

Accepts the following parameters:

Parameter name Type Units Default Value Required Description Notes
- - - - - - -

Definition at line 38 of file GazeControlSimpleLookTest.h.

Constructor & Destructor Documentation

◆ GazeControlSimpleLookTest()

GazeControlSimpleLookTest::GazeControlSimpleLookTest ( )

Definition at line 40 of file GazeControlSimpleLookTest.cpp.

40 :
41 yarp::robottestingframework::TestCase("GazeControlSimpleLookTest")
42{
43}

◆ ~GazeControlSimpleLookTest()

GazeControlSimpleLookTest::~GazeControlSimpleLookTest ( )
virtual

Definition at line 47 of file GazeControlSimpleLookTest.cpp.

48{
49}

Member Function Documentation

◆ run()

void GazeControlSimpleLookTest::run ( )
virtual

Definition at line 75 of file GazeControlSimpleLookTest.cpp.

76{
77 IGazeControl *igaze;
78 ROBOTTESTINGFRAMEWORK_TEST_CHECK(driver.view(igaze),"Opening the view on the device!");
79
80 bool done;
81
82 Vector fp;
83 double t0=Time::now();
84 while (Time::now()-t0<5.0)
85 {
86 done=igaze->getFixationPoint(fp);
87 if (done)
88 break;
89 Time::delay(0.1);
90 }
91 ROBOTTESTINGFRAMEWORK_TEST_CHECK(done,"Initial fixation-point retrieved!");
92
93 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Setting up the context");
94 int context;
95 igaze->storeContext(&context);
96
97 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Looking at the target");
98 Vector fpd(3,0.0); fp[0]=-0.4;
99 igaze->lookAtFixationPoint(fpd);
100
101 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Waiting");
102 igaze->waitMotionDone(1.0,5.0);
103
104 igaze->checkMotionDone(&done);
105 ROBOTTESTINGFRAMEWORK_TEST_CHECK(done,"Target reached!");
106
107 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Going back");
108 igaze->lookAtFixationPoint(fp);
109
110 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Waiting");
111 igaze->waitMotionDone(1.0,5.0);
112
113 igaze->checkMotionDone(&done);
114 ROBOTTESTINGFRAMEWORK_TEST_CHECK(done,"Done!");
115
116 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Cleaning up the context");
117 igaze->restoreContext(context);
118 igaze->deleteContext(context);
119}

◆ setup()

bool GazeControlSimpleLookTest::setup ( yarp::os::Property &  property)
virtual

Definition at line 53 of file GazeControlSimpleLookTest.cpp.

54{
55 Property option;
56 option.put("device","gazecontrollerclient");
57 option.put("remote","/iKinGazeCtrl");
58 option.put("local",("/"+getName()+"/gaze"));
59
60 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Opening Gaze Controller Client");
61 ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(driver.open(option),"Unable to open the client!");
62 return true;
63}

◆ tearDown()

void GazeControlSimpleLookTest::tearDown ( )
virtual

Definition at line 67 of file GazeControlSimpleLookTest.cpp.

68{
69 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Closing Gaze Controller Client");
70 ROBOTTESTINGFRAMEWORK_ASSERT_FAIL_IF_FALSE(driver.close(),"Unable to close the client!");
71}

The documentation for this class was generated from the following files: