ROS subscriber callback in cpp
I have some data coming from my arduino publisher (for example x and y ). And i want to write a subscriber which takes these data and transforms them and publishes them again in odom .
Soo my problem is that i dont know how to write a callback without using ROS_INFO( as all of the tutorials show) . I just need to store these data in new variables and nothing more . Is there anyone who could help me with that ?
Here you go. Please note that
ROS_INFO
is not doing any magic. Just, assumeROS_INFO( ... )
equivalent ofprintf( ... )
. If you do not need any printing/logging, do not useROS_INFO
.Create 2 global/class variables, say x and y, and then assign x and y to the values received inside the callback.