Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit 75e9a6b

Browse files
committed
move the forward declaration, and remove clang workaround.
1 parent ca6bbe8 commit 75e9a6b

File tree

3 files changed

+19
-80
lines changed

3 files changed

+19
-80
lines changed

tf2/include/tf2/convert.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,6 @@ template <class P>
8484
return t.frame_id_;
8585
}
8686

87-
/** Function that converts from one type to a ROS message type. It has to be
88-
* implemented by each data type in tf2_* (except ROS messages) as it is
89-
* used in the "convert" function.
90-
* \param a an object of whatever type
91-
* \return the conversion as a ROS message
92-
*/
93-
template<typename A, typename B>
94-
B toMsg(const A& a);
95-
96-
/** Function that converts from a ROS message type to another type. It has to be
97-
* implemented by each data type in tf2_* (except ROS messages) as it is used
98-
* in the "convert" function.
99-
* \param a a ROS message to convert from
100-
* \param b the object to convert to
101-
*/
102-
template<typename A, typename B>
103-
void fromMsg(const A&, B& b);
104-
10587
/** Function that converts any type to any type (messages or not).
10688
* Matching toMsg and from Msg conversion functions need to exist.
10789
* If they don't exist or do not apply (for example, if your two

tf2/include/tf2/impl/convert.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@
3131
#define TF2_IMPL_CONVERT_H
3232

3333
namespace tf2 {
34+
35+
/** Function that converts from one type to a ROS message type. It has to be
36+
* implemented by each data type in tf2_* (except ROS messages) as it is
37+
* used in the "convert" function.
38+
* \param a an object of whatever type
39+
* \return the conversion as a ROS message
40+
*/
41+
template<typename A, typename B>
42+
B toMsg(const A& a);
43+
44+
/** Function that converts from a ROS message type to another type. It has to be
45+
* implemented by each data type in tf2_* (except ROS messages) as it is used
46+
* in the "convert" function.
47+
* \param a a ROS message to convert from
48+
* \param b the object to convert to
49+
*/
50+
template<typename A, typename B>
51+
void fromMsg(const A&, B& b);
52+
3453
namespace impl {
3554

3655
template <bool IS_MESSAGE_A, bool IS_MESSAGE_B>

tf2_eigen/include/tf2_eigen/tf2_eigen.h

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -520,66 +520,4 @@ void fromMsg(const geometry_msgs::PoseStamped& msg, tf2::Stamped<Eigen::Isometry
520520

521521
} // namespace
522522

523-
524-
namespace Eigen {
525-
// This is needed to make the usage of the following conversion functions usable in tf2::convert().
526-
// According to clangs error note 'fromMsg'/'toMsg' should be declared prior to the call site or
527-
// in an associated namespace of one of its arguments. The stamped versions of this conversion
528-
// functions work because they have tf2::Stamped as an argument which is the same namespace as
529-
// which 'fromMsg'/'toMsg' is defined in. The non-stamped versions have no argument which is
530-
// defined in tf2, so it take the following definitions in Eigen namespace to make them usable in
531-
// tf2::convert().
532-
533-
inline
534-
geometry_msgs::Pose toMsg(const Eigen::Affine3d& in) {
535-
return tf2::toMsg(in);
536-
}
537-
538-
inline
539-
geometry_msgs::Pose toMsg(const Eigen::Isometry3d& in) {
540-
return tf2::toMsg(in);
541-
}
542-
543-
inline
544-
void fromMsg(const geometry_msgs::Point& msg, Eigen::Vector3d& out) {
545-
tf2::fromMsg(msg, out);
546-
}
547-
548-
inline
549-
geometry_msgs::Point toMsg(const Eigen::Vector3d& in) {
550-
return tf2::toMsg(in);
551-
}
552-
553-
inline
554-
void fromMsg(const geometry_msgs::Pose& msg, Eigen::Affine3d& out) {
555-
tf2::fromMsg(msg, out);
556-
}
557-
558-
inline
559-
void fromMsg(const geometry_msgs::Pose& msg, Eigen::Isometry3d& out) {
560-
tf2::fromMsg(msg, out);
561-
}
562-
563-
inline
564-
geometry_msgs::Quaternion toMsg(const Eigen::Quaterniond& in) {
565-
return tf2::toMsg(in);
566-
}
567-
568-
inline
569-
void fromMsg(const geometry_msgs::Quaternion& msg, Eigen::Quaterniond& out) {
570-
tf2::fromMsg(msg, out);
571-
}
572-
573-
inline
574-
geometry_msgs::Twist toMsg(const Eigen::Matrix<double,6,1>& in) {
575-
return tf2::toMsg(in);
576-
}
577-
578-
inline
579-
void fromMsg(const geometry_msgs::Twist &msg, Eigen::Matrix<double,6,1>& out) {
580-
tf2::fromMsg(msg, out);
581-
}
582-
583-
} // namespace
584-
585523
#endif // TF2_EIGEN_H

0 commit comments

Comments
 (0)