RobotsIO
Loading...
Searching...
No Matches
iCubHand.h
1/*
2 * Copyright (C) 2019 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_ICUBHAND_H
9#define ROBOTSIO_ICUBHAND_H
10
11#include <Eigen/Dense>
12
13#include <iCub/iKin/iKinFwd.h>
14
15#include <yarp/dev/IAnalogSensor.h>
16#include <yarp/dev/IControlLimits.h>
17#include <yarp/dev/IEncoders.h>
18#include <yarp/dev/PolyDriver.h>
19#include <yarp/sig/Matrix.h>
20#include <yarp/os/Network.h>
21#include <yarp/os/ResourceFinder.h>
22
23#include <string>
24#include <unordered_map>
25
26namespace RobotsIO {
27 namespace Hand {
28 class iCubHand;
29 }
30}
31
32
34{
35public:
36 iCubHand(const std::string& robot_name, const std::string& laterality, const std::string& port_prefix, const std::string& context, const bool& use_analogs, const std::string& thumb_version = "");
37
38 virtual ~iCubHand();
39
40 std::pair<bool, std::unordered_map<std::string, Eigen::VectorXd>> encoders(const bool& blocking);
41
42protected:
43 std::pair<bool, yarp::sig::Vector> load_vector_double(const yarp::os::ResourceFinder& rf, const std::string key, const std::size_t size);
44
45 yarp::os::Network yarp_;
46
47 const bool use_analogs_ = false;
48
54
55 bool use_interface_arm_ = false;
56
61 yarp::dev::PolyDriver drv_analog_;
62
63 yarp::dev::IAnalogSensor *ianalog_{nullptr};
64
65 yarp::dev::IControlLimits *ilimits_{nullptr};
66
67 yarp::dev::PolyDriver drv_arm_;
68
69 yarp::dev::IEncoders *iarm_{nullptr};
70
75 yarp::os::BufferedPort<yarp::os::Bottle> port_analogs_;
76
77 yarp::os::BufferedPort<yarp::os::Bottle> port_arm_;
78
83 std::unordered_map<std::string, iCub::iKin::iCubFinger> fingers_;
84
89 yarp::sig::Matrix analog_bounds_;
90
91 bool use_bounds_ = false;
92
97 const std::string log_name_ = "iCubHand";
98};
99
100#endif /* ROBOTSIO_ICUBHAND_H */
const std::string log_name_
Definition: iCubHand.h:97
std::unordered_map< std::string, iCub::iKin::iCubFinger > fingers_
Definition: iCubHand.h:83
yarp::dev::PolyDriver drv_analog_
Definition: iCubHand.h:61
yarp::sig::Matrix analog_bounds_
Definition: iCubHand.h:89
yarp::os::BufferedPort< yarp::os::Bottle > port_analogs_
Definition: iCubHand.h:75