LaserProc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013, Willow Garage, Inc.
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 are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * 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  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 /*
31  * Author: Chad Rockey
32  */
33 
34 #ifndef LASER_PROC_H
35 #define LASER_PROC_H
36 
37 #include <sensor_msgs/LaserScan.h>
38 #include <sensor_msgs/MultiEchoLaserScan.h>
39 #include <sensor_msgs/LaserEcho.h>
40 
41 #include <vector>
42 #include <algorithm>
43 #include <limits.h>
44 #include <stdexcept>
45 #include <sstream>
46 
47 namespace laser_proc
48 {
49  class LaserProc
50  {
51 
52  public:
53 
54  static sensor_msgs::LaserScanPtr getFirstScan(const sensor_msgs::MultiEchoLaserScan& msg);
55 
56  static sensor_msgs::LaserScanPtr getLastScan(const sensor_msgs::MultiEchoLaserScan& msg);
57 
58  static sensor_msgs::LaserScanPtr getMostIntenseScan(const sensor_msgs::MultiEchoLaserScan& msg);
59 
60  private:
61 
62  static void fillLaserScan(const sensor_msgs::MultiEchoLaserScan& msg, sensor_msgs::LaserScan& out);
63 
64  static size_t getFirstValue(const sensor_msgs::LaserEcho& ranges, float& range);
65 
66  static size_t getLastValue(const sensor_msgs::LaserEcho& ranges, float& range);
67 
68  static void getMostIntenseValue(const sensor_msgs::LaserEcho& ranges, const sensor_msgs::LaserEcho& intensities, float& range, float& intensity);
69 
70  };
71 
72 
73 }; // laser_proc
74 
75 #endif
static sensor_msgs::LaserScanPtr getFirstScan(const sensor_msgs::MultiEchoLaserScan &msg)
Definition: LaserProc.cpp:38
static sensor_msgs::LaserScanPtr getMostIntenseScan(const sensor_msgs::MultiEchoLaserScan &msg)
Definition: LaserProc.cpp:79
static size_t getLastValue(const sensor_msgs::LaserEcho &ranges, float &range)
Definition: LaserProc.cpp:120
static sensor_msgs::LaserScanPtr getLastScan(const sensor_msgs::MultiEchoLaserScan &msg)
Definition: LaserProc.cpp:59
static void fillLaserScan(const sensor_msgs::MultiEchoLaserScan &msg, sensor_msgs::LaserScan &out)
I&#39;m assuming all laserscanners/drivers output the ranges in order received (shortest to longest)...
Definition: LaserProc.cpp:96
static size_t getFirstValue(const sensor_msgs::LaserEcho &ranges, float &range)
I&#39;m assuming all laserscanners/drivers output the ranges in order received (shortest to longest)...
Definition: LaserProc.cpp:108
static void getMostIntenseValue(const sensor_msgs::LaserEcho &ranges, const sensor_msgs::LaserEcho &intensities, float &range, float &intensity)
Definition: LaserProc.cpp:131


laser_proc
Author(s): Chad Rockey
autogenerated on Thu Jun 6 2019 19:56:23