Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
LocalizerControlInterface.h
1 
2 /***************************************************************************
3  * LocalizerControlInterface.h - Fawkes BlackBoard Interface - LocalizerControlInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2009 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __INTERFACES_LOCALIZERCONTROLINTERFACE_H_
25 #define __INTERFACES_LOCALIZERCONTROLINTERFACE_H_
26 
27 #include <interface/interface.h>
28 #include <interface/message.h>
29 #include <interface/field_iterator.h>
30 
31 namespace fawkes {
32 
34 {
35  /// @cond INTERNALS
36  INTERFACE_MGMT_FRIENDS(LocalizerControlInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  private:
42 #pragma pack(push,4)
43  /** Internal data storage, do NOT modify! */
44  typedef struct {
45  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
46  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
47  char map_name[30]; /**< The name of the current
48  map */
49  } LocalizerControlInterface_data_t;
50 #pragma pack(pop)
51 
52  LocalizerControlInterface_data_t *data;
53 
54  public:
55  /* messages */
56  class ResetMessage : public Message
57  {
58  private:
59 #pragma pack(push,4)
60  /** Internal data storage, do NOT modify! */
61  typedef struct {
62  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
63  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
64  float x; /**< The new initial x-coordinate. */
65  float y; /**< The new initial x-coordinate. */
66  float ori; /**< The new initial orientation. */
67  float variance; /**< The variance for the reset position. */
68  } ResetMessage_data_t;
69 #pragma pack(pop)
70 
71  ResetMessage_data_t *data;
72 
73  public:
74  ResetMessage(const float ini_x, const float ini_y, const float ini_ori, const float ini_variance);
75  ResetMessage();
76  ~ResetMessage();
77 
78  ResetMessage(const ResetMessage *m);
79  /* Methods */
80  float x() const;
81  void set_x(const float new_x);
82  size_t maxlenof_x() const;
83  float y() const;
84  void set_y(const float new_y);
85  size_t maxlenof_y() const;
86  float ori() const;
87  void set_ori(const float new_ori);
88  size_t maxlenof_ori() const;
89  float variance() const;
90  void set_variance(const float new_variance);
91  size_t maxlenof_variance() const;
92  virtual Message * clone() const;
93  };
94 
95  virtual bool message_valid(const Message *message) const;
96  private:
99 
100  public:
101  /* Methods */
102  char * map_name() const;
103  void set_map_name(const char * new_map_name);
104  size_t maxlenof_map_name() const;
105  virtual Message * create_message(const char *type) const;
106 
107  virtual void copy_values(const Interface *other);
108  virtual const char * enum_tostring(const char *enumtype, int val) const;
109 
110 };
111 
112 } // end namespace fawkes
113 
114 #endif