example.pl

来自「一个语言识别引擎」· PL 代码 · 共 28 行

PL
28 行
字号
#!/usr/bin/perl -w

use yarp;

yarp::Network::init();

my $p = new yarp::BufferedPortBottle();
#my $p = new yarp::BufferedPortImageRgb();

$p->open("/perl");

my $top = 100;
for (my $i=1; $i<=$top; $i++) {
    my $bottle = $p->prepare();
    $bottle->clear();
    $bottle->addString("count");
    $bottle->addInt($i);
    $bottle->addString("of");
    $bottle->addInt($top);
    print "Sending ", $bottle->toString(), "\n";
    $p->write();
    yarp::Time::delay(0.5);
}

$p->close();

yarp::Network::fini();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?