receive
Description
[
returns a msg
,status
,statustext
] = receive(___)status
indicating whether a message has
been received successfully, and a statustext
that
captures additional information about the status
,
using any of the arguments from the previous syntaxes. If an error
condition occurs, such as no message received within the specified
timeout, the status
will be
false
, and this function will not display
an error.
Examples
Input Arguments
Output Arguments
Tips
For code generation:
Use the
status
output argument when you callreceive
in the entry-point function. This will avoid runtime errors and instead, outputs the status of message reception, which can be reacted to in the calling code.
Extended Capabilities
Version History
Introduced in R2019bSee Also
send
| rosmessage
| rostopic
| rossubscriber
| rospublisher