15 PeriodicThread (0.010),
16 m_thrift_rpcPort_Name("/frameTransformGet/
rpc")
30 bool default_config =
true;
31 if(config.
check(
"default-config")) {
32 default_config = config.
find(
"default-config").
asString() ==
"true";
35 if (config.
check(
"nws_thrift_port_prefix")){
36 prefix = config.
find(
"nws_thrift_port_prefix").
asString() + (default_config ? m_defaultConfigPrefix :
"");
37 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
38 m_thrift_rpcPort_Name = prefix +
"/" + m_deviceName +
"/thrift";
41 prefix = default_config ? m_defaultConfigPrefix :
"";
42 m_thrift_rpcPort_Name = prefix +
"/" + m_deviceName +
"/thrift";
45 if(config.
check(
"streaming_enabled")) {
46 m_streaming_port_enabled = config.
find(
"streaming_enabled").
asString() ==
"true";
48 if (config.
check(
"period")) {
54 if(!m_thrift_rpcPort.
open(m_thrift_rpcPort_Name))
59 if(!this->
yarp().attachAsServer(m_thrift_rpcPort))
68 if (m_streaming_port_enabled)
70 if (config.
check(
"output_streaming_port_prefix")){
71 prefix = config.
find(
"output_streaming_port_prefix").
asString() + (default_config ? m_defaultConfigPrefix :
"");
72 if(prefix[0] !=
'/') {prefix =
"/"+prefix;}
73 m_streaming_port_name = prefix +
"/" + m_deviceName +
"/tf:o";
76 prefix = default_config ? m_defaultConfigPrefix :
"";
77 m_streaming_port_name = prefix +
"/" + m_deviceName +
"/tf:o";
94 if (m_streaming_port_enabled)
103 m_thrift_rpcPort.
close();
110 m_iFrameTransformStorageGet =
nullptr;
117 deviceToAttach->
view(m_iFrameTransformStorageGet);
119 if ( m_iFrameTransformStorageGet==
nullptr){
129 if (m_iFrameTransformStorageGet !=
nullptr) {
130 std::vector<yarp::math::FrameTransform> localTransform;
131 if (m_iFrameTransformStorageGet->
getTransforms(localTransform)) {
142 if (!m_streaming_port.
open(m_streaming_port_name))
153 m_streaming_port.
close();
158 if (m_iFrameTransformStorageGet !=
nullptr)
160 std::vector<yarp::math::FrameTransform> localTransform;
161 if (m_iFrameTransformStorageGet->
getTransforms(localTransform))
164 m_streaming_port.
write(rgt);
static bool rpc(const Contact &c, const char *carrier, Bottle &writer, Bottle &reader)
bool view(T *&x)
Get an interface to the device driver.
A container for a device driver.
static bool checkNetwork()
Check if the YARP Network is up and running.
bool setPeriod(double period)
Set the (new) period of the thread.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
void interrupt() override
Interrupt any current reads or writes attached to the port.
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.
A base class for nested structures that can be searched.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual std::string asString() const
Get string value.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCTrace(component,...)
#define yCWarning(component,...)
#define YARP_LOG_COMPONENT(name,...)