Fawkes API Fawkes Development Version

LocalizerControlInterface.h

00001 
00002 /***************************************************************************
00003  *  LocalizerControlInterface.h - Fawkes BlackBoard Interface - LocalizerControlInterface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2009  Daniel Beck
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __INTERFACES_LOCALIZERCONTROLINTERFACE_H_
00025 #define __INTERFACES_LOCALIZERCONTROLINTERFACE_H_
00026 
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030 
00031 namespace fawkes {
00032 
00033 class LocalizerControlInterface : public Interface
00034 {
00035  /// @cond INTERNALS
00036  INTERFACE_MGMT_FRIENDS(LocalizerControlInterface)
00037  /// @endcond
00038  public:
00039   /* constants */
00040 
00041  private:
00042 #pragma pack(push,4)
00043   /** Internal data storage, do NOT modify! */
00044   typedef struct {
00045     int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00046     int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00047     char map_name[30]; /**< The name of the current
00048     map */
00049   } LocalizerControlInterface_data_t;
00050 #pragma pack(pop)
00051 
00052   LocalizerControlInterface_data_t *data;
00053 
00054  public:
00055   /* messages */
00056   class ResetMessage : public Message
00057   {
00058    private:
00059 #pragma pack(push,4)
00060     /** Internal data storage, do NOT modify! */
00061     typedef struct {
00062       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00063       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00064       float x; /**< The new initial x-coordinate. */
00065       float y; /**< The new initial x-coordinate. */
00066       float ori; /**< The new initial orientation. */
00067       float variance; /**< The variance for the reset position. */
00068     } ResetMessage_data_t;
00069 #pragma pack(pop)
00070 
00071     ResetMessage_data_t *data;
00072 
00073    public:
00074     ResetMessage(const float ini_x, const float ini_y, const float ini_ori, const float ini_variance);
00075     ResetMessage();
00076     ~ResetMessage();
00077 
00078     ResetMessage(const ResetMessage *m);
00079     /* Methods */
00080     float x() const;
00081     void set_x(const float new_x);
00082     size_t maxlenof_x() const;
00083     float y() const;
00084     void set_y(const float new_y);
00085     size_t maxlenof_y() const;
00086     float ori() const;
00087     void set_ori(const float new_ori);
00088     size_t maxlenof_ori() const;
00089     float variance() const;
00090     void set_variance(const float new_variance);
00091     size_t maxlenof_variance() const;
00092     virtual Message * clone() const;
00093   };
00094 
00095   virtual bool message_valid(const Message *message) const;
00096  private:
00097   LocalizerControlInterface();
00098   ~LocalizerControlInterface();
00099 
00100  public:
00101   /* Methods */
00102   char * map_name() const;
00103   void set_map_name(const char * new_map_name);
00104   size_t maxlenof_map_name() const;
00105   virtual Message * create_message(const char *type) const;
00106 
00107   virtual void copy_values(const Interface *other);
00108   virtual const char * enum_tostring(const char *enumtype, int val) const;
00109 
00110 };
00111 
00112 } // end namespace fawkes
00113 
00114 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends