1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * @file RobotInfo.h
 *
 * @author <a href="mailto:xu@informatik.hu-berlin.de">Xu Yuan</a>
 * @breief some basic information about robot
 *
 */

#ifndef ROBOTINFO_H
#define ROBOTINFO_H

#include "Tools/DataStructures/Printable.h"
#include "Tools/DataStructures/Serializer.h"


namespace naoth
{

class RobotInfo: public Printable
{
public:
  RobotInfo(){}<--- Member variable 'RobotInfo::basicTimeStep' is not initialized in the constructor.

  std::string platform;
  std::string bodyNickName;
  std::string headNickName;
  std::string bodyID;

  /** The time of each step which depends on platforms */
  unsigned int basicTimeStep;
  
  /**
  * The method returns the basic time step in seconds
  */
  inline double getBasicTimeStepInSecond() const { return static_cast<double>(basicTimeStep)/1000.0; }


  virtual void print(std::ostream& stream) const
  {
    stream << "Platform: " << platform << std::endl;
    stream << "HeadNickName: " << headNickName << std::endl;
    stream << "BodyNickName: " << bodyNickName << std::endl;
    stream << "BodyID: " << bodyID << std::endl;
    stream << "basicTimeStep: " << basicTimeStep << std::endl;
  }
};

template<>
class Serializer<RobotInfo>
{
  public:
    static void serialize(const RobotInfo& representation, std::ostream& stream);
    static void deserialize(std::istream& stream, RobotInfo& representation);
};

} // namespace naoth

#endif // ROBOTINFO_H