|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
75 Stat::operator double()
85 sigma = tot2 / ct - mu * mu;
121 if (target !=
nullptr) {
128 this->target = target;
140 yCError(PING,
"Port not found during ping");
150 yCError(PING,
"Port did not respond as expected");
155 accumConnect.
add(lastConnect);
166 " %s connection time (%s with name lookup)\n",
171 " %s +/- %s on average (%s +/- %s with name lookup)\n",
186 yCError(PING,
"Negative space");
190 }
else if (
t > 1e-3) {
193 }
else if (
t > 1e-6) {
196 }
else if (
t > 1e-9) {
201 std::snprintf(buf,
sizeof(buf),
"%.*f%s", decimal,
t * times, unit.c_str());
223 bool ok = b.
read(connection);
228 double dt =
now - lastTime;
233 "Period is %g +/- %g (%d)\n",
249 yCInfo(PING,
"Pausing for 5 seconds...\n");
254 "Period is %g +/- %g (%d)\n",
263 accumConnect.
clear();
void close() override
Stop port activity.
bool setTarget(const char *target)
A simple collection of objects that can be described and transmitted in a portable way.
ConnectResult getLastConnect()
void add(const ConnectResult &alt)
Ping(const char *target=nullptr)
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
void add(const RateResult &alt)
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
ConnectResult getAverageConnect()
static bool rpc(const Contact &c, const char *carrier, Bottle &writer, Bottle &reader)
double now()
Return the current time in seconds, relative to an arbitrary starting point.
static double nowSystem()
A mini-server for network communication.
static Contact queryName(const std::string &name)
Find out information about a registered name.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
static void delaySystem(double seconds)
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
NetInt32 encode(const std::string &str)
Convert a string into a vocabulary identifier.
bool read(ConnectionReader &connection) override
Read this object from a network connection.
void setReader(PortReader &reader) override
Set an external reader for port data.
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
An interface for reading from a network connection.
#define yCError(component,...)
static std::string renderTime(double t, int space, int decimal)
#define yCInfo(component,...)
An interface to the operating system, including Port based communication.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
#define YARP_OS_LOG_COMPONENT(name, name_string)