ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

No matching function when it exists

asked 2019-02-12 04:26:57 -0500

stevemartin gravatar image

updated 2019-02-12 04:27:14 -0500

I am working with TF2 library and I have this code:

tf2::Transform tf_map_odom;

    tf_map_odom.setOrigin(tf2::Vector3(
        msg->transform.translation.x - this->_odom.pose.pose.position.x,
        msg->transform.translation.y - this->_odom.pose.pose.position.y, 0));

    tf2::Quaternion q(msg->transform.rotation.x,
        msg->transform.rotation.y,
        msg->transform.rotation.z,
        msg->transform.rotation.w);

    //tf::quaternionMsgToTF(this->_odom.pose.pose.orientation, qq);
    tf2::Quaternion qq(this->_odom.pose.pose.orientation.x,
        _odom.pose.pose.orientation.y,
        _odom.pose.pose.orientation.z,
        _odom.pose.pose.orientation.w);
    q = q * qq.inverse();

    tf_map_odom.setRotation(q);

    const tf2::Stamped<tf2::Transform> tf_stamped_map_odom(tf_map_odom, msg->header.stamp, "map");

    this->_map_to_odom = toMsg(tf_stamped_map_odom);

But my compiler says:

error: no matching function for call to ‘toMsg(const tf2::Stamped<tf2::Transform>&)’
     this->_map_to_odom = toMsg(tf_stamped_map_odom);

Strange, as based on their documentation here: LINK, They do have that specific function.

What is wrong?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2019-02-12 05:39:52 -0500

aPonza gravatar image

I think it's because it's tf2::toMsg, provided you have #include <tf2/convert.h>.

edit flag offensive delete link more
0

answered 2020-03-26 04:57:18 -0500

bluemoon93 gravatar image

Try including the namespace, i.e.,

this->_map_to_odom = tf2::toMsg(tf_stamped_map_odom);
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-02-12 04:26:57 -0500

Seen: 1,221 times

Last updated: Feb 12 '19