Hi!<div><br></div><div>I guess I would suggest something simple like storing the values coming from the other callback on a <meta http-equiv="content-type" content="text/html; charset=utf-8">std_msgs::String class variable and accessing it from the <meta http-equiv="content-type" content="text/html; charset=utf-8">void imageCallback(const sensor_msgs::ImageConstPtr& msg_ptr) function.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div>Gonçalo Cabrita</div><div>ISR - University of Coimbra</div><div>Portugal</div><div><br><div class="gmail_quote">On Thu, Nov 18, 2010 at 4:01 PM,  <span dir="ltr"><<a href="mailto:gatemaze@gmail.com">gatemaze@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br><br>sorry if this is a basic question but I couldn't find anything in the wiki. I would like to retrieve the current value of a topic from the callback of another topic. How is this possible? In more detail I have:<br>


<br>public:<br>    ImageConverter(ros::NodeHandle &n) : n_(n), it_(n_)<br>    {<br>        cvNamedWindow("Image window");<br>        image_sub_ = it_.subscribe("/camera_sim/image_raw", 1, &ImageConverter::imageCallback, this);<br>


    }<br><br>void imageCallback(const sensor_msgs::ImageConstPtr& msg_ptr)<br>{<br>        // Image obtained from subscribed node and converted to IplImage<br>        IplImage *img = NULL;<br>        try {<br>            img = bridge_.imgMsgToCv(msg_ptr, "bgr8"); // reads the image<br>


            // I WOULD LIKE TO READ THE VALUE OF ANOTHER TOPIC (std_msgs::String) HERE<br>        }<br>        catch (sensor_msgs::CvBridgeException error) {<br>            ROS_ERROR("error");<br>        }<br>}<br>


<br>Many Thanks<br>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br></div>