icub-client
touchDetectorModule.h
Go to the documentation of this file.
1 #ifndef RPCLISTENERMODULEH
2 #define RPCLISTENERMODULEH
3 
4 /*
5  * Copyright (C) 2015 iCub Facility - Istituto Italiano di Tecnologia
6  * Author: Bertand Higy
7  * email: bertrand.higy@iit.it
8  * Permission is granted to copy, distribute, and/or modify this program
9  * under the terms of the GNU General Public License, version 2 or any
10  * later version published by the Free Software Foundation.
11  *
12  * A copy of the license can be found at
13  * http://www.robotcub.org/icub/license/gpl.txt
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18  * Public License for more details
19 */
20 
21 #include <yarp/os/Bottle.h>
22 #include <yarp/os/BufferedPort.h>
23 #include <yarp/os/ResourceFinder.h>
24 #include <yarp/os/RFModule.h>
25 
26 #include "touchDetectorThread.h"
27 
31 class TouchDetectorModule: public yarp::os::RFModule
32 {
33  public:
34  bool configure(yarp::os::ResourceFinder &rf); // configure all the module parameters and return true if successful
35  bool interruptModule(); // interrupt, e.g., the ports
36  bool close(); // close and shut down the module
37  //bool respond();
38  bool updateModule();
39 
40  protected:
41  /* module parameters */
42  int period;
43  double threshold;
45  std::string moduleName;
46  std::string torsoPortName;
47  std::string leftArmPortName;
48  std::string rightArmPortName;
49  std::string leftForearmPortName;
50  std::string rightForearmPortName;
51  std::string leftHandPortName;
52  std::string rightHandPortName;
53  std::string touchPortName;
54  std::string touchPortCleanName;
55  std::string clustersConfFilepath;
56 
57  /* class variables */
58  yarp::os::BufferedPort<yarp::os::Bottle> torsoPort;
59  yarp::os::BufferedPort<yarp::os::Bottle> leftArmPort;
60  yarp::os::BufferedPort<yarp::os::Bottle> rightArmPort;
61  yarp::os::BufferedPort<yarp::os::Bottle> leftForearmPort;
62  yarp::os::BufferedPort<yarp::os::Bottle> rightForearmPort;
63  yarp::os::BufferedPort<yarp::os::Bottle> leftHandPort;
64  yarp::os::BufferedPort<yarp::os::Bottle> rightHandPort;
65  yarp::os::BufferedPort<yarp::os::Bottle> touchPort;
66  yarp::os::BufferedPort<yarp::os::Bottle> touchPortCleaned;
68 
69  void initializeParameters(yarp::os::ResourceFinder &rf);
70  bool openPorts();
71 };
72 
73 #endif
yarp::os::BufferedPort< yarp::os::Bottle > touchPort
Yarp BufferedPort of bottle for output touched activations.
std::string touchPortName
name of touchport
std::string rightForearmPortName
name of right forearm port
yarp::os::BufferedPort< yarp::os::Bottle > leftForearmPort
Yarp BufferedPort of bottle for input left forearm activations.
std::string leftHandPortName
name of left hand port
bool configure(yarp::os::ResourceFinder &rf)
void initializeParameters(yarp::os::ResourceFinder &rf)
yarp::os::BufferedPort< yarp::os::Bottle > leftHandPort
Yarp BufferedPort of bottle for input left hand activations.
yarp::os::BufferedPort< yarp::os::Bottle > torsoPort
Yarp BufferedPort of bottle for input torso activations.
yarp::os::BufferedPort< yarp::os::Bottle > rightHandPort
Yarp BufferedPort of bottle for input right hand activations.
std::string leftForearmPortName
name of left forearm port
std::string touchPortCleanName
name of touchportClean
yarp::os::BufferedPort< yarp::os::Bottle > touchPortCleaned
Yarp BufferedPort of bottle for output touched taxel.
yarp::os::BufferedPort< yarp::os::Bottle > rightForearmPort
Yarp BufferedPort of bottle for input right forearm activations.
std::string leftArmPortName
name of left arm port
std::string rightHandPortName
name of right hand port
std::string rightArmPortName
name of right arm port
std::string torsoPortName
name of torso port
yarp::os::BufferedPort< yarp::os::Bottle > leftArmPort
Yarp BufferedPort of bottle for input left arm activations.
yarp::os::BufferedPort< yarp::os::Bottle > rightArmPort
Yarp BufferedPort of bottle for input right arm activations.
TouchDetectorThread * thread
std::string clustersConfFilepath
string for path to cluster configure file