24 yCInfo(
YARPDESCINFO) <<
"By default it prints on screen all the connections found on the yarp network.";
25 yCInfo(
YARPDESCINFO) <<
"use the --file <filename> to choose the name of the output file. (default: outputfile.dot) ";
26 yCInfo(
YARPDESCINFO) <<
"use the --remote <remote_port> to select a specific the robotDescription_nws_yarp rpc port (default: /robotDescription_nws_yarp/rpc)";
27 yCInfo(
YARPDESCINFO) <<
"use an online dot editor (e.g. https://dreampuf.github.io/GraphvizOnline) to visualize the graph.";
30int main(
int argc,
char *argv[])
39 std::string filename =
"outputfile.dot";
40 std::string
remotename =
"/robotDescription_nws_yarp/rpc";
46 if (p.
check(
"remote")) {
52 pcfg.put(
"device",
"robotDescription_nwc_yarp");
53 pcfg.put(
"local",
"/robotDescription_nwc_yarp/rpc");
59 std::vector<yarp::dev::DeviceDescription> devlist;
67 file.
open(filename.c_str(), std::ios::out);
68 file <<
"digraph G" <<
endl;
70 file <<
" splines = \"compound\"" <<
endl;
71 file <<
" rankdir= \"TB\"" <<
endl;
72 file <<
" subgraph cluster_net" <<
endl;
77d1.device_name =
"left_arm_b1";
78d1.device_type =
"ControlBoard";
80d2.device_name =
"left_arm_b2";
81d2.device_type =
"ControlBoard";
83d3.device_name =
"left_arm_Remapper";
84d3.device_type =
"ControlBoardRemapper";
85d3.device_extra_info =
"left_arm_b1 left_arm_b2";
87d4.device_name =
"left_arm_NWS";
88d4.device_type =
"ControlBoard_nws_yarp";
89d4.device_extra_info =
"left_arm_Remapper";
96 for (
auto it = devlist.begin();
it != devlist.end();
it++)
100 if (
dtype.find(
"nws_yarp") != std::string::npos)
102 file <<
" node_" <<
dname <<
"[label = <<FONT COLOR=\"red\" > " <<
dtype <<
"</FONT><BR/><FONT COLOR= \"black\"> " <<
dname <<
"</FONT> > shape=box style=filled fillcolor=lightblue];" <<
endl;
106 file <<
" node_" <<
dname <<
"[label = <<FONT COLOR=\"red\" > " <<
dtype <<
"</FONT><BR/><FONT COLOR= \"black\"> " <<
dname <<
"</FONT> > shape=box];" <<
endl;
111 for (
auto it = devlist.begin();
it != devlist.end();
it++)
113 string src =
it->device_name;
114 string extra =
it->device_extra_info;
115 std::vector<std::string>
tokens;
122 file <<
" node_" << src <<
" -> " <<
"node_" << dest <<
endl;
127 file <<
" label = yarprobotinterface"<<
endl;
128 file <<
" }" <<
endl;
This interface allows users to retrieve a list which contains the names and the types of the currentl...
A container for a device driver.
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Utilities for manipulating the YARP network, including initialization and shutdown.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
void fromCommand(int argc, char *argv[], bool skipFirst=true, bool wipe=true)
Interprets a list of command arguments as a list of properties.
virtual std::string asString() const
Get string value.
int main(int argc, char *argv[])
#define yCInfo(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.