The urbiGet function receives the next unread message from the Urbi server, parses it, and outputs the content in a umessage struct:
>> urbiSend(myrobot,'mytag << 1+1;')
>> urbiGet(myrobot)
ans =
timeStamp: 103453
tag: 'mytag'
type: 'numeric'
value: 2
The umessage struct contains the following fields:
umessage.timeStamp : the time stamp of the message
umessage.tag : the tag of the message
umessage.type : the type of the message: 'numeric', 'string',
'list', 'system', 'object', 'image', 'sound',
or 'otherBIN'
umessage.value : message content:
numeric if type == numeric
character array if type == string
cell array if type == list
character array if type == system
character array if type == object
character array if type == image
struct if type == sound
(with fields samples, Fs, nbits, length)
bytes array if type == otherBIN
Parsing in the current liburbi-matlab suffers some limitations. Currently, binary values are not supported when they occur in a list or in an 'object' message type. If such a message is encountered, the input buffer will be corrupted and subsequent liburbi-matlab operations will be compromised. To restore a proper state of the input buffer, use the urbiClearConnection function:
>> urbiClearConnection(myrobot)