本文整理汇总了C++中yarp::os::BufferedPort::prepare方法的典型用法代码示例。如果您正苦于以下问题:C++ BufferedPort::prepare方法的具体用法?C++ BufferedPort::prepare怎么用?C++ BufferedPort::prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::os::BufferedPort
的用法示例。
在下文中一共展示了BufferedPort::prepare方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_timeout
virtual bool on_timeout()
{
char cmd[] = "lynx -auth=admin:password -dump \" http://10.0.0.250/cgi-bin/cgi?req=frm&frm=info.html&rand=1616217005\" | grep -i status";
FILE* pipe =popen(cmd,"r");
if (!pipe) return "ERROR";
char buffer[128];
string result = "";
while(!feof(pipe)) {
if(fgets(buffer, 128, pipe) != NULL)
result += buffer;
}
pclose(pipe);
static int signal=0;
char tmp[20];
static double strenght=0.0;
sscanf(result.c_str(),"%*s %*s %d %*s %s",&signal,tmp );
strenght = atof (tmp+1);
Bottle& outBot = monitorOutput.prepare();
outBot.clear();
outBot.addInt(signal);
outBot.addDouble(strenght);
monitorOutput.write();
graphics->update_graphics(signal,strenght);
return true;
}
示例2:
template <class T> void fbe_broadcastData(T& _values, yarp::os::BufferedPort<T>& _port)
{
if (_port.getOutputCount()>0 )
{
_port.prepare() = _values ;
_port.write();
}
}
示例3:
yarp::os::Bottle BlobMatch::getYarpBottle(yarp::os::BufferedPort<yarp::os::Bottle>& outport) {
yarp::os::Bottle& result = outport.prepare();
result.clear();
result.addString("colour");
result.addString(color.c_str());
result.addDouble(pt.x);
result.addDouble(pt.y);
result.addInt(size);
outport.writeStrict();
return result;
}