base
SonarBeam.hpp
Go to the documentation of this file.
1 #ifndef BASE_SAMPLES_SONARBEAM_H__
2 #define BASE_SAMPLES_SONARBEAM_H__
3 
4 #include <boost/cstdint.hpp>
5 #include <base/Time.hpp>
6 #include <base/Angle.hpp>
7 
8 namespace base { namespace samples {
9 
10  struct SonarBeam {
11  typedef boost::uint8_t uint8_t;
12 
13  //timestamp of the sonar beam
15 
16  //direction of the sonar beam in radians [-pi,+pi]
17  //zero is at the front
19 
20  //sampling interval of each range bin in secs
22 
23  //speed of sound
24  //this takes the medium into account
26 
27  //horizontal beamwidth of the sonar beam in radians
29 
30  //vertical beamwidth of the sonar beam in radians
32 
33  //received echoes (bins) along the beam
34  std::vector<uint8_t> beam;
35 
37  sampling_interval(std::numeric_limits<double>::signaling_NaN()),
38  speed_of_sound(std::numeric_limits<float>::signaling_NaN()),
39  beamwidth_horizontal(std::numeric_limits<float>::signaling_NaN()),
40  beamwidth_vertical(std::numeric_limits<float>::signaling_NaN()){}
41 
42  SonarBeam(const SonarBeam &other);
43 
44  //calculates the spatial resolution of the sonar beam in meter
45  //this takes the sampling_interval and the speed of sound into account
46  double getSpatialResolution()const;
47 
48  SonarBeam &operator=(const SonarBeam &other);
49 
50  void init(const SonarBeam &other);
51 
52  void swap(SonarBeam &other);
53  };
54 }}
55 
56 #endif
SonarBeam & operator=(const SonarBeam &other)
Definition: SonarBeam.cpp:21
void init(const SonarBeam &other)
Definition: SonarBeam.cpp:27
double getSpatialResolution() const
Definition: SonarBeam.cpp:13
Definition: Time.hpp:11
double sampling_interval
Definition: SonarBeam.hpp:21
SonarBeam()
Definition: SonarBeam.hpp:36
boost::uint8_t uint8_t
Definition: SonarBeam.hpp:11
Definition: LinearAngular6DCommand.hpp:8
Angle bearing
Definition: SonarBeam.hpp:18
float beamwidth_vertical
Definition: SonarBeam.hpp:31
Definition: SonarBeam.hpp:10
void swap(SonarBeam &other)
Definition: SonarBeam.cpp:38
Definition: Angle.hpp:19
float speed_of_sound
Definition: SonarBeam.hpp:25
std::vector< uint8_t > beam
Definition: SonarBeam.hpp:34
float beamwidth_horizontal
Definition: SonarBeam.hpp:28
Time time
Definition: SonarBeam.hpp:14