DESERT 3.5.1
Loading...
Searching...
No Matches
uwopticalbeampattern.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 UWOPTICALBEAMPATTERN_PHY_H
40#define UWOPTICALBEAMPATTERN_PHY_H
41
43#include <uwoptical-phy.h>
44
45
46//structure for max distance from LUT without noise, with noise
47struct MaxDist
48{
49 double max_range;
51};
52typedef ::std::map<double, MaxDist> CMaxDist; // max distance per c
53typedef CMaxDist::iterator CMaxDistIter;
54
55// LUT of angle in radiance vs normalized beam pattern
56typedef ::std::map<double, double> BeamPattern;
57typedef BeamPattern::iterator BeamPatternIter;
58
59
61{
62
63public:
68
73 {
74 }
75
86 virtual int command(int, const char *const *);
87
88
89 virtual void startRx(Packet *p);
90
91 virtual void startTx(Packet *p);
92
93protected:
94
98 void initializeLUT();
99
103 void initializeBeamLUT(BeamPattern &beam_lut_, string beam_pattern_path_);
104
109
113 double getMaxTxRange(Packet *p);
114
118 double getLutMaxDist(double c, double na);
119 double getLutBeamFactor(BeamPattern &beam_lut_, double beta);
120 double getBetaRx(Packet *p);
121 double getBetaXY(Packet *p, double rotation_angle);
122 double getBetaXYRx(Packet *p);
123 double getBetaXYTx(Packet *p);
124 double getBetaTx(Packet *p);
125
126private:
127
128 //string beam_pattern_path_; // LUT file name
129 string beam_pattern_path_rx_; // LUT file name
130 string beam_pattern_path_tx_; // LUT file name
131 string max_dist_path_; // LUT file name
135 //BeamPattern beam_lut_;
141 bool sameBeam; // Set to 1 if tx and rx use the same beam pattern
142
144};
145
146#endif /* UWOPTICAL_H */
double getMaxTxRange(Packet *p)
Get the transmission range in the current conditions.
void initializeLUT()
Inizialize all the LUTs.
virtual void startRx(Packet *p)
void initializeBeamLUT(BeamPattern &beam_lut_, string beam_pattern_path_)
Inizialize beam pattern LUT.
double inclination_angle_
Angle of inclination from the 0 Zenith.
double getLutMaxDist(double c, double na)
Get the maximum transmission range for these water properties.
double getLutBeamFactor(BeamPattern &beam_lut_, double beta)
double getBetaXY(Packet *p, double rotation_angle)
virtual int command(int, const char *const *)
TCL command interpreter.
void initializeMaxRangeLUT()
Inizialize max range LUT.
virtual void startTx(Packet *p)
UwOpticalBeamPattern()
Constructor of UwMultiPhy class.
virtual ~UwOpticalBeamPattern()
Destructor of UwMultiPhy class.
double max_range_with_noise
Definition of UwOptical class.
Provides the header description for uwbluwcomm packets.
::std::map< double, MaxDist > CMaxDist
CMaxDist::iterator CMaxDistIter
BeamPattern::iterator BeamPatternIter
::std::map< double, double > BeamPattern