YARP
Yet Another Robot Platform
FrameTransformSet_nws_yarp.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_FRAMETRANSFORMSETNWSYARP_H
7 #define YARP_DEV_FRAMETRANSFORMSETNWSYARP_H
8 
9 
10 #include <yarp/os/Network.h>
12 #include <yarp/sig/Vector.h>
13 #include <yarp/dev/PolyDriver.h>
14 #include <yarp/dev/WrapperSingle.h>
16 #include <mutex>
17 #include <map>
18 
61 {
62 
63 public:
65 
66  //DeviceDriver
67  bool open(yarp::os::Searchable& config) override;
68  bool close() override;
69 
70  //wrapper and interfaces
71  bool attach(yarp::dev::PolyDriver* device2attach) override;
72  bool detach() override;
73 
74  //FrameTransformStorageSetRPC functions
75  bool setTransformsRPC(const std::vector<yarp::math::FrameTransform>& transforms) override;
76  bool setTransformRPC(const yarp::math::FrameTransform& transform) override;
77  bool deleteTransformRPC(const std::string& src, const std::string& dst) override;
78  bool clearAllRPC()override;
79 
80 private:
81  mutable std::mutex m_pd_mutex;
82  mutable std::mutex m_trf_mutex;
83  std::string m_defaultConfigPrefix{"/frameTransformServer"};
84  std::string m_deviceName{"frameTransformSet_nws_yarp"};
85  yarp::dev::PolyDriver* m_pDriver{nullptr};
86  std::string m_thriftPortName;
87  yarp::os::Port m_thriftPort;
88  yarp::dev::IFrameTransformStorageSet* m_iSetIf {nullptr};
89  yarp::dev::IFrameTransformStorageUtils* m_iUtilsIf {nullptr};
90 };
91 
92 #endif // YARP_DEV_FRAMETRANSFORMSETNWSYARP_H
contains the definition of a Vector type
frameTransformSet_nws_yarp: A network wrapper client which publishes the transforms received on the y...
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
FrameTransformSet_nws_yarp()=default
bool setTransformsRPC(const std::vector< yarp::math::FrameTransform > &transforms) override
bool setTransformRPC(const yarp::math::FrameTransform &transform) override
bool deleteTransformRPC(const std::string &src, const std::string &dst) override
bool detach() override
Detach the object (you must have first called attach).
bool attach(yarp::dev::PolyDriver *device2attach) override
Attach to another object.
bool close() override
Close the DeviceDriver.
Interface implemented by all device drivers.
Definition: DeviceDriver.h:35
A container for a device driver.
Definition: PolyDriver.h:24
Helper interface for an object that can wrap/or "attach" to a single other device.
Definition: WrapperSingle.h:32
A mini-server for network communication.
Definition: Port.h:47
A base class for nested structures that can be searched.
Definition: Searchable.h:66