Receive MAVLink messages
The mavlinksub
object subscribes to topics from the connected
MAVLink clients using a mavlinkio
object.
Use the mavlinksub
object to obtain the most recently received messages and
call functions to process newly received messages.
This object requires you to install the UAV Library for Robotics System
Toolbox™. To install add-ons, use roboticsAddons
and select the desired add-on.
subscribes to all topics from all clients connected via the sub
= mavlinksub(mavlink
)mavlinkio
object. This syntax sets the Client
property to
"Any"
.
subscribes to a specific topic, specified as a string or integer, from all clients
connected via the sub
= mavlinksub(mavlink
,topic
)mavlinkio
object. The function sets the topic
input to the
Topic
property.
subscribes to all topics from the client specified as a sub
= mavlinksub(mavlink
,client
)mavlinkclient
object. The function sets the Client
property to this input client.
subscribes to a specific topic on a specific client. The function sets the
sub
= mavlinksub(mavlink
,client
,topic
)Client
and Topic
properties.
additionally specifies the sub
= mavlinksub(___,Name,Value)BuffferSize
or
NewMessageFcn
properties using name-value pairs and the previous
syntaxes. The Name
input is one of the property names.
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
latestmsgs | Received messages from MAVLink subscriber |