1 #include <yarp/os/LogStream.h> 2 #include <yarp/os/Property.h> 3 #include <yarp/dev/Drivers.h> 4 #include <yarp/dev/IVisualServoing.h> 5 #include <yarp/dev/PolyDriver.h> 6 #include <yarp/math/Math.h> 15 int main(
int argc,
char **argv)
18 if (!yarp.checkNetwork(3.0))
20 yError(
"YARP seems unavailable!");
24 YARP_REGISTER_PLUGINS(visualservoingplugin);
26 Property prop_server_vs;
27 prop_server_vs.put(
"device",
"visualservoingserver");
28 prop_server_vs.put(
"verbosity",
true);
29 prop_server_vs.put(
"simulate",
true);
30 prop_server_vs.put(
"robot",
"icubSim");
31 bool use_fwd_kin =
false;
33 PolyDriver drv_server_vs(prop_server_vs);
34 if (!drv_server_vs.isValid())
36 yError(
"Could not run VisualServoingServer!");
40 IVisualServoing *visual_servoing;
41 drv_server_vs.view(visual_servoing);
42 if (visual_servoing == YARP_NULLPTR)
44 yError(
"Could not get interfacate to VisualServoingServer!");
49 visual_servoing->setVisualServoControl(
"decoupled");
52 visual_servoing->storedInit(
"t170904");
54 visual_servoing->initFacilities(use_fwd_kin);
55 visual_servoing->storedGoToGoal(
"t170904");
57 visual_servoing->checkVisualServoingController();
58 visual_servoing->waitVisualServoingDone();
60 visual_servoing->stopFacilities();
63 visual_servoing->storedInit(
"t170427");
65 visual_servoing->initFacilities(use_fwd_kin);
66 visual_servoing->storedGoToGoal(
"t170427");
68 visual_servoing->checkVisualServoingController();
69 visual_servoing->waitVisualServoingDone();
71 visual_servoing->stopFacilities();
int main(int argc, char *argv[])
YARP_DECLARE_PLUGINS(visualservoingplugin)