@Blaise and Josh:
Thanks for your help.
Its working now! I have made few changes by removing callback and straight
away writing a code like below:
geometry_msgs::PoseWithCovarianceStampedConstPtr msg =
ros::topic::waitForMessage<geometry_msgs::PoseWithCovarianceStamped>("amcl_p
ose");
ROS_INFO("Received X:[%f] :: Y:[%f] :: Z:[%f] ",
msg->pose.pose.position.x, msg->pose.pose.position.y,
msg->pose.pose.position.z);
- Prasad