How to check if my call back function works
void poseCallback(const mera::lonaConstPtr &msg){
int i;
static tf::TransformBroadcaster br;
tf::Transform transform;
transform.setOrigin( tf::Vector3(0,0,0));
transform.setRotation( tf::Quaternion(1,1,1));
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "madar_link"));
How do I know if this works. Are there any commands which can help me to know if this will work
ROS_ERROR? Or any other print function?
@TommyP can you please elaborate on this? Should I just put something like ROS_INFO("See if it works"); insite my poseCallback function to check if its printing or something like that. I dont know how does ROS_ERROR works. Thanks
To check if your function callback "*works*" is slightly different than checking if the function callback is "*being executed*" ;) - but yes, add ROS_INFO("Executing poseCallback"); as the very first line of your function. If that function is being executed, you will see it in the log messages.
@dPackard I tried to do this but I cannot visualise my log messages. The only way to visualise log message is via rqt_console? Am I right. When I try to check it via rqt_console nothing appears. I cannot see any messages
The printout is also in the shell from where you started the program. If you start with launch file give the --screen flag to roslaunch otherwis you will not see all printouts (ROS_ERROR you will see without --screen)..