How to make a callback function to subscribe to a non string topic?
Hi, I've followed succesfully all basic tutorials. Then I moved to stage to work on a robot simulation. I also installed the joystick_drivers stack to use a joystick to move my virtual robot in stage. Everything is working properly (I can see the messages, topics, node graph, etc).
Right now, I tried to modify the simple subscriber 'listener' of the basic tutorials to read the information of my joystick. The problem is that the example is made for a string message.
The callback function in the tutorial is something like this: void chatterCallback(const std_msgs::String::ConstPtr& msg){ ROS_INFO("I heard: [%s]", msg->data.c_str()); }
But in the joy topic I am reading Joy messages: float32[] axes int32[] buttons
How do I manage this 'complex' messages in a correct callback function?
Thnx alot for your help!