ROS_INFO can't print a ROS message?
I just spent around almost 2 hrs trying to fix a problem, that didn't even exist in the first place. All because ROS_INFO was printing the wrong thing (essentially printing garbage) when I tried to do something like
std::string s = "..."
ROS_INFO("result: %s", s)
I had to print an std::string because I was trying to print a ROS message, which I had to parse myself, because I couldn't JUST PRINT THE MESSAGE:
void soemclass::jointPositionsCallback(const some_msgs::JointsPositions::ConstPtr& msg){
ROS_INFO(msg); // <- COMPILE ERROR
}
Is there really no way to JUST PRINT THE MESSAGE? Why can't I just print the std::string
as well?
I feel this should be so much easier.