NavigatorInterface.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __INTERFACES_NAVIGATORINTERFACE_H_
00025 #define __INTERFACES_NAVIGATORINTERFACE_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 NavigatorInterface : public Interface
00034 {
00035
00036 INTERFACE_MGMT_FRIENDS(NavigatorInterface)
00037
00038 public:
00039
00040 static const uint32_t ERROR_NONE;
00041 static const uint32_t ERROR_MOTOR;
00042 static const uint32_t ERROR_OBSTRUCTION;
00043 static const uint32_t ERROR_UNKNOWN_PLACE;
00044 static const uint32_t FLAG_NONE;
00045 static const uint32_t FLAG_CART_GOTO;
00046 static const uint32_t FLAG_POLAR_GOTO;
00047 static const uint32_t FLAG_PLACE_GOTO;
00048 static const uint32_t FLAG_UPDATES_DEST_DIST;
00049 static const uint32_t FLAG_SECURITY_DISTANCE;
00050 static const uint32_t FLAG_ESCAPING;
00051
00052 private:
00053 #pragma pack(push,4)
00054
00055 typedef struct {
00056 int64_t timestamp_sec;
00057 int64_t timestamp_usec;
00058 uint32_t flags;
00059
00060 float x;
00061 float y;
00062 float dest_x;
00063 float dest_y;
00064 float dest_ori;
00065 float dest_dist;
00066 uint32_t msgid;
00067
00068 bool final;
00069
00070 uint32_t error_code;
00071
00072
00073 float max_velocity;
00074 float security_distance;
00075
00076 bool escaping_enabled;
00077
00078
00079
00080 } NavigatorInterface_data_t;
00081 #pragma pack(pop)
00082
00083 NavigatorInterface_data_t *data;
00084
00085 public:
00086
00087 class StopMessage : public Message
00088 {
00089 private:
00090 #pragma pack(push,4)
00091
00092 typedef struct {
00093 int64_t timestamp_sec;
00094 int64_t timestamp_usec;
00095 } StopMessage_data_t;
00096 #pragma pack(pop)
00097
00098 StopMessage_data_t *data;
00099
00100 public:
00101 StopMessage();
00102 ~StopMessage();
00103
00104 StopMessage(const StopMessage *m);
00105
00106 virtual Message * clone() const;
00107 };
00108
00109 class TurnMessage : public Message
00110 {
00111 private:
00112 #pragma pack(push,4)
00113
00114 typedef struct {
00115 int64_t timestamp_sec;
00116 int64_t timestamp_usec;
00117 float angle;
00118 float velocity;
00119
00120 } TurnMessage_data_t;
00121 #pragma pack(pop)
00122
00123 TurnMessage_data_t *data;
00124
00125 public:
00126 TurnMessage(const float ini_angle, const float ini_velocity);
00127 TurnMessage();
00128 ~TurnMessage();
00129
00130 TurnMessage(const TurnMessage *m);
00131
00132 float angle() const;
00133 void set_angle(const float new_angle);
00134 size_t maxlenof_angle() const;
00135 float velocity() const;
00136 void set_velocity(const float new_velocity);
00137 size_t maxlenof_velocity() const;
00138 virtual Message * clone() const;
00139 };
00140
00141 class CartesianGotoMessage : public Message
00142 {
00143 private:
00144 #pragma pack(push,4)
00145
00146 typedef struct {
00147 int64_t timestamp_sec;
00148 int64_t timestamp_usec;
00149 float x;
00150 float y;
00151 float orientation;
00152 } CartesianGotoMessage_data_t;
00153 #pragma pack(pop)
00154
00155 CartesianGotoMessage_data_t *data;
00156
00157 public:
00158 CartesianGotoMessage(const float ini_x, const float ini_y, const float ini_orientation);
00159 CartesianGotoMessage();
00160 ~CartesianGotoMessage();
00161
00162 CartesianGotoMessage(const CartesianGotoMessage *m);
00163
00164 float x() const;
00165 void set_x(const float new_x);
00166 size_t maxlenof_x() const;
00167 float y() const;
00168 void set_y(const float new_y);
00169 size_t maxlenof_y() const;
00170 float orientation() const;
00171 void set_orientation(const float new_orientation);
00172 size_t maxlenof_orientation() const;
00173 virtual Message * clone() const;
00174 };
00175
00176 class PolarGotoMessage : public Message
00177 {
00178 private:
00179 #pragma pack(push,4)
00180
00181 typedef struct {
00182 int64_t timestamp_sec;
00183 int64_t timestamp_usec;
00184 float phi;
00185 float dist;
00186 float orientation;
00187 } PolarGotoMessage_data_t;
00188 #pragma pack(pop)
00189
00190 PolarGotoMessage_data_t *data;
00191
00192 public:
00193 PolarGotoMessage(const float ini_phi, const float ini_dist, const float ini_orientation);
00194 PolarGotoMessage();
00195 ~PolarGotoMessage();
00196
00197 PolarGotoMessage(const PolarGotoMessage *m);
00198
00199 float phi() const;
00200 void set_phi(const float new_phi);
00201 size_t maxlenof_phi() const;
00202 float dist() const;
00203 void set_dist(const float new_dist);
00204 size_t maxlenof_dist() const;
00205 float orientation() const;
00206 void set_orientation(const float new_orientation);
00207 size_t maxlenof_orientation() const;
00208 virtual Message * clone() const;
00209 };
00210
00211 class PlaceGotoMessage : public Message
00212 {
00213 private:
00214 #pragma pack(push,4)
00215
00216 typedef struct {
00217 int64_t timestamp_sec;
00218 int64_t timestamp_usec;
00219 char place[64];
00220 } PlaceGotoMessage_data_t;
00221 #pragma pack(pop)
00222
00223 PlaceGotoMessage_data_t *data;
00224
00225 public:
00226 PlaceGotoMessage(const char * ini_place);
00227 PlaceGotoMessage();
00228 ~PlaceGotoMessage();
00229
00230 PlaceGotoMessage(const PlaceGotoMessage *m);
00231
00232 char * place() const;
00233 void set_place(const char * new_place);
00234 size_t maxlenof_place() const;
00235 virtual Message * clone() const;
00236 };
00237
00238 class ObstacleMessage : public Message
00239 {
00240 private:
00241 #pragma pack(push,4)
00242
00243 typedef struct {
00244 int64_t timestamp_sec;
00245 int64_t timestamp_usec;
00246 float x;
00247 float y;
00248 float width;
00249 } ObstacleMessage_data_t;
00250 #pragma pack(pop)
00251
00252 ObstacleMessage_data_t *data;
00253
00254 public:
00255 ObstacleMessage(const float ini_x, const float ini_y, const float ini_width);
00256 ObstacleMessage();
00257 ~ObstacleMessage();
00258
00259 ObstacleMessage(const ObstacleMessage *m);
00260
00261 float x() const;
00262 void set_x(const float new_x);
00263 size_t maxlenof_x() const;
00264 float y() const;
00265 void set_y(const float new_y);
00266 size_t maxlenof_y() const;
00267 float width() const;
00268 void set_width(const float new_width);
00269 size_t maxlenof_width() const;
00270 virtual Message * clone() const;
00271 };
00272
00273 class ResetOdometryMessage : public Message
00274 {
00275 private:
00276 #pragma pack(push,4)
00277
00278 typedef struct {
00279 int64_t timestamp_sec;
00280 int64_t timestamp_usec;
00281 } ResetOdometryMessage_data_t;
00282 #pragma pack(pop)
00283
00284 ResetOdometryMessage_data_t *data;
00285
00286 public:
00287 ResetOdometryMessage();
00288 ~ResetOdometryMessage();
00289
00290 ResetOdometryMessage(const ResetOdometryMessage *m);
00291
00292 virtual Message * clone() const;
00293 };
00294
00295 class SetMaxVelocityMessage : public Message
00296 {
00297 private:
00298 #pragma pack(push,4)
00299
00300 typedef struct {
00301 int64_t timestamp_sec;
00302 int64_t timestamp_usec;
00303 float max_velocity;
00304 } SetMaxVelocityMessage_data_t;
00305 #pragma pack(pop)
00306
00307 SetMaxVelocityMessage_data_t *data;
00308
00309 public:
00310 SetMaxVelocityMessage(const float ini_max_velocity);
00311 SetMaxVelocityMessage();
00312 ~SetMaxVelocityMessage();
00313
00314 SetMaxVelocityMessage(const SetMaxVelocityMessage *m);
00315
00316 float max_velocity() const;
00317 void set_max_velocity(const float new_max_velocity);
00318 size_t maxlenof_max_velocity() const;
00319 virtual Message * clone() const;
00320 };
00321
00322 class SetEscapingMessage : public Message
00323 {
00324 private:
00325 #pragma pack(push,4)
00326
00327 typedef struct {
00328 int64_t timestamp_sec;
00329 int64_t timestamp_usec;
00330 bool escaping_enabled;
00331
00332
00333
00334 } SetEscapingMessage_data_t;
00335 #pragma pack(pop)
00336
00337 SetEscapingMessage_data_t *data;
00338
00339 public:
00340 SetEscapingMessage(const bool ini_escaping_enabled);
00341 SetEscapingMessage();
00342 ~SetEscapingMessage();
00343
00344 SetEscapingMessage(const SetEscapingMessage *m);
00345
00346 bool is_escaping_enabled() const;
00347 void set_escaping_enabled(const bool new_escaping_enabled);
00348 size_t maxlenof_escaping_enabled() const;
00349 virtual Message * clone() const;
00350 };
00351
00352 class SetSecurityDistanceMessage : public Message
00353 {
00354 private:
00355 #pragma pack(push,4)
00356
00357 typedef struct {
00358 int64_t timestamp_sec;
00359 int64_t timestamp_usec;
00360 float security_distance;
00361
00362 } SetSecurityDistanceMessage_data_t;
00363 #pragma pack(pop)
00364
00365 SetSecurityDistanceMessage_data_t *data;
00366
00367 public:
00368 SetSecurityDistanceMessage(const float ini_security_distance);
00369 SetSecurityDistanceMessage();
00370 ~SetSecurityDistanceMessage();
00371
00372 SetSecurityDistanceMessage(const SetSecurityDistanceMessage *m);
00373
00374 float security_distance() const;
00375 void set_security_distance(const float new_security_distance);
00376 size_t maxlenof_security_distance() const;
00377 virtual Message * clone() const;
00378 };
00379
00380 virtual bool message_valid(const Message *message) const;
00381 private:
00382 NavigatorInterface();
00383 ~NavigatorInterface();
00384
00385 public:
00386
00387 uint32_t flags() const;
00388 void set_flags(const uint32_t new_flags);
00389 size_t maxlenof_flags() const;
00390 float x() const;
00391 void set_x(const float new_x);
00392 size_t maxlenof_x() const;
00393 float y() const;
00394 void set_y(const float new_y);
00395 size_t maxlenof_y() const;
00396 float dest_x() const;
00397 void set_dest_x(const float new_dest_x);
00398 size_t maxlenof_dest_x() const;
00399 float dest_y() const;
00400 void set_dest_y(const float new_dest_y);
00401 size_t maxlenof_dest_y() const;
00402 float dest_ori() const;
00403 void set_dest_ori(const float new_dest_ori);
00404 size_t maxlenof_dest_ori() const;
00405 float dest_dist() const;
00406 void set_dest_dist(const float new_dest_dist);
00407 size_t maxlenof_dest_dist() const;
00408 uint32_t msgid() const;
00409 void set_msgid(const uint32_t new_msgid);
00410 size_t maxlenof_msgid() const;
00411 bool is_final() const;
00412 void set_final(const bool new_final);
00413 size_t maxlenof_final() const;
00414 uint32_t error_code() const;
00415 void set_error_code(const uint32_t new_error_code);
00416 size_t maxlenof_error_code() const;
00417 float max_velocity() const;
00418 void set_max_velocity(const float new_max_velocity);
00419 size_t maxlenof_max_velocity() const;
00420 float security_distance() const;
00421 void set_security_distance(const float new_security_distance);
00422 size_t maxlenof_security_distance() const;
00423 bool is_escaping_enabled() const;
00424 void set_escaping_enabled(const bool new_escaping_enabled);
00425 size_t maxlenof_escaping_enabled() const;
00426 virtual Message * create_message(const char *type) const;
00427
00428 virtual void copy_values(const Interface *other);
00429 virtual const char * enum_tostring(const char *enumtype, int val) const;
00430
00431 };
00432
00433 }
00434
00435 #endif