BodySchemaLogger.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 
00020 #ifndef __BODY_SCHEMA_LOGGER_H__
00021 #define __BODY_SCHEMA_LOGGER_H__
00022 
00023 #include "yarp/os/all.h"
00024 #include "yarp/os/Stamp.h"
00025 #include "SpecializedPort.h"
00026 //#include "KinematicTree.h"
00027 #include <iostream>
00028 #include <fstream>
00029 class BodySchemaLogger :public Module{
00030 
00031  protected:
00032     BodySchemaDataPort body_schema_port;
00033     JointAngleDataPort head_port;
00034     JointAngleDataPort arm_port;
00035     CartesianDataPort vision_port;
00036     VisualRotationPort visual_rotation_port;
00037     
00038     CommandPort cmd;
00039   
00040     int body_data_size;
00041     int head_size;
00042     int arm_size;
00043 
00044     float *body_data;
00045     float *head_position;
00046     float *arm_position;
00047     
00048     float vision[4];
00049     float visual_rotation[5];
00050 
00051     bool binary;
00052 
00053     ofstream body_schema_file;
00054     ofstream head_file;
00055     ofstream arm_file;
00056     ofstream vision_file;
00057     ofstream visual_rotation_file;
00058 
00059 
00060 // protected:
00061 //   int loadChain(KinematicChain *chain,Searchable &s,const char *from, 
00062 //              const char *to, const char *from_def, const char *to_def);
00063 
00064 protected:
00065   void  putInFile(ofstream& out, const float *data, int size);
00066 
00067  public:
00068   virtual bool open(Searchable& config);
00069   virtual bool close();
00070   virtual bool updateModule();
00071 };
00072 
00073 
00074 #endif
 All Data Structures Functions Variables

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