# Revision history [back]

void geoCallback(const geometry_msgs::TransformStampedConstPtr& pose){
ROS_INFO(pose->transform.translation.x);
}


There is a version of ROS_INFO(..) that takes only a single argument, but that argument must then be a string, not a single double (float64 is the name of the rosmsg IDL type, not a C++ type).

This is not Python, so you cannot just do print (double(123)).

As mentioned in #q12837, ROS_INFO(..) and the other ROS_*(..) logging macros support printf arguments, so in order to print a single double, you'd do something like:

ROS_INFO("%f", pose->transform.translation.x);

void geoCallback(const geometry_msgs::TransformStampedConstPtr& pose){
ROS_INFO(pose->transform.translation.x);
}


There is a version of ROS_INFO(..) that takes only a single argument, but that argument must then be a string, string (well, a char* I believe, but basically a string), not a single double (float64 is the name of the rosmsg IDL type, not a C++ type).

This is not Python, so you cannot just do print (double(123)).

As mentioned in #q12837, ROS_INFO(..) and the other ROS_*(..) logging macros support printf arguments, so in order to print a single double, you'd do something like:

ROS_INFO("%f", pose->transform.translation.x);

void geoCallback(const geometry_msgs::TransformStampedConstPtr& pose){
ROS_INFO(pose->transform.translation.x);
}


There is a version of ROS_INFO(..) that takes only a single argument, but that argument must then be a string (well, a char* I believe, but basically a string), not a single double (float64 is the name of the rosmsg IDL type, not a C++ type).

This is not Python, so you cannot just do print (double(123))(float(123)).

As mentioned in #q12837, ROS_INFO(..) and the other ROS_*(..) logging macros support printf arguments, so in order to print a single double, you'd do something like:

ROS_INFO("%f", pose->transform.translation.x);