camerainfolist.h
Go to the documentation of this file.
1 /*
2  * This file is part of the rc_genicam_camera package.
3  *
4  * Copyright (c) 2019 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Heiko Hirschmueller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef RC_GENICAM_CAMERA_CAMERAINFOLIST
37 #define RC_GENICAM_CAMERA_CAMERAINFOLIST
38 
39 #include <ros/ros.h>
40 #include <sensor_msgs/CameraInfo.h>
41 
42 namespace rcgccam
43 {
45 {
46 public:
51 
58  void setSize(size_t maxsize);
59 
65  void setTolerance(uint64_t tolerance);
66 
75  sensor_msgs::CameraInfoPtr add(const sensor_msgs::CameraInfoPtr& info);
76 
84  int removeOld(const ros::Time& timestamp);
85 
95  sensor_msgs::CameraInfoPtr find(const ros::Time& timestamp) const;
96 
97 private:
98  size_t maxsize_;
99  uint64_t tolerance_;
100  std::vector<sensor_msgs::CameraInfoPtr> list_;
101 };
102 
103 } // namespace rcgccam
104 
105 #endif
rcgccam::CameraInfoList
Definition: camerainfolist.h:44
ros.h
rcgccam::CameraInfoList::setSize
void setSize(size_t maxsize)
Set maximum size of the list.
Definition: camerainfolist.cc:47
rcgccam::CameraInfoList::list_
std::vector< sensor_msgs::CameraInfoPtr > list_
Definition: camerainfolist.h:100
rcgccam::CameraInfoList::removeOld
int removeOld(const ros::Time &timestamp)
Remove all camera infos that have a timestamp that is older or equal than the given timestamp.
Definition: camerainfolist.cc:72
rcgccam
Definition: camerainfolist.cc:40
rcgccam::CameraInfoList::setTolerance
void setTolerance(uint64_t tolerance)
Set tolerance for finding corresponding timestamps.
Definition: camerainfolist.cc:52
rcgccam::CameraInfoList::find
sensor_msgs::CameraInfoPtr find(const ros::Time &timestamp) const
Returns the oldest camera info that has a timestamp within the tolerance of the given timestamp.
Definition: camerainfolist.cc:93
rcgccam::CameraInfoList::tolerance_
uint64_t tolerance_
Definition: camerainfolist.h:99
ros::Time
rcgccam::CameraInfoList::add
sensor_msgs::CameraInfoPtr add(const sensor_msgs::CameraInfoPtr &info)
Adds the given camera info to the internal list.
Definition: camerainfolist.cc:57
rcgccam::CameraInfoList::maxsize_
size_t maxsize_
Definition: camerainfolist.h:98
rcgccam::CameraInfoList::CameraInfoList
CameraInfoList()
Create a camera info list.
Definition: camerainfolist.cc:42


rc_genicam_camera
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 2 2022 00:49:18