sick_generic_radar.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018, Ing.-Buero Dr. Michael Lehning, Hildesheim
3  * Copyright (C) 2018, SICK AG, Waldkirch
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of Osnabrück University nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * Created on: 28th May 2018
31  *
32  * Authors:
33  * Michael Lehning <michael.lehning@lehning.de>
34  *
35  */
36 
37 #ifndef SICK_GENERIC_RADAR_H_
38 #define SICK_GENERIC_RADAR_H_
39 
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <string>
43 #include <string.h>
44 #include <vector>
45 
46 #include <ros/ros.h>
47 #include <sensor_msgs/LaserScan.h>
48 #include <sensor_msgs/PointCloud.h>
49 #include <sensor_msgs/PointCloud2.h>
50 #include <std_msgs/String.h>
51 
55 #include <sick_scan/RadarScan.h> // generated by msg-generator
56 
57 #ifndef _MSC_VER
58 #include <dynamic_reconfigure/server.h>
59 #include <sick_scan/SickScanConfig.h>
60 #endif
63 
64 namespace sick_scan
65 {
66 
68  {
69  public:
70  float Dist() const { return dist; }
71  void Dist(float val) { dist = val; }
72  float Azimuth() const { return azimuth; }
73  void Azimuth(float val) { azimuth = val; }
74  float Vrad() const { return vrad; }
75  void Vrad(float val) { vrad = val; }
76  float Ampl() const { return ampl; }
77  void Ampl(float val) { ampl = val; }
78  int Mode() const { return mode; }
79  void Mode(int val) { mode = val; }
80  private:
81  float dist;
82  float azimuth;
83  float vrad;
84  float ampl;
85  int mode;
86  };
87 
89  {
90  public:
91  float P3Dx() const { return p3Dx; }
92  void P3Dx(float val) { p3Dx = val; }
93  float P3Dy() const { return p3Dy; }
94  void P3Dy(float val) { p3Dy = val; }
95  float V3Dx() const { return v3Dx; }
96  void V3Dx(float val) { v3Dx = val; }
97  float V3Dy() const { return v3Dy; }
98  void V3Dy(float val) { v3Dy = val; }
99  float ObjLength() const { return objLength; }
100  void ObjLength(float val) { objLength = val; }
101 
102  int ObjId() const { return objId; }
103  void ObjId(int val) { objId = val; }
104  private:
105  float p3Dx;
106  float p3Dy;
107  float v3Dx;
108  float v3Dy;
109  float objLength;
110  int objId;
111  };
112 
113 
115  {
116  public:
118  {
119  commonPtr = commonPtr_;
120  }
121  void setEmulation(bool _emul);
122  bool getEmulation(void);
123  int parseDatagram(ros::Time timeStamp, unsigned char *receiveBuffer, int actual_length, bool useBinaryProtocol);
124  int parseAsciiDatagram(char* datagram, size_t datagram_length, sick_scan::RadarScan *msgPtr, std::vector<SickScanRadarObject> &objectList, std::vector<SickScanRadarRawTarget> &rawTargetList); /* , SickScanConfig &config, */ // sensor_msgs::LaserScan &msg, int &numEchos, int &echoMask);
125  void simulateAsciiDatagram(unsigned char * receiveBuffer, int* actual_length);
126  private:
128  void simulateAsciiDatagramFromFile(unsigned char *receiveBuffer, int *actual_length, std::string filePattern);
129  bool emul;
130  };
131 
132 } /* namespace sick_scan */
133 #endif // SICK_GENERIC_RADAR_H_
SickScanRadar(SickScanCommon *commonPtr_)


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Tue Jul 9 2019 04:55:32