18 #include <yarp/os/Time.h>
20 #include "iCub/utils.h"
21 #include "iCub/module.h"
24 using namespace yarp::os;
27 ParticleFilter::ParticleFilter()
32 void ParticleFilter::onRead(Bottle &target)
37 loc.x=(int)target.get(0).asDouble();
38 loc.y=(int)target.get(1).asDouble();
43 bool ParticleFilter::getTraker(cv::Point &loc)
49 void SegmentationPoint::segment(Bottle &b)
51 if (getOutputCount()>0)
55 request.addDouble(b.get(0).asDouble());
56 request.addDouble(b.get(1).asDouble());
61 void PointedLocation::onRead(Bottle &b)
63 fprintf(stdout,
"got read from points size %d \n",b.size());
66 loc.x=(int)b.get(0).asDouble();
67 loc.y=(int)b.get(1).asDouble();
72 PointedLocation::PointedLocation()
79 bool PointedLocation::getLoc(cv::Point &loc)
81 double t0=Time::now();
83 if ((rxTime>0.0) && (t0-rxTime<timeout))
89 while (Time::now()-t0<timeout)
91 if ((rxTime>0.0) && (Time::now()-rxTime<timeout))