Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * Laser360Interface.h - Fawkes BlackBoard Interface - Laser360Interface 00004 * 00005 * Templated created: Thu Oct 12 10:49:19 2006 00006 * Copyright 2008-2009 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 #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 frame[32]; /**< 00048 Coordinate frame in which the data is presented. 00049 */ 00050 float distances[360]; /**< 00051 The distances in meter of the beams. 00052 */ 00053 bool clockwise_angle; /**< 00054 True if the angle grows clockwise. 00055 */ 00056 } Laser360Interface_data_t; 00057 #pragma pack(pop) 00058 00059 Laser360Interface_data_t *data; 00060 00061 public: 00062 /* messages */ 00063 virtual bool message_valid(const Message *message) const; 00064 private: 00065 Laser360Interface(); 00066 ~Laser360Interface(); 00067 00068 public: 00069 /* Methods */ 00070 char * frame() const; 00071 void set_frame(const char * new_frame); 00072 size_t maxlenof_frame() const; 00073 float * distances() const; 00074 float distances(unsigned int index) const; 00075 void set_distances(unsigned int index, const float new_distances); 00076 void set_distances(const float * new_distances); 00077 size_t maxlenof_distances() const; 00078 bool is_clockwise_angle() const; 00079 void set_clockwise_angle(const bool new_clockwise_angle); 00080 size_t maxlenof_clockwise_angle() const; 00081 virtual Message * create_message(const char *type) const; 00082 00083 virtual void copy_values(const Interface *other); 00084 virtual const char * enum_tostring(const char *enumtype, int val) const; 00085 00086 }; 00087 00088 } // end namespace fawkes 00089 00090 #endif