How to get the message text back to the main function
void MyFunc(const std_msgs::String::ConstPtr& msg)
{
//code
}
....
ros::Subscriber sub = n.subscribe("shatter", 1000, chatterCallback);
standard subscription and reading data from the theme. But I have a question is it possible to implement reading from another topic that the message was in the same main function
I don't quite understand your question. Are you trying to subscribe to two different topics at the same time and access the messages from these two topics inside the main loop of your node?
@PeteBlackerThe3rd yes