static_cache.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 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 
32 #include "tf2/time_cache.h"
33 #include "tf2/exceptions.h"
34 
36 
37 
38 using namespace tf2;
39 
40 
41 bool StaticCache::getData(ros::Time time, TransformStorage & data_out, std::string* error_str) //returns false if data not available
42 {
43  data_out = storage_;
44  data_out.stamp_ = time;
45  return true;
46 };
47 
49 {
50  storage_ = new_data;
51  return true;
52 };
53 
54 
55 
56 
57 void StaticCache::clearList() { return; };
58 
59 unsigned int StaticCache::getListLength() { return 1; };
60 
61 CompactFrameID StaticCache::getParent(ros::Time time, std::string* error_str)
62 {
63  return storage_.frame_id_;
64 }
65 
67 {
68  return std::make_pair(ros::Time(), storage_.frame_id_);
69 }
70 
72 {
73  return ros::Time();
74 };
75 
77 {
78  return ros::Time();
79 };
80 
virtual void clearList()
Clear the list of stored values.
uint32_t CompactFrameID
virtual unsigned int getListLength()
Debugging information methods.
std::pair< ros::Time, CompactFrameID > P_TimeAndFrameID
Definition: buffer_core.h:57
virtual bool getData(ros::Time time, TransformStorage &data_out, std::string *error_str=0)
Virtual methods.
virtual CompactFrameID getParent(ros::Time time, std::string *error_str)
Retrieve the parent at a specific time.
virtual ros::Time getLatestTimestamp()
Get the latest timestamp cached.
Storage for transforms and their parent.
CompactFrameID frame_id_
virtual ros::Time getOldestTimestamp()
Get the oldest timestamp cached.
virtual P_TimeAndFrameID getLatestTimeAndParent()
Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no...
virtual bool insertData(const TransformStorage &new_data)
Insert data into the cache.
TransformStorage storage_
Definition: time_cache.h:157


tf2
Author(s): Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
autogenerated on Fri Oct 16 2020 19:08:50