RobotsIO
Loading...
Searching...
No Matches
TransformYarpTransformClient.h
1/*
2 * Copyright (C) 2020 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#ifndef ROBOTSIO_TRANSFORMYARPTRANSFORMCLIENT_H
9#define ROBOTSIO_TRANSFORMYARPTRANSFORMCLIENTR_H
10
11#include <RobotsIO/Utils/Transform.h>
12
13#include <Eigen/Dense>
14
15#include <string>
16
17#include <yarp/dev/PolyDriver.h>
18#include <yarp/dev/IFrameTransform.h>
19#include <yarp/os/Network.h>
20
21namespace RobotsIO {
22 namespace Utils {
23 class TransformYarpTransformClient;
24 }
25}
26
27
29{
30public:
31 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
32
33 TransformYarpTransformClient(const std::string& port_prefix, const std::string& source_name, const std::string& target_name);
34
36
37 Eigen::Transform<double, 3, Eigen::Affine> transform() override;
38
39 bool freeze(const bool blocking = false) override;
40
41private:
42 yarp::os::Network yarp_;
43
44 yarp::dev::PolyDriver drv_transform_client_;
45
46 yarp::dev::IFrameTransform* transform_client_;
47
48 Eigen::Transform<double, 3, Eigen::Affine> transform_;
49
50 const std::string source_name_;
51
52 const std::string target_name_;
53
54 const std::string log_name_ = "TransformYarpTransformClient";
55};
56
57#endif /* ROBOTSIO_TRANSFORMYARPTRANSFORMCLIENT_H */