Fawkes API Fawkes Development Version
Position2DTrackInterface.h
1
2/***************************************************************************
3 * Position2DTrackInterface.h - Fawkes BlackBoard Interface - Position2DTrackInterface
4 *
5 * Templated created: Thu Oct 12 10:49:19 2006
6 * Copyright 2009 Masrur Doostdar
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_POSITION2DTRACKINTERFACE_H_
25#define _INTERFACES_POSITION2DTRACKINTERFACE_H_
26
27#include <interface/interface.h>
28#include <interface/message.h>
29#include <interface/field_iterator.h>
30
31namespace fawkes {
32
34{
35 /// @cond INTERNALS
36 INTERFACE_MGMT_FRIENDS(Position2DTrackInterface)
37 /// @endcond
38 public:
39 /* constants */
40
41 private:
42 /** Internal data storage, do NOT modify! */
43 typedef struct {
44 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
45 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
46 float track_x_positions[30]; /**<
47 X-Positions of the track. The first array-element is the oldest position of the track,
48 the last is the newest.
49 */
50 float track_y_positions[30]; /**<
51 Y-Positions of the track. The first array-element is the oldest position of the track,
52 the last is the newest.
53 */
54 int32_t track_timestamps[30]; /**<
55 Timestamps of the track. The first array-element is the oldest position of the track,
56 the last is the newest.
57 */
58 uint32_t length; /**< Length of the Tracks (i.e. up to which index there are valid positions). */
59 uint32_t track_id; /**< The ID of the Track. */
60 } Position2DTrackInterface_data_t;
61
62 Position2DTrackInterface_data_t *data;
63
64 public:
65 /* messages */
66 virtual bool message_valid(const Message *message) const;
67 private:
70
71 public:
72 /* Methods */
73 float * track_x_positions() const;
74 float track_x_positions(unsigned int index) const;
75 void set_track_x_positions(unsigned int index, const float new_track_x_positions);
76 void set_track_x_positions(const float * new_track_x_positions);
77 size_t maxlenof_track_x_positions() const;
78 float * track_y_positions() const;
79 float track_y_positions(unsigned int index) const;
80 void set_track_y_positions(unsigned int index, const float new_track_y_positions);
81 void set_track_y_positions(const float * new_track_y_positions);
82 size_t maxlenof_track_y_positions() const;
83 int32_t * track_timestamps() const;
84 int32_t track_timestamps(unsigned int index) const;
85 void set_track_timestamps(unsigned int index, const int32_t new_track_timestamps);
86 void set_track_timestamps(const int32_t * new_track_timestamps);
87 size_t maxlenof_track_timestamps() const;
88 uint32_t length() const;
89 void set_length(const uint32_t new_length);
90 size_t maxlenof_length() const;
91 uint32_t track_id() const;
92 void set_track_id(const uint32_t new_track_id);
93 size_t maxlenof_track_id() const;
94 virtual Message * create_message(const char *type) const;
95
96 virtual void copy_values(const Interface *other);
97 virtual const char * enum_tostring(const char *enumtype, int val) const;
98
99};
100
101} // end namespace fawkes
102
103#endif
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Position2DTrackInterface Fawkes BlackBoard Interface.
void set_track_x_positions(unsigned int index, const float new_track_x_positions)
Set track_x_positions value at given index.
void set_track_y_positions(unsigned int index, const float new_track_y_positions)
Set track_y_positions value at given index.
void set_track_id(const uint32_t new_track_id)
Set track_id value.
uint32_t length() const
Get length value.
size_t maxlenof_track_id() const
Get maximum length of track_id value.
float * track_x_positions() const
Get track_x_positions value.
size_t maxlenof_track_y_positions() const
Get maximum length of track_y_positions value.
void set_length(const uint32_t new_length)
Set length value.
void set_track_timestamps(unsigned int index, const int32_t new_track_timestamps)
Set track_timestamps value at given index.
size_t maxlenof_track_timestamps() const
Get maximum length of track_timestamps value.
uint32_t track_id() const
Get track_id value.
float * track_y_positions() const
Get track_y_positions value.
size_t maxlenof_length() const
Get maximum length of length value.
size_t maxlenof_track_x_positions() const
Get maximum length of track_x_positions value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
virtual Message * create_message(const char *type) const
Create message based on type name.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
int32_t * track_timestamps() const
Get track_timestamps value.
Fawkes library namespace.