75 static constexpr const char*
s_tag{
"applyVelocityCommandRPC"};
79 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue MobileBaseVelocityControlRPC::applyVelocityCommandRPC(const double x_vel, const double y_vel, const double theta_vel, const double timeout)"};
80 static constexpr const char*
s_help{
""};
133 static constexpr const char*
s_tag{
"getLastVelocityCommandRPC"};
137 static constexpr const char*
s_prototype{
"return_getLastVelocityCommand MobileBaseVelocityControlRPC::getLastVelocityCommandRPC()"};
143 cmd{x_vel, y_vel, theta_vel, timeout}
160 theta_vel{theta_vel},
171 return write(writer);
186 if (!writeTag(writer)) {
189 if (!writeArgs(writer)) {
222 if (!readTag(reader)) {
225 if (!readArgs(reader)) {
288 return write(writer);
300 if (!writer.
write(return_helper)) {
313 if (!reader.
read(return_helper)) {
342 return write(writer);
357 if (!writeTag(writer)) {
360 if (!writeArgs(writer)) {
381 if (!readTag(reader)) {
384 if (!readArgs(reader)) {
415 return write(writer);
430 if (!writer.
write(return_helper)) {
446 if (!reader.
read(return_helper)) {
461 yarp().setOwner(*
this);
466 if (!
yarp().canWrite()) {
470 bool ok =
yarp().write(helper, helper);
476 if (!
yarp().canWrite()) {
480 bool ok =
yarp().write(helper, helper);
487 bool showAll = (functionName ==
"--all");
488 std::vector<std::string> helpString;
490 helpString.emplace_back(
"*** Available commands:");
493 helpString.emplace_back(
"help");
501 if (functionName ==
"help") {
502 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
503 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
504 helpString.emplace_back(
"@param functionName name of command for which to get a detailed description. If none or '--all' is provided, print list of available commands");
505 helpString.emplace_back(
"@return list of strings (one string per line)");
508 if (helpString.empty()) {
509 helpString.emplace_back(
"Command not found");
517 constexpr size_t max_tag_len = 1;
527 std::string tag = reader.
readTag(1);
528 bool direct = (tag ==
"__direct__");
532 while (tag_len <= max_tag_len && !reader.
isError()) {
564 std::string functionName;
566 functionName =
"--all";
568 auto help_strings = help(functionName);
574 if (!writer.
writeTag(
"many", 1, 0)) {
580 for (
const auto& help_string : help_strings) {
596 std::string next_tag = reader.
readTag(1);
597 if (next_tag.empty()) {
600 tag.append(
"_").append(next_tag);
601 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::dev::ReturnValue return_helper
~Reply() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::dev::ReturnValue(*)(const double, const double, const double, const double) funcptr_t
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void call(MobileBaseVelocityControlRPC *ptr)
static constexpr size_t s_tag_len
MobileBaseVelocityControlRPC_applyVelocityCommandRPC_helper()=default
static constexpr const char * s_help
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Command() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
~Reply() override=default
return_getLastVelocityCommand return_helper
void call(MobileBaseVelocityControlRPC *ptr)
static constexpr const char * s_help
static constexpr size_t s_reply_len
static constexpr size_t s_cmd_len
MobileBaseVelocityControlRPC_getLastVelocityCommandRPC_helper()=default
static constexpr size_t s_tag_len
static constexpr const char * s_prototype
static constexpr const char * s_tag
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_getLastVelocityCommand(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual std::vector< std::string > help(const std::string &functionName="--all")
MobileBaseVelocityControlRPC()
virtual yarp::dev::ReturnValue applyVelocityCommandRPC(const double x_vel, const double y_vel, const double theta_vel, const double timeout)
virtual return_getLastVelocityCommand getLastVelocityCommandRPC()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool read(WirePortable &obj)
bool readFloat64(yarp::conf::float64_t &x)
IDL-friendly connection writer.
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeFloat64(yarp::conf::float64_t x, bool skip_tag=false) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeListBegin(int tag, size_t len) const
The main, catch-all namespace for YARP.