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

# Processes/CMD/PackageCognitionMotion.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file PackageCognitionMotion.cpp
    00003 *
    00004 * Implementation of class PackageCognitionMotion.
    00005 *
    00006 * @author Matthias Jüngel
    00007 */
    00008
    00009 #include "PackageCognitionMotion.h"
    00010 //#include <stdio.h>
    00011 //#include <iostream.h>
    00012
    00013 PackageCognitionMotion::PackageCognitionMotion()
    00014 : teamColor(getPlayer().getTeamColor()),walkParameterTimeStamp(0),wLanStatus(0),timeStamp(0)
    00015 {
    00016   ERS7EvolveWalkingParameters p;
    00017   invKinWalkingParameters = p;
    00018   gt2004WalkingParameters = p;
    00019 }
    00020
    00021 In& operator>>(In& stream, PackageCognitionMotion& packageCognitionMotion)
    00022 {
    00023   int teamColor;
    00024   int watchdog;
    00025   stream
    00026     >> packageCognitionMotion.landmarksPercept
    00027     >> packageCognitionMotion.landmarksState
    00028     >> packageCognitionMotion.robotPose
    00029     >> packageCognitionMotion.ballModel
    00030     >> packageCognitionMotion.playerPoseCollection
    00031     >> packageCognitionMotion.robotState
    00032     >> packageCognitionMotion.motionRequest
    00033     >> packageCognitionMotion.headControlMode
    00034     >> packageCognitionMotion.obstaclesModel
    00035     >> packageCognitionMotion.ledRequest
    00036     >> packageCognitionMotion.soundRequest
    00037     >> teamColor
    00038     >> packageCognitionMotion.invKinWalkingParameters
    00039     >> packageCognitionMotion.gt2004WalkingParameters
    00040     >> packageCognitionMotion.walkParameterTimeStamp
    00041     >> packageCognitionMotion.wLanStatus
    00042     >> packageCognitionMotion.timeStamp
    00043     >> watchdog
    00044     //****for GT2005WalkingEngine****
    00045     >> packageCognitionMotion.gt2005Parameters;
    00046   stream.read(&packageCognitionMotion.gameControlData.data,sizeof(packageCognitionMotion.gameControlData.data));
    00047   stream >> packageCognitionMotion.gameControlData.timeStamp;
    00048   packageCognitionMotion.teamColor = (Player::teamColor) teamColor;
    00049   packageCognitionMotion.watchdog = (Watchdog*) watchdog;
    00050 //  std::cout << "packageCognitionMotion.gameControlData.timeStamp >> :"<<packageCognitionMotion.gameControlData.timeStamp <<"\n";
    00051   return stream;
    00052 }
    00053
    00054 Out& operator<<(Out& stream, const PackageCognitionMotion& packageCognitionMotion)
    00055 {
    00056   stream
    00057     << packageCognitionMotion.landmarksPercept
    00058     << packageCognitionMotion.landmarksState
    00059     << packageCognitionMotion.robotPose
    00060     << packageCognitionMotion.ballModel
    00061     << packageCognitionMotion.playerPoseCollection
    00062     << packageCognitionMotion.robotState
    00063     << packageCognitionMotion.motionRequest
    00064     << packageCognitionMotion.headControlMode
    00065     << packageCognitionMotion.obstaclesModel
    00066     << packageCognitionMotion.ledRequest
    00067     << packageCognitionMotion.soundRequest
    00068     << (int) packageCognitionMotion.teamColor
    00069     << packageCognitionMotion.invKinWalkingParameters
    00070     << packageCognitionMotion.gt2004WalkingParameters
    00071     << packageCognitionMotion.walkParameterTimeStamp
    00072     << packageCognitionMotion.wLanStatus
    00073     << packageCognitionMotion.timeStamp
    00074     << (int) packageCognitionMotion.watchdog
    00075     //****for GT2005WalkingEngine****
    00076     << packageCognitionMotion.gt2005Parameters;
    00077   stream.write(&packageCognitionMotion.gameControlData.data,sizeof(packageCognitionMotion.gameControlData.data));
    00078   stream << packageCognitionMotion.gameControlData.timeStamp;
    00079 //  std::cout << "packageCognitionMotion.gameControlData.timeStamp << :"<<packageCognitionMotion.gameControlData.timeStamp << "\n";
    00080
    00081   return stream;
    00082 }