[ros-users] How to get copy of message using MessageEvent callback?

Josh Faust jfaust at willowgarage.com
Mon Oct 25 18:08:26 UTC 2010


>
>
> Yes, the second error I think is because I'm trying to assign a
> control_mode_statusConstPtr& to a control_mode_status. Which brings up
> another question, and this may just be my inexperience with C++ but,
> how can I get a (copy of) the control_mode_status message itself to
> assign to my data member?
>

Same way you dereference any pointer:
var = *msg;


>
> const std_msgs::StringConstPtr& msg = event.getMessage();


> (note the &), as in the example in the docs? Is it a typo?
>

Sorry, that was a typo in my email.  That works fine, and is correct.

Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101025/6b50f22e/attachment-0003.html>


More information about the ros-users mailing list