Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf2_eigen: Deprecate methods using Affine3d. #371

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions tf2_eigen/include/tf2_eigen/tf2_eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ Eigen::Isometry3d transformToEigen(const geometry_msgs::TransformStamped& t) {
/** \brief Convert an Eigen Affine3d transform to the equivalent geometry_msgs message type.
* \param T The transform to convert, as an Eigen Affine3d transform.
* \return The transform converted to a TransformStamped message.
* \deprecated Use Isometry3d instead.
*/
inline
geometry_msgs::TransformStamped eigenToTransform(const Eigen::Affine3d& T)
ROS_DEPRECATED geometry_msgs::TransformStamped eigenToTransform(const Eigen::Affine3d& T)
{
geometry_msgs::TransformStamped t;
t.transform.translation.x = T.translation().x();
Expand Down Expand Up @@ -223,12 +224,14 @@ void fromMsg(const geometry_msgs::PointStamped& msg, tf2::Stamped<Eigen::Vector3
* \param t_in The frame to transform, as a Eigen Affine3d transform.
* \param t_out The transformed frame, as a Eigen Affine3d transform.
* \param transform The timestamped transform to apply, as a TransformStamped message.
* \deprecated Use Isometry3d instead.
*/
template <>
inline
void doTransform(const Eigen::Affine3d& t_in,
Eigen::Affine3d& t_out,
const geometry_msgs::TransformStamped& transform) {
ROS_DEPRECATED void doTransform(
const Eigen::Affine3d& t_in,
Eigen::Affine3d& t_out,
const geometry_msgs::TransformStamped& transform) {
t_out = Eigen::Affine3d(transformToEigen(transform) * t_in);
}

Expand Down Expand Up @@ -330,9 +333,10 @@ void doTransform(const tf2::Stamped<Eigen::Quaterniond>& t_in,
* This function is a specialization of the toMsg template defined in tf2/convert.h.
* \param in The Eigen Affine3d to convert.
* \return The Eigen transform converted to a Pose message.
* \deprecated Use Isometry3d instead.
*/
inline
geometry_msgs::Pose toMsg(const Eigen::Affine3d& in) {
ROS_DEPRECATED geometry_msgs::Pose toMsg(const Eigen::Affine3d& in) {
geometry_msgs::Pose msg;
msg.position.x = in.translation().x();
msg.position.y = in.translation().y();
Expand Down Expand Up @@ -380,9 +384,10 @@ geometry_msgs::Pose toMsg(const Eigen::Isometry3d& in) {
* This function is a specialization of the toMsg template defined in tf2/convert.h.
* \param msg The Pose message to convert.
* \param out The pose converted to a Eigen Affine3d.
* \deprecated USe Isometry3d instead.
*/
inline
void fromMsg(const geometry_msgs::Pose& msg, Eigen::Affine3d& out) {
ROS_DEPRECATED void fromMsg(const geometry_msgs::Pose& msg, Eigen::Affine3d& out) {
out = Eigen::Affine3d(
Eigen::Translation3d(msg.position.x, msg.position.y, msg.position.z) *
Eigen::Quaterniond(msg.orientation.w,
Expand Down Expand Up @@ -446,10 +451,11 @@ void fromMsg(const geometry_msgs::Twist &msg, Eigen::Matrix<double,6,1>& out) {
* \param t_in The frame to transform, as a timestamped Eigen Affine3d transform.
* \param t_out The transformed frame, as a timestamped Eigen Affine3d transform.
* \param transform The timestamped transform to apply, as a TransformStamped message.
* \deprecated Use Isometry3d instead.
*/
template <>
inline
void doTransform(const tf2::Stamped<Eigen::Affine3d>& t_in,
ROS_DEPRECATED void doTransform(const tf2::Stamped<Eigen::Affine3d>& t_in,
tf2::Stamped<Eigen::Affine3d>& t_out,
const geometry_msgs::TransformStamped& transform) {
t_out = tf2::Stamped<Eigen::Affine3d>(transformToEigen(transform) * t_in, transform.header.stamp, transform.header.frame_id);
Expand All @@ -476,9 +482,10 @@ void doTransform(const tf2::Stamped<Eigen::Isometry3d>& t_in,
* This function is a specialization of the toMsg template defined in tf2/convert.h.
* \param in The timestamped Eigen Affine3d to convert.
* \return The Eigen transform converted to a PoseStamped message.
* \deprecated Use Isometry3d instead.
*/
inline
geometry_msgs::PoseStamped toMsg(const tf2::Stamped<Eigen::Affine3d>& in)
ROS_DEPRECATED geometry_msgs::PoseStamped toMsg(const tf2::Stamped<Eigen::Affine3d>& in)
{
geometry_msgs::PoseStamped msg;
msg.header.stamp = in.stamp_;
Expand All @@ -501,9 +508,11 @@ geometry_msgs::PoseStamped toMsg(const tf2::Stamped<Eigen::Isometry3d>& in)
* This function is a specialization of the toMsg template defined in tf2/convert.h.
* \param msg The PoseStamped message to convert.
* \param out The pose converted to a timestamped Eigen Affine3d.
* \deprecated Use Isometry3d instead.
*/
inline
void fromMsg(const geometry_msgs::PoseStamped& msg, tf2::Stamped<Eigen::Affine3d>& out)
ROS_DEPRECATED void fromMsg(const geometry_msgs::PoseStamped& msg,
tf2::Stamped<Eigen::Affine3d>& out)
{
out.stamp_ = msg.header.stamp;
out.frame_id_ = msg.header.frame_id;
Expand Down