So i am subscribing the position of a marker, but i would like to access its position at the instant i am using the function so that i can put the x y z coordinate into a vector. how should i do that ? #include "ros/ros.h" #include #include #include #include #include "geometry_msgs/PoseStamped.h" #include "geometry_msgs/Pose.h" #include "geometry_msgs/PoseWithCovariance.h" #include #include #include #include #include #include using namespace cv; using namespace std; void imageCallback(const geometry_msgs::PoseStamped::ConstPtr& ps4){ cout<<"pose is"<pose.position<publish(ps); } int main(int argc,char** argv){ geometry_msgs::PoseStamped my_vidoe; ros::init(argc, argv, "visp_auto_tracker_1"); ros::NodeHandle n; ros::Subscriber sub = n.subscribe("/visp_auto_tracker/object_position", 1000, imageCallback); ros::spin(); return 0; } --- [Visit Topic](https://discourse.ros.org/t/how-to-access-the-instant-ros-callback-value/1888/1) or reply to this email to respond. If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates. ______________________________________________________________________________ ros-users mailing list ros-users@lists.ros.org http://lists.ros.org/mailman/listinfo/ros-users Unsubscribe: