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   /** Internal data storage, do NOT modify! */
00043   typedef struct {
00044     char map_name[30]; /**< The name of the current
00045     map */
00046   } LocalizerControlInterface_data_t;
00047
00048   LocalizerControlInterface_data_t *data;
00049
00050  public:
00051   /* messages */
00052   class ResetMessage : public Message
00053   {
00054    private:
00055     /** Internal data storage, do NOT modify! */
00056     typedef struct {
00057       float x; /**< The new initial x-coordinate. */
00058       float y; /**< The new initial x-coordinate. */
00059       float ori; /**< The new initial orientation. */
00060       float variance; /**< The variance for the reset position. */
00061     } ResetMessage_data_t;
00062
00063     ResetMessage_data_t *data;
00064
00065    public:
00066     ResetMessage(const float ini_x, const float ini_y, const float ini_ori, const float ini_variance);
00067     ResetMessage();
00068     ~ResetMessage();
00069
00070     ResetMessage(const ResetMessage *m);
00071     /* Methods */
00072     float x() const;
00073     void set_x(const float new_x);
00074     size_t maxlenof_x() const;
00075     float y() const;
00076     void set_y(const float new_y);
00077     size_t maxlenof_y() const;
00078     float ori() const;
00079     void set_ori(const float new_ori);
00080     size_t maxlenof_ori() const;
00081     float variance() const;
00082     void set_variance(const float new_variance);
00083     size_t maxlenof_variance() const;
00084     virtual Message * clone() const;
00085   };
00086
00087   virtual bool message_valid(const Message *message) const;
00088  private:
00089   LocalizerControlInterface();
00090   ~LocalizerControlInterface();
00091
00092  public:
00093   /* Methods */
00094   char * map_name() const;
00095   void set_map_name(const char * new_map_name);
00096   size_t maxlenof_map_name() const;
00097   virtual Message * create_message(const char *type) const;
00098
00099   virtual void copy_values(const Interface *other);
00100
00101 };
00102
00103 } // end namespace fawkes
00104
00105 #endif