PerceptionSimulationModule.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 #ifndef __PERCEPTION_SIMULATION_MODULE_H__
00020 #define __PERCEPTION_SIMULATION_MODULE_H__
00021 
00022 #include "KinematicTree.h"
00023 #include "BodySchema.h"
00024 #include "yarp/os/all.h"
00025 #include "SpecializedPort.h"
00026 #include "yarp/os/Stamp.h"
00027 
00028 class PerceptionSimulationModule: public Module{
00029 
00030  protected:
00031 
00032     KinematicTree *body;
00033     KinematicChain *eyes_arm;
00034     KinematicChain *eye_world;
00035     KinematicChain *head;
00036     KinematicChain *arm;
00037     
00038     float delay;
00039     
00040     joint_vec_t arm_angles;
00041     joint_vec_t head_angles;
00042     cart_vec_t position;
00043     cart_vec_t vis_rot;
00044 
00045     Rotation rot;
00046 
00047     JointAngleDataPort efferent_head;
00048     JointAngleDataPort efferent_arm;
00049     JointAngleDataPort proprioception_head;
00050     JointAngleDataPort proprioception_arm;
00051    
00052     CartesianDataPort vision;
00053     VisualRotationPort visualRotation;    
00054 
00055     CommandPort cmdPort;
00056 
00057     Stamp stamp;
00058     double last_time;
00059 
00060 protected:
00061     int loadChain(KinematicChain *chain,Searchable &s,
00062                   const char *from, const char *to, 
00063                   const char *from_def, const char *to_def);
00064 
00065 public:
00066     PerceptionSimulationModule();
00067     ~PerceptionSimulationModule();
00068     virtual bool open(Searchable& config);
00069     virtual bool close();
00070     virtual bool updateModule();
00071     //  virtual bool respond(const Bottle& command, Bottle& reply);
00072 };
00073 
00074 
00075 #endif
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1