43 if (!writer.
writeString(
"getRemoteProtocolVersion")) {
57 if (!helper_proto.read(connection)) {
67 if(!
yarp().canWrite()) {
68 yError(
" Missing server method ILocalization2DMsgs::getRemoteProtocolVersion");
73 return helper.helper_proto;}
84 if (remproto.protocol_version != locproto.protocol_version)
86 yCError(SERVICE_LOG_COMPONENT) <<
"Invalid communication protocol.";
87 yCError(SERVICE_LOG_COMPONENT) <<
"Local Protocol Version: " << locproto.toString();
88 yCError(SERVICE_LOG_COMPONENT) <<
"Remote Protocol Version: " << remproto.toString();
158 static constexpr const char*
s_tag{
"start_localization_service_RPC"};
162 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::start_localization_service_RPC()"};
216 static constexpr const char*
s_tag{
"stop_localization_service_RPC"};
220 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::stop_localization_service_RPC()"};
274 static constexpr const char*
s_tag{
"get_localization_status_RPC"};
278 static constexpr const char*
s_prototype{
"return_get_localization_status ILocalization2DMsgs::get_localization_status_RPC()"};
332 static constexpr const char*
s_tag{
"get_estimated_poses_RPC"};
336 static constexpr const char*
s_prototype{
"return_get_estimated_poses ILocalization2DMsgs::get_estimated_poses_RPC()"};
390 static constexpr const char*
s_tag{
"get_current_position1_RPC"};
394 static constexpr const char*
s_prototype{
"return_get_current_position1 ILocalization2DMsgs::get_current_position1_RPC()"};
448 static constexpr const char*
s_tag{
"get_current_position2_RPC"};
452 static constexpr const char*
s_prototype{
"return_get_current_position2 ILocalization2DMsgs::get_current_position2_RPC()"};
506 static constexpr const char*
s_tag{
"get_estimated_odometry_RPC"};
510 static constexpr const char*
s_prototype{
"return_get_estimated_odometry ILocalization2DMsgs::get_estimated_odometry_RPC()"};
569 static constexpr const char*
s_tag{
"set_initial_pose1_RPC"};
573 static constexpr const char*
s_prototype{
"yarp::dev::ReturnValue ILocalization2DMsgs::set_initial_pose1_RPC(const yarp::dev::Nav2D::Map2DLocation& loc)"};
633 static constexpr const char*
s_tag{
"set_initial_pose2_RPC"};
637 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)"};
658 return write(writer);
673 if (!writeTag(writer)) {
676 if (!writeArgs(writer)) {
697 if (!readTag(reader)) {
700 if (!readArgs(reader)) {
731 return write(writer);
743 if (!writer.
write(return_helper)) {
756 if (!reader.
read(return_helper)) {
785 return write(writer);
800 if (!writeTag(writer)) {
803 if (!writeArgs(writer)) {
824 if (!readTag(reader)) {
827 if (!readArgs(reader)) {
858 return write(writer);
870 if (!writer.
write(return_helper)) {
883 if (!reader.
read(return_helper)) {
912 return write(writer);
927 if (!writeTag(writer)) {
930 if (!writeArgs(writer)) {
951 if (!readTag(reader)) {
954 if (!readArgs(reader)) {
985 return write(writer);
1000 if (!writer.
write(return_helper)) {
1016 if (!reader.
read(return_helper)) {
1045 return write(writer);
1055 return read(reader);
1060 if (!writeTag(writer)) {
1063 if (!writeArgs(writer)) {
1084 if (!readTag(reader)) {
1087 if (!readArgs(reader)) {
1118 return write(writer);
1124 return read(reader);
1133 if (!writer.
write(return_helper)) {
1149 if (!reader.
read(return_helper)) {
1178 return write(writer);
1188 return read(reader);
1193 if (!writeTag(writer)) {
1196 if (!writeArgs(writer)) {
1217 if (!readTag(reader)) {
1220 if (!readArgs(reader)) {
1251 return write(writer);
1257 return read(reader);
1266 if (!writer.
write(return_helper)) {
1282 if (!reader.
read(return_helper)) {
1311 return write(writer);
1321 return read(reader);
1326 if (!writeTag(writer)) {
1329 if (!writeArgs(writer)) {
1350 if (!readTag(reader)) {
1353 if (!readArgs(reader)) {
1384 return write(writer);
1390 return read(reader);
1399 if (!writer.
write(return_helper)) {
1415 if (!reader.
read(return_helper)) {
1444 return write(writer);
1454 return read(reader);
1459 if (!writeTag(writer)) {
1462 if (!writeArgs(writer)) {
1483 if (!readTag(reader)) {
1486 if (!readArgs(reader)) {
1517 return write(writer);
1523 return read(reader);
1532 if (!writer.
write(return_helper)) {
1548 if (!reader.
read(return_helper)) {
1587 return write(writer);
1597 return read(reader);
1602 if (!writeTag(writer)) {
1605 if (!writeArgs(writer)) {
1629 if (!readTag(reader)) {
1632 if (!readArgs(reader)) {
1671 return write(writer);
1677 return read(reader);
1683 if (!writer.
write(return_helper)) {
1696 if (!reader.
read(return_helper)) {
1736 return write(writer);
1746 return read(reader);
1751 if (!writeTag(writer)) {
1754 if (!writeArgs(writer)) {
1781 if (!readTag(reader)) {
1784 if (!readArgs(reader)) {
1831 return write(writer);
1837 return read(reader);
1843 if (!writer.
write(return_helper)) {
1856 if (!reader.
read(return_helper)) {
1871 yarp().setOwner(*
this);
1876 if (!
yarp().canWrite()) {
1880 bool ok =
yarp().write(helper, helper);
1886 if (!
yarp().canWrite()) {
1890 bool ok =
yarp().write(helper, helper);
1896 if (!
yarp().canWrite()) {
1900 bool ok =
yarp().write(helper, helper);
1906 if (!
yarp().canWrite()) {
1910 bool ok =
yarp().write(helper, helper);
1916 if (!
yarp().canWrite()) {
1920 bool ok =
yarp().write(helper, helper);
1926 if (!
yarp().canWrite()) {
1930 bool ok =
yarp().write(helper, helper);
1936 if (!
yarp().canWrite()) {
1940 bool ok =
yarp().write(helper, helper);
1946 if (!
yarp().canWrite()) {
1950 bool ok =
yarp().write(helper, helper);
1956 if (!
yarp().canWrite()) {
1960 bool ok =
yarp().write(helper, helper);
1967 bool showAll = (functionName ==
"--all");
1968 std::vector<std::string> helpString;
1970 helpString.emplace_back(
"*** Available commands:");
1980 helpString.emplace_back(
"help");
2009 if (functionName ==
"help") {
2010 helpString.emplace_back(
"std::vector<std::string> help(const std::string& functionName = \"--all\")");
2011 helpString.emplace_back(
"Return list of available commands, or help message for a specific function");
2012 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");
2013 helpString.emplace_back(
"@return list of strings (one string per line)");
2016 if (helpString.empty()) {
2017 helpString.emplace_back(
"Command not found");
2025 constexpr size_t max_tag_len = 4;
2035 std::string tag = reader.
readTag(1);
2036 bool direct = (tag ==
"__direct__");
2040 while (tag_len <= max_tag_len && !reader.
isError()) {
2041 if(tag ==
"getRemoteProtocolVersion") {
2048 auto proto = getLocalProtocolVersion();
2054 if (!writer.
write(proto)) {
2196 if (tag ==
"help") {
2197 std::string functionName;
2199 functionName =
"--all";
2201 auto help_strings = help(functionName);
2207 if (!writer.
writeTag(
"many", 1, 0)) {
2213 for (
const auto& help_string : help_strings) {
2229 std::string next_tag = reader.
readTag(1);
2230 if (next_tag.empty()) {
2233 tag.append(
"_").append(next_tag);
2234 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()
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