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

fromMsg(const PoseWithCovarianceStamped&, tf2::Stamped<tf2::Transform>&) is broken #441

Open
gleichdick opened this issue Feb 5, 2020 · 0 comments

Comments

@gleichdick
Copy link

While I was trying to do some coverage tests for #433 I noticed that tf2::fromMsg(const geometry_msgs::PoseWithCovarianceStamped&, tf2::Stamped<tf2::Transform>&) (defined in tf2_geometry_msgs.h line 594) calls fromMsg(const geometry_msgs::PoseWithCovariance&, tf2::Transform&) which not defined.

Steps to reproduce:
Compile the snipped

#include <tf2_geometry_msgs/tf2_geometry_msgs.h>

int main() {
   const geometry_msgs::PoseWithCovarianceStamped msg;
   tf2::Stamped<tf2::Transform> t;
   fromMsg(msg, t);
}

with g++ -otest $(pkg-config --cflags tf2_geometry_msgs) snippet.cpp $(pkg-config --libs tf2_geometry_msgs), the error message will be

/tmp/ccCqjqOB.o: In function `tf2::fromMsg(geometry_msgs::PoseWithCovarianceStamped_<std::allocator<void> > const&, tf2::Stamped<tf2::Transform>&)':
test2.cpp:(.text._ZN3tf27fromMsgERKN13geometry_msgs26PoseWithCovarianceStamped_ISaIvEEERNS_7StampedINS_9TransformEEE[_ZN3tf27fromMsgERKN13geometry_msgs26PoseWithCovarianceStamped_ISaIvEEERNS_7StampedINS_9TransformEEE]+0x8c): undefined reference to `void tf2::fromMsg<geometry_msgs::PoseWithCovariance_<std::allocator<void> >, tf2::Transform>(geometry_msgs::PoseWithCovariance_<std::allocator<void> > const&, tf2::Transform&)'
collect2: error: ld returned 1 exit status

When Line 599 is changed to

-  fromMsg(msg.pose, tmp);
+  fromMsg(msg.pose.pose, tmp);

it compiles (but I have no clue whether the conversation is correct).

The methods were introduced with #282, maybe @RobertBlakeAnderson can provide an unit test which verifies the fromMsg method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant