No matching function when it exists
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?