Re: [ros-users] How to get copy of message using MessageEven…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: Re: [ros-users] How to get copy of message using MessageEvent callback?
>
>
> 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