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 // Copyright 2008, Willow Garage, Inc. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 //
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 //
13 // * Neither the name of the Willow Garage 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 HOLDER 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 
31 #ifndef TF2__EXCEPTIONS_H_
32 #define TF2__EXCEPTIONS_H_
33 
34 #include <stdexcept>
35 #include <cstdint>
36 #include <string>
37 
38 #include "tf2/visibility_control.h"
39 
40 namespace tf2
41 {
42 
43 enum class TF2Error : std::uint8_t
44 {
45  NO_ERROR = 0,
46  LOOKUP_ERROR = 1,
50  TIMEOUT_ERROR = 5,
51  TRANSFORM_ERROR = 6
52 };
53 
59 {
60 public:
62  explicit TransformException(const std::string errorDescription)
63  : std::runtime_error(errorDescription)
64  {
65  }
66 };
67 
68 
75 {
76 public:
78  explicit ConnectivityException(const std::string errorDescription)
79  : tf2::TransformException(errorDescription)
80  {
81  }
82 };
83 
84 
94 {
95 public:
97  explicit LookupException(const std::string errorDescription)
98  : tf2::TransformException(errorDescription)
99  {
100  }
101 };
102 
107 {
108 public:
109  TF2_PUBLIC
110  explicit ExtrapolationException(const std::string errorDescription)
111  : tf2::TransformException(errorDescription)
112  {
113  }
114 };
115 
122 {
123 public:
124  TF2_PUBLIC
125  explicit InvalidArgumentException(const std::string errorDescription)
126  : tf2::TransformException(errorDescription) {}
127 };
128 
134 {
135 public:
136  TF2_PUBLIC
137  explicit TimeoutException(const std::string errorDescription)
138  : tf2::TransformException(errorDescription)
139  {
140  }
141 };
142 } // namespace tf2
143 #endif // TF2__EXCEPTIONS_H_
std::string
tf2::TF2Error::CONNECTIVITY_ERROR
@ CONNECTIVITY_ERROR
tf2::ExtrapolationException::ExtrapolationException
ExtrapolationException(const std::string errorDescription)
Definition: exceptions.h:110
tf2::TimeoutException
An exception class to notify that a timeout has occured.
Definition: exceptions.h:133
tf2::TimeoutException::TimeoutException
TimeoutException(const std::string errorDescription)
Definition: exceptions.h:137
tf2::LookupException::LookupException
LookupException(const std::string errorDescription)
Definition: exceptions.h:97
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:106
std::runtime_error
std::uint8_t
tf2::LookupException
An exception class to notify of bad frame number.
Definition: exceptions.h:93
tf2::ConnectivityException
An exception class to notify of no connection.
Definition: exceptions.h:74
visibility_control.h
tf2::TF2Error
TF2Error
Definition: exceptions.h:43
tf2::TF2Error::LOOKUP_ERROR
@ LOOKUP_ERROR
tf2::InvalidArgumentException::InvalidArgumentException
InvalidArgumentException(const std::string errorDescription)
Definition: exceptions.h:125
tf2::TF2Error::TIMEOUT_ERROR
@ TIMEOUT_ERROR
tf2::ConnectivityException::ConnectivityException
ConnectivityException(const std::string errorDescription)
Definition: exceptions.h:78
std
tf2
Definition: buffer_core.h:53
TF2_PUBLIC
#define TF2_PUBLIC
Definition: visibility_control.h:57
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:121
tf2::TransformException
A base class for all tf2 exceptions This inherits from ros::exception which inherits from std::runtim...
Definition: exceptions.h:58
tf2::TF2Error::INVALID_ARGUMENT_ERROR
@ INVALID_ARGUMENT_ERROR
tf2::TransformException::TransformException
TransformException(const std::string errorDescription)
Definition: exceptions.h:62