DESERT 4.0.0
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// structure for max distance from LUT without noise, with noise
46struct MaxDist {
47 double max_range;
49};
50typedef ::std::map<double, MaxDist> CMaxDist; // max distance per c
51typedef CMaxDist::iterator CMaxDistIter;
52
53// LUT of angle in radiance vs normalized beam pattern
54typedef ::std::map<double, double> BeamPattern;
55typedef BeamPattern::iterator BeamPatternIter;
56
58{
59
60public:
65
70 {
71 }
72
83 virtual int command(int, const char *const *);
84
85 virtual void startRx(Packet *p);
86
87 virtual void startTx(Packet *p);
88
89protected:
93 void initializeLUT();
94
98 void initializeBeamLUT(BeamPattern &beam_lut_, string beam_pattern_path_);
99
104
108 double getMaxTxRange(Packet *p);
109
113 double getLutMaxDist(double c, double na);
114 double getLutBeamFactor(BeamPattern &beam_lut_, double beta);
115 double getBetaRx(Packet *p);
116 double getBetaXY(Packet *p, double rotation_angle);
117 double getBetaXYRx(Packet *p);
118 double getBetaXYTx(Packet *p);
119 double getBetaTx(Packet *p);
120
121private:
122 // string beam_pattern_path_; // LUT file name
123 string beam_pattern_path_rx_; // LUT file name
124 string beam_pattern_path_tx_; // LUT file name
125 string max_dist_path_; // LUT file name
129 // BeamPattern beam_lut_;
135 bool sameBeam; // Set to 1 if tx and rx use the same beam pattern
136
138};
139
140#endif /* UWOPTICAL_H */
Definition uwopticalbeampattern.h:58
string beam_pattern_path_rx_
Definition uwopticalbeampattern.h:123
double getMaxTxRange(Packet *p)
Definition uwopticalbeampattern.cpp:210
void initializeLUT()
Definition uwopticalbeampattern.cpp:429
char beam_pattern_separator_
Definition uwopticalbeampattern.h:126
virtual void startRx(Packet *p)
Definition uwopticalbeampattern.cpp:170
bool sameBeam
Definition uwopticalbeampattern.h:135
double getBetaXYRx(Packet *p)
Definition uwopticalbeampattern.cpp:308
void initializeBeamLUT(BeamPattern &beam_lut_, string beam_pattern_path_)
Definition uwopticalbeampattern.cpp:438
double inclination_angle_
Definition uwopticalbeampattern.h:133
double getLutMaxDist(double c, double na)
Definition uwopticalbeampattern.cpp:384
string beam_pattern_path_tx_
Definition uwopticalbeampattern.h:124
double getLutBeamFactor(BeamPattern &beam_lut_, double beta)
Definition uwopticalbeampattern.cpp:410
CMaxDist dist_lut_
Definition uwopticalbeampattern.h:128
void checkInclinationAngle()
Definition uwopticalbeampattern.cpp:159
string max_dist_path_
Definition uwopticalbeampattern.h:125
double getBetaXYTx(Packet *p)
Definition uwopticalbeampattern.cpp:345
char max_dist_separator_
Definition uwopticalbeampattern.h:127
double getBetaXY(Packet *p, double rotation_angle)
BeamPattern beam_lut_tx_
Definition uwopticalbeampattern.h:131
virtual int command(int, const char *const *)
Definition uwopticalbeampattern.cpp:80
double getBetaRx(Packet *p)
Definition uwopticalbeampattern.cpp:263
void initializeMaxRangeLUT()
Definition uwopticalbeampattern.cpp:461
virtual void startTx(Packet *p)
Definition uwopticalbeampattern.cpp:489
double back_noise_threshold_
Definition uwopticalbeampattern.h:132
double getBetaTx(Packet *p)
Definition uwopticalbeampattern.cpp:497
UwOpticalBeamPattern()
Definition uwopticalbeampattern.cpp:60
BeamPattern beam_lut_rx_
Definition uwopticalbeampattern.h:130
virtual ~UwOpticalBeamPattern()
Definition uwopticalbeampattern.h:69
Definition uwoptical-phy.h:69
Definition uwopticalbeampattern.h:46
double max_range
Definition uwopticalbeampattern.h:47
double max_range_with_noise
Definition uwopticalbeampattern.h:48
Definition of UwOptical class.
Provides the header description for uwbluwcomm packets.
::std::map< double, MaxDist > CMaxDist
Definition uwopticalbeampattern.h:50
CMaxDist::iterator CMaxDistIter
Definition uwopticalbeampattern.h:51
BeamPattern::iterator BeamPatternIter
Definition uwopticalbeampattern.h:55
::std::map< double, double > BeamPattern
Definition uwopticalbeampattern.h:54