Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Representations/Motion/MotionRequest.cpp

Go to the documentation of this file.
00001 /**
00002 * @file MotionRequest.cpp
00003 *
00004 * Implementation of class MotionRequest
00005 * 
00006 * @author Martin Lötzsch
00007 * @author Max Risler
00008 */
00009 
00010 #include "MotionRequest.h"
00011 #include <stdio.h>
00012 #include <string.h>
00013 
00014 void MotionRequest::printOut(char* destination) const
00015 {
00016   sprintf(destination,"%s",getMotionName());
00017 
00018   switch (motionType)
00019   {
00020   case walk:
00021     sprintf(destination,"%s : %s,%.1f %.1f %.1f",
00022       getMotionName(),
00023       getWalkTypeName(),
00024       walkRequest.walkParams.translation.x,walkRequest.walkParams.translation.y,walkRequest.walkParams.rotation);
00025     break;
00026   case specialAction:
00027     sprintf(destination,"%s : %s",
00028       getMotionName(),
00029       getSpecialActionName());
00030     break;
00031   default:
00032     sprintf(destination,"%s", getMotionName());
00033     break;
00034   }
00035 }
00036 
00037 void MotionRequest::operator = (const MotionRequest& other)
00038 {
00039   memcpy(this,&other,sizeof(MotionRequest));
00040 }
00041 
00042 SpecialActionRequest::SpecialActionID SpecialActionRequest::getSpecialActionIDFromName(const char* name)
00043 {
00044   for (int i=0;i<SpecialActionRequest::numOfSpecialAction;i++)
00045   {
00046     if (strcmp(name, (SpecialActionRequest::getSpecialActionIDName((SpecialActionRequest::SpecialActionID)i)))==0)
00047     {
00048       return (SpecialActionRequest::SpecialActionID)i;
00049     }
00050   }
00051 
00052   return SpecialActionRequest::numOfSpecialAction;   
00053 }
00054 
00055 
00056 In& operator>>(In& stream,MotionRequest& motionRequest)
00057 {
00058   stream.read(&motionRequest,sizeof(MotionRequest));
00059   return stream;
00060 }
00061  
00062 Out& operator<<(Out& stream, const MotionRequest& motionRequest)
00063 {
00064   stream.write(&motionRequest,sizeof(MotionRequest));
00065   return stream;
00066 }
00067 
00068 
00069 /*
00070  * Change log :
00071  * 
00072  * $Log: MotionRequest.cpp,v $
00073  * Revision 1.2  2004/06/02 17:19:19  spranger
00074  * split up motionrequest in tail-,specialaction-,walk-request
00075  * removed walkcycle double (its in motioninfo)
00076  *
00077  * Revision 1.1.1.1  2004/05/22 17:25:18  cvsadm
00078  * created new repository GT2004_WM
00079  *
00080  * Revision 1.2  2003/12/16 18:52:55  loetzsch
00081  * added a function for retrieving the id for as string.
00082  *
00083  * Revision 1.1  2003/10/07 10:07:01  cvsadm
00084  * Created GT2004 (M.J.)
00085  *
00086  * Revision 1.1.1.1  2003/07/02 09:40:22  cvsadm
00087  * created new repository for the competitions in Padova from the 
00088  * tamara CVS (Tuesday 2:00 pm)
00089  *
00090  * removed unused solutions
00091  *
00092  * Revision 1.2  2002/09/22 18:40:54  risler
00093  * added new math functions, removed GTMath library
00094  *
00095  * Revision 1.1  2002/09/10 15:26:40  cvsadm
00096  * Created new project GT2003 (M.L.)
00097  * - Cleaned up the /Src/DataTypes directory
00098  * - Removed Challenge Code
00099  * - Removed processing of incoming audio data
00100  * - Renamed AcousticMessage to SoundRequest
00101  *
00102  * Revision 1.3  2002/08/29 14:03:12  dueffert
00103  * includes in correct case, system includes in <>
00104  *
00105  * Revision 1.2  2002/07/08 13:55:54  dueffert
00106  * gcc warning removed
00107  *
00108  * Revision 1.1.1.1  2002/05/10 12:40:13  cvsadm
00109  * Moved GT2002 Project from ute to tamara.
00110  *
00111  * Revision 1.9  2002/05/04 18:18:13  risler
00112  * made printOut const
00113  *
00114  * Revision 1.8  2002/05/04 12:43:38  loetzsch
00115  * The currently executed MotionRequest is now sent from the MotionControl
00116  * to the BehaviorControl via the OdometryData structure
00117  *
00118  * Revision 1.7  2002/04/23 15:08:45  risler
00119  * changed MotionRequest: walk instead of normalWalk,... and walkType added
00120  *
00121  * Revision 1.6  2002/04/16 16:20:14  dueffert
00122  * no message
00123  *
00124  * Revision 1.5  2002/04/15 13:39:24  rentmeister
00125  * DoWalkingEngine (Dortmunder WalkingEngine)
00126  *
00127  * Revision 1.4  2002/04/08 16:27:26  mierswa
00128  * New input for FuzzyBeahviourControl.
00129  *
00130  * Revision 1.3  2002/04/02 16:06:27  loetzsch
00131  * added printOut function
00132  *
00133  * Revision 1.2  2001/12/10 17:47:06  risler
00134  * change log added
00135  *
00136  */

Generated on Thu Sep 23 19:57:35 2004 for GT2004 by doxygen 1.3.6