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

# Representations/Cognition/RobotState.cpp

Go to the documentation of this file.

    00001 /**
    00002  * @file RobotState.cpp
    00003  *
    00004  * Implementation of class RobotState.
    00005  */
    00006
    00007 #include "RobotState.h"
    00008
    00009 RobotState::RobotState()
    00010 {
    00011   state = undefined;
    00012
    00013   collisionFrontLeft = false;
    00014   collisionFrontRight = false;
    00015   collisionHindLeft = false;
    00016   collisionHindRight = false;
    00017   collisionHead = false;
    00018   collisionAggregate = false;
    00019   odometryDisturbance = 0;
    00020
    00021   somethingInFrontOfChest = false;
    00022   timeWhenSomethingWasInFrontOfChestLast = 0;
    00023
    00024   consecutiveCollisionTimeFrontLeft = 0;
    00025   consecutiveCollisionTimeFrontRight = 0;
    00026   consecutiveCollisionTimeHindLeft = 0;
    00027   consecutiveCollisionTimeHindRight = 0;
    00028   consecutiveCollisionTimeHead = 0;
    00029   consecutiveCollisionTimeAggregate = 0;
    00030
    00031   collisionSide = 0;
    00032
    00033   acceleration = Vector3<double>(0,0,0);
    00034 }
    00035
    00036 RobotState::~RobotState()
    00037 {
    00038 }
    00039
    00040 void RobotState::operator=(const RobotState& other)
    00041 {
    00042   state = other.state;
    00043 }
    00044
    00045 In& operator>>(In& stream,RobotState& robotState)
    00046 {
    00047   stream >> robotState.frameNumber;
    00048   stream.read(&robotState,sizeof(RobotState));
    00049   return stream;
    00050 }
    00051
    00052 Out& operator<<(Out& stream, const RobotState& robotState)
    00053 {
    00054   stream << robotState.frameNumber;
    00055   stream.write(&robotState,sizeof(RobotState));
    00056   return stream;
    00057 }