iCub-main
skinManager.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
4  * Authors: Andrea Del Prete, Alexander Schmitz
5  * email: andrea.delprete@iit.it, alexander.schmitz@iit.it
6  * website: www.robotcub.org
7  * Permission is granted to copy, distribute, and/or modify this program
8  * under the terms of the GNU General Public License, version 2 or any
9  * later version published by the Free Software Foundation.
10  *
11  * A copy of the license can be found at
12  * http://www.robotcub.org/icub/license/gpl.txt
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details
18  */
19 
20 
213 #ifndef __ICUB_skinManager_H__
214 #define __ICUB_skinManager_H__
215 
216 #include <string>
217 
218 #include <yarp/os/RFModule.h>
219 #include <yarp/os/Network.h>
220 #include <yarp/os/Vocab.h>
221 
225 
226 namespace iCub {
227  namespace skinManager {
228  class skinManager : public RFModule {
229  public:
230  bool configure(yarp::os::ResourceFinder &rf); // configure all the module parameters and return true if successful
231  bool interruptModule(); // interrupt, e.g., the ports
232  bool close(); // close and shut down the module
233  bool respond(const yarp::os::Bottle& command, yarp::os::Bottle& reply);
234  double getPeriod();
235  bool updateModule();
236 
237  private:
238  // module default values
239  static const bool CALIBRATION_ALLOWED_DEFAULT;
240  static const int MIN_BASELINE_DEFAULT;
241  static const int PERIOD_DEFAULT;
242  static const int ADD_THRESHOLD_DEFAULT;
243  static const bool SMOOTH_FILTER_DEFAULT;
244  static const float SMOOTH_FACTOR_DEFAULT;
245  static const float COMPENSATION_GAIN_DEFAULT;
246  static const float CONTACT_COMPENSATION_GAIN_DEFAULT;
247  static const std::string MODULE_NAME_DEFAULT;
248  static const std::string ROBOT_NAME_DEFAULT;
249  static const bool ZERO_UP_RAW_DATA_DEFAULT;
250  static const bool BINARIZATION_DEFAULT;
251  static const std::string RPC_PORT_DEFAULT;
252 
253  /* module parameters */
254  std::string moduleName;
255  std::string robotName;
256 
257  /* ports */
258  yarp::os::Port handlerPort; // a port to handle messages
259 
260  /* pointer to a new thread to be created and started in configure() and stopped in close() */
261  CompensationThread *myThread;
263 
264  void addToBottle(yarp::os::Bottle& b, const yarp::sig::Vector& v);
265  void addToBottle(yarp::os::Bottle& b, const std::vector<yarp::sig::Vector>& v);
266  bool bottleToVector(const yarp::os::Bottle& b, yarp::sig::Vector& v);
267  bool identifyCommand(yarp::os::Bottle commandBot, SkinManagerCommand &com, yarp::os::Bottle& params);
268 
269  };
270  } //namespace iCub
271 } //namespace skinManager
272 
273 #endif // __ICUB_skinManager_H__
274 //empty line to make gcc happy
275 
bool respond(const yarp::os::Bottle &command, yarp::os::Bottle &reply)
bool configure(yarp::os::ResourceFinder &rf)
Definition: skinManager.cpp:47
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.