22 bool default_config =
true;
23 if(config.check(
"default-client")) {
24 default_config = config.find(
"default-client").asString() ==
"true";
26 bool default_server =
true;
27 if(config.check(
"default-server")) {
28 default_server = config.find(
"default-server").asString() ==
"true";
31 if (config.check(
"nwc_thrift_port_prefix")){
32 prefix = config.find(
"nwc_thrift_port_prefix").asString() + (default_config ? m_defaultConfigPrefix :
"");
33 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
34 m_thrift_rpcPort_Name = prefix +
"/" + m_deviceName +
"/thrift";
37 prefix = default_config ? m_defaultConfigPrefix :
"";
38 m_thrift_rpcPort_Name = prefix +
"/" + m_deviceName +
"/thrift";
43 if (config.check(
"nws_thrift_port_prefix")){
44 prefix = config.find(
"nws_thrift_port_prefix").asString() + (default_server ? m_defaultServerPrefix :
"");
45 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
46 m_thrift_server_rpcPort_Name = prefix +
"/thrift";
49 prefix = default_server ? m_defaultServerPrefix :
"";
50 m_thrift_server_rpcPort_Name = prefix +
"/thrift";
54 if(!m_thrift_rpcPort.open(m_thrift_rpcPort_Name))
65 if (!m_frameTransformStorageGetRPC.yarp().attachAsClient(m_thrift_rpcPort))
72 if(config.check(
"streaming_enabled")) {
73 m_streaming_port_enabled = config.find(
"streaming_enabled").asString() ==
"true";
76 if (m_streaming_port_enabled)
79 if (config.check(
"input_streaming_port_prefix")){
80 prefix = config.find(
"input_streaming_port_prefix").asString() + (default_config ? m_defaultConfigPrefix :
"");
81 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
82 m_streaming_input_port_name = prefix +
"/" + m_deviceName +
"/tf:i";
85 prefix = default_config ? m_defaultConfigPrefix :
"";
86 m_streaming_input_port_name = prefix +
"/" + m_deviceName +
"/tf:i";
91 if (config.check(
"output_streaming_port_prefix")){
92 prefix = config.find(
"output_streaming_port_prefix").asString() + (default_server ? m_defaultServerPrefix :
"");
93 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
94 m_streaming_output_port_name = prefix +
"/tf:o";
97 prefix = default_server ? m_defaultServerPrefix :
"";
98 m_streaming_output_port_name = prefix +
"/tf:o";
103 m_dataReader =
new FrameTransformGet_nwc_yarp::DataReader();
104 if(!m_dataReader->open(m_streaming_input_port_name))
116 m_dataReader->useCallback();
129 if (m_streaming_port_enabled)
131 m_dataReader->interrupt();
132 m_dataReader->close();
134 m_thrift_rpcPort.
close();
141 if (!m_streaming_port_enabled)
157 m_dataReader->getData(retrievedFromSteaming);
void onRead(return_getAllTransforms &datum) override
Callback method.
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.
static bool checkNetwork()
Check if the YARP Network is up and running.
void close() override
Stop port activity.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCWarning(component,...)
#define YARP_LOG_COMPONENT(name,...)
The main, catch-all namespace for YARP.