tf message type error [closed]
Hi,All,
I have written some codes to subscribe the /tf
topic as below:
void msgcbTf(const geometry_msgs::TransformStamped & msgTf){
ROS_INFO("Sequence ID:[%d]",msgTf.header.seq);
ROS_INFO("msg time:[%d,%d]",msgTf.header.stamp.sec,msgTf.header.stamp.nsec);
ROS_INFO("tf[x=%f,y=%f]",msgTf.transform.translation.x,msgTf.transform.translation.y);
}
int main(int argc, char *argv[])
{
ros::init(argc,argv,"CyberMapInfo");
ros::NodeHandle n;
ros::Subscriber subTf=n.subscribe("tf",40,msgcbTf);
ROS_INFO("Substribe /tf.");
ros::spin();
}
There was a fatal error when the node run and the callback function msgcbTf had not been called successfully:
[ERROR] [1442566935.682455302]: Client [/CyberMapInfo] wants topic /tf to have datatype/md5sum [geometry_msgs/TransformStamped/b5764a33bfeb3588febc2682852579b0], but our version has [tf2_msgs/TFMessage/94810edda583a504dfda3829e70d7eec]. Dropping connection.
So what message type should I use to take place of geometry_msgs::TransformStamped in msgcbTf function or how can I solve this problem by other way?