MOOS wildcard subscription

MOOS wildcard subscription

Introduction

Wildcard subscription is an important advancement in MOOSV10. In this way, clients can subscribe to data whose names and sources conform to simple regular expressions.

Currently only supports "*" and "?" wildcards, where "*" refers to any number of characters, and "?" refers to any single character.

example

The following uses the CMOOSApp::Register(sVarPattern,sAppPattern,dfInterval) function as an example to show the format of wildcard subscription.

bool MyApp::OnConnectToServer()
{
    //订阅所有以“image”结尾的变量
    //从任何以“camera_”开始的进程中
    Register("*image","camera_*",0.0);
    
    //订阅来自名为“system_control”进程的任何单一变量
    Rrgister("*","syster_cintrol",0.0);
    
    //订阅任何名称以“error_”开始的变量
    //由名称为9个字符的以“process_0”开始的进程产生
    //注意通讯速度为每秒最多两次
    Register("error_*","process_0",2.0);
    return true;
}

This method provides a concise and effective way to subscribe to data, especially the subscription of a large range of variables; for example, all variables of a specified process - Register("*", "ProcessName"); even all variables from all processes --Register("*", "*").

Notice

[2049] Error

The content displayed when the error occurs is

Too many unread incoming messages [2049] : purging
The user must read mail occasionally

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325029863&siteId=291194637