tf2  master
tf2 maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.
buffer_core_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Open Source Robotics Foundation, 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 #ifndef TF2__BUFFER_CORE_INTERFACE_H_
31 #define TF2__BUFFER_CORE_INTERFACE_H_
32 
33 #include <string>
34 #include <vector>
35 
36 #include <geometry_msgs/msg/transform_stamped.hpp>
37 
38 #include <tf2/time.h>
39 #include <tf2/visibility_control.h>
40 
41 namespace tf2
42 {
43 
51 {
52 public:
54  virtual
55  ~BufferCoreInterface() = default;
56 
61  virtual void
62  clear() = 0;
63 
72  virtual geometry_msgs::msg::TransformStamped
74  const std::string& target_frame,
75  const std::string& source_frame,
76  const tf2::TimePoint& time) const = 0;
77 
89  virtual geometry_msgs::msg::TransformStamped
91  const std::string& target_frame,
92  const tf2::TimePoint& target_time,
93  const std::string& source_frame,
94  const tf2::TimePoint& source_time,
95  const std::string& fixed_frame) const = 0;
96 
106  TF2_PUBLIC
107  virtual bool
108  canTransform(
109  const std::string& target_frame,
110  const std::string& source_frame,
111  const tf2::TimePoint& time,
112  std::string* error_msg) const = 0;
113 
125  TF2_PUBLIC
126  virtual bool
127  canTransform(
128  const std::string& target_frame,
129  const tf2::TimePoint& target_time,
130  const std::string& source_frame,
131  const tf2::TimePoint& source_time,
132  const std::string& fixed_frame,
133  std::string* error_msg) const = 0;
134 
138  TF2_PUBLIC
140  getAllFrameNames() const = 0;
141 }; // class BufferCoreInterface
142 
143 } // namespace tf2
144 
145 #endif // TF2__BUFFER_CORE_INTERFACE_H_
std::string
std::vector< std::string >
tf2::BufferCoreInterface
Interface for providing coordinate transforms between any two frames in a system.
Definition: buffer_core_interface.h:50
tf2::BufferCoreInterface::getAllFrameNames
virtual std::vector< std::string > getAllFrameNames() const =0
Get all frames that exist in the system.
time.h
tf2::BufferCoreInterface::canTransform
virtual bool canTransform(const std::string &target_frame, const std::string &source_frame, const tf2::TimePoint &time, std::string *error_msg) const =0
Test if a transform is possible.
std::chrono::time_point< std::chrono::system_clock, Duration >
tf2::BufferCoreInterface::clear
virtual void clear()=0
Clear internal state data.
visibility_control.h
tf2::BufferCoreInterface::lookupTransform
virtual geometry_msgs::msg::TransformStamped lookupTransform(const std::string &target_frame, const std::string &source_frame, const tf2::TimePoint &time) const =0
Get the transform between two frames by frame ID.
tf2
Definition: buffer_core.h:55
TF2_PUBLIC
#define TF2_PUBLIC
Definition: visibility_control.h:58
tf2::BufferCoreInterface::~BufferCoreInterface
virtual ~BufferCoreInterface()=default