44 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
58 if (!helper_proto.read(connection)) {
68 if(!
yarp().canWrite()) {
69 yError(
" Missing server method ILocalization2DMsgs::getRemoteProtocolVersion");
74 return helper.helper_proto;}
85 if (remproto.protocol_version != locproto.protocol_version)
87 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
88 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
89 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
159 static constexpr const char*
s_tag{
"start_localization_service_RPC"};
163 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::start_localization_service_RPC()"};
217 static constexpr const char*
s_tag{
"stop_localization_service_RPC"};
221 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::stop_localization_service_RPC()"};
275 static constexpr const char*
s_tag{
"get_localization_status_RPC"};
279 static constexpr const char*
s_prototype{
"return_get_localization_status ILocalization2DMsgs::get_localization_status_RPC()"};
333 static constexpr const char*
s_tag{
"get_estimated_poses_RPC"};
337 static constexpr const char*
s_prototype{
"return_get_estimated_poses ILocalization2DMsgs::get_estimated_poses_RPC()"};
391 static constexpr const char*
s_tag{
"get_current_position1_RPC"};
395 static constexpr const char*
s_prototype{
"return_get_current_position1 ILocalization2DMsgs::get_current_position1_RPC()"};
449 static constexpr const char*
s_tag{
"get_current_position2_RPC"};
453 static constexpr const char*
s_prototype{
"return_get_current_position2 ILocalization2DMsgs::get_current_position2_RPC()"};
507 static constexpr const char*
s_tag{
"get_estimated_odometry_RPC"};
511 static constexpr const char*
s_prototype{
"return_get_estimated_odometry ILocalization2DMsgs::get_estimated_odometry_RPC()"};
570 static constexpr const char*
s_tag{
"set_initial_pose1_RPC"};
574 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::set_initial_pose1_RPC(const yarp::dev::Nav2D::Map2DLocation& loc)"};
634 static constexpr const char*
s_tag{
"set_initial_pose2_RPC"};
638 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::set_initial_pose2_RPC(const yarp::dev::Nav2D::Map2DLocation& loc, const yarp::sig::Matrix& cov)"};
659 return write(writer);
674 if (!writeTag(writer)) {
677 if (!writeArgs(writer)) {
698 if (!readTag(reader)) {
701 if (!readArgs(reader)) {
732 return write(writer);
744 if (!writer.
write(return_helper)) {
757 if (!reader.
read(return_helper)) {
786 return write(writer);
801 if (!writeTag(writer)) {
804 if (!writeArgs(writer)) {
825 if (!readTag(reader)) {
828 if (!readArgs(reader)) {
859 return write(writer);
871 if (!writer.
write(return_helper)) {
884 if (!reader.
read(return_helper)) {
913 return write(writer);
928 if (!writeTag(writer)) {
931 if (!writeArgs(writer)) {
952 if (!readTag(reader)) {
955 if (!readArgs(reader)) {
986 return write(writer);
1001 if (!writer.
write(return_helper)) {
1017 if (!reader.
read(return_helper)) {
1046 return write(writer);
1056 return read(reader);
1061 if (!writeTag(writer)) {
1064 if (!writeArgs(writer)) {
1085 if (!readTag(reader)) {
1088 if (!readArgs(reader)) {
1119 return write(writer);
1125 return read(reader);
1134 if (!writer.
write(return_helper)) {
1150 if (!reader.
read(return_helper)) {
1179 return write(writer);
1189 return read(reader);
1194 if (!writeTag(writer)) {
1197 if (!writeArgs(writer)) {
1218 if (!readTag(reader)) {
1221 if (!readArgs(reader)) {
1252 return write(writer);
1258 return read(reader);
1267 if (!writer.
write(return_helper)) {
1283 if (!reader.
read(return_helper)) {
1312 return write(writer);
1322 return read(reader);
1327 if (!writeTag(writer)) {
1330 if (!writeArgs(writer)) {
1351 if (!readTag(reader)) {
1354 if (!readArgs(reader)) {
1385 return write(writer);
1391 return read(reader);
1400 if (!writer.
write(return_helper)) {
1416 if (!reader.
read(return_helper)) {
1445 return write(writer);
1455 return read(reader);
1460 if (!writeTag(writer)) {
1463 if (!writeArgs(writer)) {
1484 if (!readTag(reader)) {
1487 if (!readArgs(reader)) {
1518 return write(writer);
1524 return read(reader);
1533 if (!writer.
write(return_helper)) {
1549 if (!reader.
read(return_helper)) {
1588 return write(writer);
1598 return read(reader);
1603 if (!writeTag(writer)) {
1606 if (!writeArgs(writer)) {
1630 if (!readTag(reader)) {
1633 if (!readArgs(reader)) {
1672 return write(writer);
1678 return read(reader);
1684 if (!writer.
write(return_helper)) {
1697 if (!reader.
read(return_helper)) {
1737 return write(writer);
1747 return read(reader);
1752 if (!writeTag(writer)) {
1755 if (!writeArgs(writer)) {
1782 if (!readTag(reader)) {
1785 if (!readArgs(reader)) {
1832 return write(writer);
1838 return read(reader);
1844 if (!writer.
write(return_helper)) {
1857 if (!reader.
read(return_helper)) {
1872 yarp().setOwner(*
this);
1877 if (!
yarp().canWrite()) {
1881 bool ok =
yarp().write(helper, helper);
1887 if (!
yarp().canWrite()) {
1891 bool ok =
yarp().write(helper, helper);
1897 if (!
yarp().canWrite()) {
1901 bool ok =
yarp().write(helper, helper);
1905 return failed_reply;
1907 return helper.reply.return_helper;
1912 if (!
yarp().canWrite()) {
1916 bool ok =
yarp().write(helper, helper);
1920 return failed_reply;
1922 return helper.reply.return_helper;
1927 if (!
yarp().canWrite()) {
1931 bool ok =
yarp().write(helper, helper);
1935 return failed_reply;
1937 return helper.reply.return_helper;
1942 if (!
yarp().canWrite()) {
1946 bool ok =
yarp().write(helper, helper);
1950 return failed_reply;
1952 return helper.reply.return_helper;
1957 if (!
yarp().canWrite()) {
1961 bool ok =
yarp().write(helper, helper);
1965 return failed_reply;
1967 return helper.reply.return_helper;
1972 if (!
yarp().canWrite()) {
1976 bool ok =
yarp().write(helper, helper);
1982 if (!
yarp().canWrite()) {
1986 bool ok =
yarp().write(helper, helper);
1993 bool showAll = (functionName ==
"--all");
1994 std::vector<std::string> helpString;
1996 helpString.emplace_back(
"*** Available commands:");
2006 helpString.emplace_back(
"help");
2035 if (functionName ==
"help") {
2036 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
2037 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
2038 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");
2039 helpString.emplace_back(
"@return list of strings (one string per line)");
2042 if (helpString.empty()) {
2043 helpString.emplace_back(
"Command not found");
2051 constexpr size_t max_tag_len = 4;
2061 std::string tag = reader.
readTag(1);
2062 bool direct = (tag ==
"__direct__");
2066 while (tag_len <= max_tag_len && !reader.
isError()) {
2067 if(tag ==
"getRemoteProtocolVersion") {
2074 auto proto = getLocalProtocolVersion();
2080 if (!writer.
write(proto)) {
2222 if (tag ==
"help") {
2223 std::string functionName;
2225 functionName =
"--all";
2227 auto help_strings = help(functionName);
2233 if (!writer.
writeTag(
"many", 1, 0)) {
2239 for (
const auto& help_string : help_strings) {
2255 std::string next_tag = reader.
readTag(1);
2256 if (next_tag.empty()) {
2259 tag.append(
"_").append(next_tag);
2260 tag_len = std::count(tag.begin(), tag.end(),
'_') + 1;
ILocalization2DMsgs_getRemoteProtocolVersion_helper()=default
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.
yarp::os::ApplicationNetworkProtocolVersion helper_proto
bool writeTag(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_get_current_position1 return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void call(ILocalization2DMsgs *ptr)
static constexpr const char * s_help
static constexpr size_t s_tag_len
return_get_current_position1(*)() funcptr_t
static constexpr const char * s_prototype
static constexpr size_t s_reply_len
static constexpr size_t s_cmd_len
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.
static constexpr const char * s_tag
ILocalization2DMsgs_get_current_position1_RPC_helper()=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readArgs(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.
return_get_current_position2 return_helper
~Reply() override=default
static constexpr const char * s_help
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_tag_len
void call(ILocalization2DMsgs *ptr)
return_get_current_position2(*)() funcptr_t
static constexpr size_t s_cmd_len
static constexpr const char * s_tag
ILocalization2DMsgs_get_current_position2_RPC_helper()=default
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_prototype
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 write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
return_get_estimated_odometry return_helper
~Reply() override=default
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.
static constexpr size_t s_tag_len
static constexpr size_t s_cmd_len
ILocalization2DMsgs_get_estimated_odometry_RPC_helper()=default
static constexpr const char * s_prototype
static constexpr const char * s_help
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_tag
void call(ILocalization2DMsgs *ptr)
return_get_estimated_odometry(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeTag(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
return_get_estimated_poses return_helper
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
return_get_estimated_poses(*)() funcptr_t
static constexpr size_t s_reply_len
ILocalization2DMsgs_get_estimated_poses_RPC_helper()=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.
static constexpr const char * s_tag
void call(ILocalization2DMsgs *ptr)
static constexpr size_t s_tag_len
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
static constexpr const char * s_help
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
~Command() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
return_get_localization_status return_helper
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void call(ILocalization2DMsgs *ptr)
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
ILocalization2DMsgs_get_localization_status_RPC_helper()=default
static constexpr const char * s_help
static constexpr const char * s_tag
static constexpr const char * s_prototype
static constexpr size_t s_cmd_len
return_get_localization_status(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_tag_len
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Command() override=default
yarp::dev::Nav2D::Map2DLocation loc
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
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
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::dev::ReturnValue(*)(const yarp::dev::Nav2D::Map2DLocation &) funcptr_t
static constexpr const char * s_help
void call(ILocalization2DMsgs *ptr)
static constexpr size_t s_cmd_len
static constexpr const char * s_prototype
static constexpr size_t s_tag_len
ILocalization2DMsgs_set_initial_pose1_RPC_helper()=default
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_tag
static constexpr size_t s_reply_len
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::dev::Nav2D::Map2DLocation loc
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool readArgs(yarp::os::idl::WireReader &reader)
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
~Reply() override=default
yarp::dev::ReturnValue return_helper
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.
static constexpr size_t s_cmd_len
void call(ILocalization2DMsgs *ptr)
yarp::dev::ReturnValue(*)(const yarp::dev::Nav2D::Map2DLocation &, const yarp::sig::Matrix &) funcptr_t
static constexpr size_t s_tag_len
static constexpr const char * s_tag
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr size_t s_reply_len
ILocalization2DMsgs_set_initial_pose2_RPC_helper()=default
static constexpr const char * s_help
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr const char * s_prototype
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool writeTag(const yarp::os::idl::WireWriter &writer) const
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Command() override=default
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool readArgs(yarp::os::idl::WireReader &reader)
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.
~Reply() override=default
yarp::dev::ReturnValue return_helper
static constexpr const char * s_tag
static constexpr size_t s_reply_len
static constexpr const char * s_prototype
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::dev::ReturnValue(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_tag_len
static constexpr size_t s_cmd_len
void call(ILocalization2DMsgs *ptr)
ILocalization2DMsgs_start_localization_service_RPC_helper()=default
static constexpr const char * s_help
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readTag(yarp::os::idl::WireReader &reader)
~Command() override=default
bool readArgs(yarp::os::idl::WireReader &reader)
bool writeArgs(const yarp::os::idl::WireWriter &writer) const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to 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
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
~Reply() override=default
static constexpr const char * s_prototype
static constexpr const char * s_help
static constexpr size_t s_reply_len
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * s_tag
void call(ILocalization2DMsgs *ptr)
yarp::dev::ReturnValue(*)() funcptr_t
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
static constexpr size_t s_tag_len
ILocalization2DMsgs_stop_localization_service_RPC_helper()=default
static constexpr size_t s_cmd_len
virtual return_get_estimated_poses get_estimated_poses_RPC()
virtual yarp::dev::ReturnValue set_initial_pose1_RPC(const yarp::dev::Nav2D::Map2DLocation &loc)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual yarp::os::ApplicationNetworkProtocolVersion getLocalProtocolVersion()
virtual return_get_current_position1 get_current_position1_RPC()
virtual std::vector< std::string > help(const std::string &functionName="--all")
virtual return_get_estimated_odometry get_estimated_odometry_RPC()
virtual return_get_localization_status get_localization_status_RPC()
virtual yarp::dev::ReturnValue stop_localization_service_RPC()
virtual yarp::dev::ReturnValue set_initial_pose2_RPC(const yarp::dev::Nav2D::Map2DLocation &loc, const yarp::sig::Matrix &cov)
virtual bool checkProtocolVersion()
virtual return_get_current_position2 get_current_position2_RPC()
virtual yarp::dev::ReturnValue start_localization_service_RPC()
virtual yarp::os::ApplicationNetworkProtocolVersion getRemoteProtocolVersion()
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
yarp::dev::ReturnValue ret
@ return_value_error_nws_nwc_communication_error
Method is not (yet) implemented.
short int protocol_version
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.
bool write(PortWriter &writer)
Write a message to the associated port or reader.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
IDL-friendly connection reader.
bool readNested(WirePortable &obj)
bool readString(std::string &str, bool *is_vocab=nullptr)
std::string readTag(size_t len=static_cast< size_t >(-1))
bool read(WirePortable &obj)
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 writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeNested(const WirePortable &obj) const
bool writeListBegin(int tag, size_t len) const
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.
#define YARP_VERSION_PATCH
#define YARP_VERSION_MAJOR
#define YARP_VERSION_MINOR