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.
exceptions.h
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 #ifndef TF2_EXCEPTIONS_H
33 #define TF2_EXCEPTIONS_H
34 
35 #include <stdexcept>
36 #include <cstdint>
37 
38 #include <tf2/visibility_control.h>
39 
40 namespace tf2{
41 
42 enum class TF2Error : std::uint8_t {
43  NO_ERROR = 0,
44  LOOKUP_ERROR = 1,
48  TIMEOUT_ERROR = 5,
49  TRANSFORM_ERROR = 6
50 };
51 
52 
58 {
59 public:
61  TransformException(const std::string errorDescription) : std::runtime_error(errorDescription) { ; };
62 };
63 
64 
71 {
72 public:
74  ConnectivityException(const std::string errorDescription) : tf2::TransformException(errorDescription) { ; };
75 };
76 
77 
87 {
88 public:
90  LookupException(const std::string errorDescription) : tf2::TransformException(errorDescription) { ; };
91 };
92 
97 {
98 public:
100  ExtrapolationException(const std::string errorDescription) : tf2::TransformException(errorDescription) { ; };
101 };
102 
109 {
110 public:
111  TF2_PUBLIC
112  InvalidArgumentException(const std::string errorDescription) : tf2::TransformException(errorDescription) { ; };
113 };
114 
120 {
121 public:
122  TF2_PUBLIC
123  TimeoutException(const std::string errorDescription) : tf2::TransformException(errorDescription) { ; };
124 };
125 
126 
127 }
128 
129 
130 #endif //TF2_EXCEPTIONS_H
std::string
tf2::TF2Error::CONNECTIVITY_ERROR
@ CONNECTIVITY_ERROR
tf2::ExtrapolationException::ExtrapolationException
ExtrapolationException(const std::string errorDescription)
Definition: exceptions.h:100
tf2::TimeoutException
An exception class to notify that a timeout has occured.
Definition: exceptions.h:119
tf2::TimeoutException::TimeoutException
TimeoutException(const std::string errorDescription)
Definition: exceptions.h:123
tf2::LookupException::LookupException
LookupException(const std::string errorDescription)
Definition: exceptions.h:90
tf2::TF2Error::TRANSFORM_ERROR
@ TRANSFORM_ERROR
tf2::ExtrapolationException
An exception class to notify that the requested value would have required extrapolation beyond curren...
Definition: exceptions.h:96
std::runtime_error
std::uint8_t
tf2::LookupException
An exception class to notify of bad frame number.
Definition: exceptions.h:86
tf2::ConnectivityException
An exception class to notify of no connection.
Definition: exceptions.h:70
visibility_control.h
tf2::TF2Error
TF2Error
Definition: exceptions.h:42
tf2::TF2Error::LOOKUP_ERROR
@ LOOKUP_ERROR
tf2::InvalidArgumentException::InvalidArgumentException
InvalidArgumentException(const std::string errorDescription)
Definition: exceptions.h:112
tf2::TF2Error::TIMEOUT_ERROR
@ TIMEOUT_ERROR
tf2::ConnectivityException::ConnectivityException
ConnectivityException(const std::string errorDescription)
Definition: exceptions.h:74
std
tf2
Definition: buffer_core.h:55
TF2_PUBLIC
#define TF2_PUBLIC
Definition: visibility_control.h:58
tf2::TF2Error::EXTRAPOLATION_ERROR
@ EXTRAPOLATION_ERROR
tf2::TF2Error::NO_ERROR
@ NO_ERROR
tf2::InvalidArgumentException
An exception class to notify that one of the arguments is invalid.
Definition: exceptions.h:108
tf2::TransformException
A base class for all tf2 exceptions This inherits from ros::exception which inherits from std::runtim...
Definition: exceptions.h:57
tf2::TF2Error::INVALID_ARGUMENT_ERROR
@ INVALID_ARGUMENT_ERROR
tf2::TransformException::TransformException
TransformException(const std::string errorDescription)
Definition: exceptions.h:61