StampedTransform getting Position instead of Relative Position
HI, I am trying to log some data. The code works like intended except I am receiving the Relative Position instead of the Position.
tf::StampedTransform transformOdom;
current_time = ros::Time::now();
try {
listener.waitForTransform( "odom","base_footprint", ros::Time(0), ros::Duration(10.0));
listener.lookupTransform( "odom", "base_footprint",ros::Time(0), transformOdom);
}
catch (tf::TransformException &ex) {
ROS_ERROR("%s",ex.what());
}
//For debugging purposes
ROS_INFO_STREAM("X pose " << transformOdom.getOrigin().x() );
ROS_INFO_STREAM("Y pose " << transformOdom.getOrigin().y());
fileToWrite.open ("log.txt", ios_base::app);
fileToWrite << "X: " << transformOdom.getOrigin().x() << " Y: " << transformOdom.getOrigin().y()<< "\n";
fileToWrite.close();
Does anyone know how to get the position of the robot instead of the relative position?
Thanks, choog