|
icub-client
|
Module to detect touch activations to robot's body parts Version:1.0 More...
Collaboration diagram for touchDetector:Classes | |
| class | TouchDetectorModule |
| class | TouchDetectorThread |
Module to detect touch activations to robot's body parts Version:1.0
This module provides wrappers of procedures to count the number of activations to robot 's body parts through some yarp ports.
| class TouchDetectorModule |
Definition at line 31 of file touchDetectorModule.h.
Inheritance diagram for TouchDetectorModule:Public Member Functions | |
| bool | configure (yarp::os::ResourceFinder &rf) |
| bool | interruptModule () |
| bool | close () |
| bool | updateModule () |
Protected Member Functions | |
| void | initializeParameters (yarp::os::ResourceFinder &rf) |
| bool | openPorts () |
Protected Attributes | |
| int | period |
| double | threshold |
| int | taxelThreshold |
| std::string | moduleName |
| std::string | torsoPortName |
| name of torso port More... | |
| std::string | leftArmPortName |
| name of left arm port More... | |
| std::string | rightArmPortName |
| name of right arm port More... | |
| std::string | leftForearmPortName |
| name of left forearm port More... | |
| std::string | rightForearmPortName |
| name of right forearm port More... | |
| std::string | leftHandPortName |
| name of left hand port More... | |
| std::string | rightHandPortName |
| name of right hand port More... | |
| std::string | touchPortName |
| name of touchport More... | |
| std::string | touchPortCleanName |
| name of touchportClean More... | |
| std::string | clustersConfFilepath |
| string for path to cluster configure file More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | torsoPort |
| Yarp BufferedPort of bottle for input torso activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | leftArmPort |
| Yarp BufferedPort of bottle for input left arm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | rightArmPort |
| Yarp BufferedPort of bottle for input right arm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | leftForearmPort |
| Yarp BufferedPort of bottle for input left forearm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | rightForearmPort |
| Yarp BufferedPort of bottle for input right forearm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | leftHandPort |
| Yarp BufferedPort of bottle for input left hand activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | rightHandPort |
| Yarp BufferedPort of bottle for input right hand activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | touchPort |
| Yarp BufferedPort of bottle for output touched activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > | touchPortCleaned |
| Yarp BufferedPort of bottle for output touched taxel. More... | |
| TouchDetectorThread * | thread |
| bool TouchDetectorModule::close | ( | ) |
Definition at line 60 of file touchDetectorModule.cpp.
| bool TouchDetectorModule::configure | ( | yarp::os::ResourceFinder & | rf | ) |
Definition at line 24 of file touchDetectorModule.cpp.
|
protected |
Definition at line 80 of file touchDetectorModule.cpp.
| bool TouchDetectorModule::interruptModule | ( | ) |
Definition at line 46 of file touchDetectorModule.cpp.
|
protected |
Definition at line 111 of file touchDetectorModule.cpp.
| bool TouchDetectorModule::updateModule | ( | ) |
Definition at line 41 of file touchDetectorModule.cpp.
|
protected |
string for path to cluster configure file
Definition at line 55 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input left arm activations.
Definition at line 59 of file touchDetectorModule.h.
|
protected |
name of left arm port
Definition at line 47 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input left forearm activations.
Definition at line 61 of file touchDetectorModule.h.
|
protected |
name of left forearm port
Definition at line 49 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input left hand activations.
Definition at line 63 of file touchDetectorModule.h.
|
protected |
name of left hand port
Definition at line 51 of file touchDetectorModule.h.
|
protected |
Definition at line 45 of file touchDetectorModule.h.
|
protected |
Definition at line 42 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input right arm activations.
Definition at line 60 of file touchDetectorModule.h.
|
protected |
name of right arm port
Definition at line 48 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input right forearm activations.
Definition at line 62 of file touchDetectorModule.h.
|
protected |
name of right forearm port
Definition at line 50 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input right hand activations.
Definition at line 64 of file touchDetectorModule.h.
|
protected |
name of right hand port
Definition at line 52 of file touchDetectorModule.h.
|
protected |
Definition at line 44 of file touchDetectorModule.h.
|
protected |
Definition at line 67 of file touchDetectorModule.h.
|
protected |
Definition at line 43 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for input torso activations.
Definition at line 58 of file touchDetectorModule.h.
|
protected |
name of torso port
Definition at line 46 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for output touched activations.
Definition at line 65 of file touchDetectorModule.h.
|
protected |
Yarp BufferedPort of bottle for output touched taxel.
Definition at line 66 of file touchDetectorModule.h.
|
protected |
name of touchportClean
Definition at line 54 of file touchDetectorModule.h.
|
protected |
name of touchport
Definition at line 53 of file touchDetectorModule.h.
| class TouchDetectorThread |
Definition at line 32 of file touchDetectorThread.h.
Inheritance diagram for TouchDetectorThread:Public Member Functions | |
| TouchDetectorThread (yarp::os::BufferedPort< yarp::os::Bottle > *torsoPort, yarp::os::BufferedPort< yarp::os::Bottle > *leftArmPort, yarp::os::BufferedPort< yarp::os::Bottle > *rightArmPort, yarp::os::BufferedPort< yarp::os::Bottle > *leftForearmPort, yarp::os::BufferedPort< yarp::os::Bottle > *rightForearmPort, yarp::os::BufferedPort< yarp::os::Bottle > *leftHandPort, yarp::os::BufferedPort< yarp::os::Bottle > *rightHandPort, yarp::os::BufferedPort< yarp::os::Bottle > *touchPort, yarp::os::BufferedPort< yarp::os::Bottle > *touchPortCleaned, int period, std::string clustersConfFilepath, double threshold, int taxelThreshold) | |
| void | run () |
| bool | threadInit () |
Protected Member Functions | |
| bool | readTaxelsMapping (std::string filename) |
| readTaxelsMapping Read taxels map from configure file, which relates to nbBodyParts and bodyParts More... | |
| int | getBodyPartId (std::string bodyPartName) |
| getBodyPartId Obtain the ID of body parts, which are "torso", "left_arm", "right_arm", "left_forearm", "right_forearm", "left_hand", "right_hand" More... | |
| void | updateMapping (int bodyPart, int firstTaxel, int lastTaxel, int cluster) |
| updateMapping Change all taxels of a body part to clusterID More... | |
| void | countActivations (int bodyPart, yarp::os::Bottle *data, std::vector< int > &activations) |
| countActivations Counts number of activations to a body part through a buffered port of that part More... | |
| void | processPort (int portNum, yarp::os::BufferedPort< yarp::os::Bottle > *port, std::vector< int > &activations) |
| processPort Process port of body part to receive activations to that body part More... | |
Protected Attributes | |
| int | nbClusters |
| double | threshold |
| int | taxelThreshold |
| integer value of touched threshold More... | |
| std::string | clustersConfFilepath |
| string value of the path to configure file of clusters More... | |
| std::vector< int > | taxels2Clusters [7] |
| standard vector of integer containing the taxel IDs in form of cluster ID More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | torsoPort |
| Yarp BufferedPort of bottle for input torso activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftArmPort |
| Yarp BufferedPort of bottle for input left arm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightArmPort |
| Yarp BufferedPort of bottle for input right arm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftForearmPort |
| Yarp BufferedPort of bottle for input left forearm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightForearmPort |
| Yarp BufferedPort of bottle for input right forearm activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftHandPort |
| Yarp BufferedPort of bottle for input left hand activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightHandPort |
| Yarp BufferedPort of bottle for input right hand activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | touchPort |
| Yarp BufferedPort of bottle for output touched activations. More... | |
| yarp::os::BufferedPort< yarp::os::Bottle > * | touchPortCleaned |
| Yarp BufferedPort of bottle for output touched taxel. More... | |
Static Protected Attributes | |
| static const int | noCluster = -1 |
| static const int | nbBodyParts = 7 |
| static const char * | bodyParts [7] = {"torso", "left_arm", "right_arm", "left_forearm", "right_forearm", "left_hand", "right_hand"} |
| static const int | nbTaxels [7] = {4 * 192, 4 * 192, 4 * 192, 2 * 192, 2 * 192, 192, 192} |
| TouchDetectorThread::TouchDetectorThread | ( | yarp::os::BufferedPort< yarp::os::Bottle > * | torsoPort, |
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftArmPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightArmPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftForearmPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightForearmPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | leftHandPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | rightHandPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | touchPort, | ||
| yarp::os::BufferedPort< yarp::os::Bottle > * | touchPortCleaned, | ||
| int | period, | ||
| std::string | clustersConfFilepath, | ||
| double | threshold, | ||
| int | taxelThreshold | ||
| ) |
Definition at line 37 of file touchDetectorThread.cpp.
|
protected |
countActivations Counts number of activations to a body part through a buffered port of that part
| bodyPart | An integer value of body part ID to count |
| data | YARP bottle contains data from the port of the body part |
| activations | An integer value for number of activations |
Definition at line 186 of file touchDetectorThread.cpp.
|
protected |
getBodyPartId Obtain the ID of body parts, which are "torso", "left_arm", "right_arm", "left_forearm", "right_forearm", "left_hand", "right_hand"
| bodyPartName | String value of the name of body part to get ID |
Definition at line 100 of file touchDetectorThread.cpp.
|
protected |
processPort Process port of body part to receive activations to that body part
| portNum | An integer value of body part ID to count |
| activations | A vector of integer values for number of activations |
| port | The port from which to process data from |
Definition at line 173 of file touchDetectorThread.cpp.
|
protected |
readTaxelsMapping Read taxels map from configure file, which relates to nbBodyParts and bodyParts
| filename | Name of configure file of taxels |
Definition at line 65 of file touchDetectorThread.cpp.
| void TouchDetectorThread::run | ( | ) |
Definition at line 127 of file touchDetectorThread.cpp.
| bool TouchDetectorThread::threadInit | ( | ) |
Definition at line 50 of file touchDetectorThread.cpp.
|
protected |
updateMapping Change all taxels of a body part to clusterID
| bodyPart | An integer value of body part ID |
| firstTaxel | An integer value of the 1st taxel of the body part |
| lastTaxel | An integer value of the last taxel of the body part |
| cluster | An integer value of the cluster ID |
Definition at line 119 of file touchDetectorThread.cpp.
|
staticprotected |
Definition at line 42 of file touchDetectorThread.h.
|
protected |
string value of the path to configure file of clusters
Definition at line 48 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input left arm activations.
Definition at line 53 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input left forearm activations.
Definition at line 55 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input left hand activations.
Definition at line 57 of file touchDetectorThread.h.
|
staticprotected |
Definition at line 41 of file touchDetectorThread.h.
|
protected |
Definition at line 45 of file touchDetectorThread.h.
|
staticprotected |
Definition at line 43 of file touchDetectorThread.h.
|
staticprotected |
Definition at line 40 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input right arm activations.
Definition at line 54 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input right forearm activations.
Definition at line 56 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input right hand activations.
Definition at line 58 of file touchDetectorThread.h.
|
protected |
standard vector of integer containing the taxel IDs in form of cluster ID
Definition at line 49 of file touchDetectorThread.h.
|
protected |
integer value of touched threshold
Definition at line 47 of file touchDetectorThread.h.
|
protected |
Definition at line 46 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for input torso activations.
Definition at line 52 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for output touched activations.
Definition at line 59 of file touchDetectorThread.h.
|
protected |
Yarp BufferedPort of bottle for output touched taxel.
Definition at line 60 of file touchDetectorThread.h.
1.8.13