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.
|
Go to the documentation of this file.
31 #ifndef TF2__CONVERT_H_
32 #define TF2__CONVERT_H_
37 #include "builtin_interfaces/msg/time.hpp"
38 #include "geometry_msgs/msg/transform_stamped.hpp"
39 #include "rosidl_runtime_cpp/traits.hpp"
59 const T & data_in, T & data_out,
60 const geometry_msgs::msg::TransformStamped & transform);
128 template<
typename A,
typename B>
129 B
toMsg(
const A & a);
137 template<
typename A,
typename B>
138 void fromMsg(
const A &, B & b);
147 template<
class A,
class B>
151 rosidl_generator_traits::is_message<B>::value>
::convert(a, b);
171 size_t l1 = 0, l2 = 0;
172 for (
const double & val : row_major) {
173 nested_array[l2][l1] = val;
177 if (l1 == nested_array[0].size()) {
195 for (
const auto & arr : nested_array) {
196 for (
const double & val : arr) {
197 row_major[counter] = val;
205 #endif // TF2__CONVERT_H_
void convert(const A &a, B &b)
Function that converts any type to any type (messages or not). Matching toMsg and from Msg conversion...
Definition: convert.h:148
TimePoint stamp_
The timestamp associated with this data.
Definition: transform_datatypes.h:49
void fromMsg(const A &, B &b)
Function that converts from a ROS message type to another type. It has to be implemented by each data...
The data type which will be cross compatable with geometry_msgs This is the tf2 datatype equivilant o...
Definition: transform_datatypes.h:46
std::string getFrameId(const T &t)
Get the frame_id from data.
std::array< std::array< double, 6 >, 6 > covarianceRowMajorToNested(const std::array< double, 36 > &row_major)
Function that converts from a row-major representation of a 6x6 covariance matrix to a nested array r...
Definition: convert.h:168
std::array< double, 36 > covarianceNestedToRowMajor(const std::array< std::array< double, 6 >, 6 > &nested_array)
Function that converts from a nested array representation of a 6x6 covariance matrix to a row-major r...
Definition: convert.h:191
std::string frame_id_
The frame_id associated this data.
Definition: transform_datatypes.h:50
std::array< std::array< double, 6 >, 6 > cov_mat_
The covariance matrix associated with this data.
Definition: transform_datatypes.h:100
std::array< std::array< double, 6 >, 6 > getCovarianceMatrix(const T &t)
Get the covariance matrix from data.
The data type which will be cross compatable with geometry_msgs This is the tf2 datatype equivalent o...
Definition: transform_datatypes.h:95
Definition: buffer_core.h:53
B toMsg(const A &a)
Function that converts from one type to a ROS message type. It has to be implemented by each data typ...
void doTransform(const T &data_in, T &data_out, const geometry_msgs::msg::TransformStamped &transform)
The templated function expected to be able to do a transform.
tf2::TimePoint getTimestamp(const T &t)
Get the timestamp from data.