DESERT 4.0.0
uwPosBasedRt-hdr.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28//
29
39#ifndef HDR_UWPOS_BASED_RT_H
40#define HDR_UWPOS_BASED_RT_H
41
42#include <packet.h>
43
44#define HDR_UWPOS_BASED_RT(p) (hdr_uwpos_based_rt::access(p))
45
46extern packet_t PT_UWPOSBASEDRT;
47
51typedef struct hdr_uwpos_based_rt {
52
53 double x_ROV_;
54 double y_ROV_;
55 double z_ROV_;
56 double timestamp_;
57 double x_wp_;
58 double y_wp_;
59 double z_wp_;
60 double ROV_speed_;
61 uint8_t ipROV_; /***<IP of the ROV related to the informations inserted in
62 the header. */
63
64 static int offset_;
66 inline double &
68 {
69 return x_ROV_;
70 }
71
72 inline double &
74 {
75 return y_ROV_;
76 }
77
78 inline double &
80 {
81 return z_ROV_;
82 }
83
84 inline double &
86 {
87 return timestamp_;
88 }
89
90 inline double &
92 {
93 return x_wp_;
94 }
95
96 inline double &
98 {
99 return y_wp_;
100 }
101
102 inline double &
104 {
105 return z_wp_;
106 }
107
108 inline double &
110 {
111 return ROV_speed_;
112 }
113
114 inline uint8_t &
116 {
117 return ipROV_;
118 }
119
123 inline static int &
125 {
126 return offset_;
127 }
128
129 inline static struct hdr_uwpos_based_rt *
130 access(const Packet *p)
131 {
132 return (struct hdr_uwpos_based_rt *) p->access(offset_);
133 }
135
136#endif // HDR_UWPOS_BASED_RT_H
Definition uwPosBasedRt-hdr.h:51
double & x_waypoint()
Definition uwPosBasedRt-hdr.h:91
double & ROV_speed()
Definition uwPosBasedRt-hdr.h:109
double & x_ROV()
Definition uwPosBasedRt-hdr.h:67
double & y_waypoint()
Definition uwPosBasedRt-hdr.h:97
uint8_t & IP_ROV()
Definition uwPosBasedRt-hdr.h:115
double z_wp_
Definition uwPosBasedRt-hdr.h:59
double & z_waypoint()
Definition uwPosBasedRt-hdr.h:103
static struct hdr_uwpos_based_rt * access(const Packet *p)
Definition uwPosBasedRt-hdr.h:130
double timestamp_
Definition uwPosBasedRt-hdr.h:56
static int offset_
Definition uwPosBasedRt-hdr.h:64
double z_ROV_
Definition uwPosBasedRt-hdr.h:55
double ROV_speed_
Definition uwPosBasedRt-hdr.h:60
double x_ROV_
Definition uwPosBasedRt-hdr.h:53
double y_wp_
Definition uwPosBasedRt-hdr.h:58
double & z_ROV()
Definition uwPosBasedRt-hdr.h:79
double & y_ROV()
Definition uwPosBasedRt-hdr.h:73
double & timestamp()
Definition uwPosBasedRt-hdr.h:85
uint8_t ipROV_
Definition uwPosBasedRt-hdr.h:61
static int & offset()
Definition uwPosBasedRt-hdr.h:124
double y_ROV_
Definition uwPosBasedRt-hdr.h:54
double x_wp_
Definition uwPosBasedRt-hdr.h:57
packet_t PT_UWPOSBASEDRT
Definition initlib.cpp:48