Laser360Interface.h

00001
00002 /***************************************************************************
00003  *  Laser360Interface.h - Fawkes BlackBoard Interface - Laser360Interface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2008  Tim Niemueller
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_LASER360INTERFACE_H_
00025 #define __INTERFACES_LASER360INTERFACE_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 Laser360Interface : public Interface
00034 {
00035  /// @cond INTERNALS
00036  INTERFACE_MGMT_FRIENDS(Laser360Interface)
00037  /// @endcond
00038  public:
00039   /* constants */
00040
00041  private:
00042   /** Internal data storage, do NOT modify! */
00043   typedef struct {
00044     float distances[360]; /**< 
00045       The distances in meter of the beams.
00046      */
00047   } Laser360Interface_data_t;
00048
00049   Laser360Interface_data_t *data;
00050
00051  public:
00052   /* messages */
00053   virtual bool message_valid(const Message *message) const;
00054  private:
00055   Laser360Interface();
00056   ~Laser360Interface();
00057
00058  public:
00059   /* Methods */
00060   float * distances() const;
00061   float distances(unsigned int index) const;
00062   void set_distances(unsigned int index, const float new_distances);
00063   void set_distances(const float * new_distances);
00064   size_t maxlenof_distances() const;
00065   virtual Message * create_message(const char *type) const;
00066
00067   virtual void copy_values(const Interface *other);
00068
00069 };
00070
00071 } // end namespace fawkes
00072
00073 #endif