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 
48 bool StaticCache::insertData(const TransformStorage& new_data, std::string* error_str)
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 
tf2::StaticCache::storage_
TransformStorage storage_
Definition: time_cache.h:155
exceptions.h
tf2::StaticCache::insertData
virtual bool insertData(const TransformStorage &new_data, std::string *error_str=0)
Insert data into the cache.
Definition: static_cache.cpp:48
tf2::StaticCache::getListLength
virtual unsigned int getListLength()
Debugging information methods.
Definition: static_cache.cpp:59
Transform.h
tf2::StaticCache::getData
virtual bool getData(ros::Time time, TransformStorage &data_out, std::string *error_str=0)
Virtual methods.
Definition: static_cache.cpp:41
tf2::CompactFrameID
uint32_t CompactFrameID
Definition: transform_storage.h:50
tf2::TransformStorage
Storage for transforms and their parent.
Definition: transform_storage.h:53
tf2::StaticCache::getLatestTimestamp
virtual ros::Time getLatestTimestamp()
Get the latest timestamp cached.
Definition: static_cache.cpp:71
tf2::StaticCache::getLatestTimeAndParent
virtual P_TimeAndFrameID getLatestTimeAndParent()
Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no...
Definition: static_cache.cpp:66
tf2::TransformStorage::stamp_
ros::Time stamp_
Definition: transform_storage.h:78
time_cache.h
tf2::TransformStorage::frame_id_
CompactFrameID frame_id_
Definition: transform_storage.h:79
tf2::StaticCache::getParent
virtual CompactFrameID getParent(ros::Time time, std::string *error_str)
Retrieve the parent at a specific time.
Definition: static_cache.cpp:61
tf2::P_TimeAndFrameID
std::pair< ros::Time, CompactFrameID > P_TimeAndFrameID
Definition: buffer_core.h:57
ros::Time
tf2
Definition: buffer_core.h:54
tf2::StaticCache::clearList
virtual void clearList()
Clear the list of stored values.
Definition: static_cache.cpp:57
tf2::StaticCache::getOldestTimestamp
virtual ros::Time getOldestTimestamp()
Get the oldest timestamp cached.
Definition: static_cache.cpp:76


tf2
Author(s): Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
autogenerated on Sun Feb 4 2024 03:18:11