Control System

The CommNet is a connected-star interconnect network. The server program runs on the main controlling processor node (there can be more than one main node), and the rest nodes run a client program.

The server program accepts requrests from clients, and do the following actions according to the clients' request:

Command
Direction
Description
Example packet format

ACK

server to client

the respond to SET request

{"method": "ack", "data": []}

GET

client to server

get value of specific keys

{"method": "get", "data": [{"key": "/example/key"}]}

KEY

client to server

get all key entries

{"method": "key", "data": []}

RES

server to client

the respond to GET and KEY request

{"method": "res", "data": [{"key": "/example/key", "value": 0.2}]}

SET

client to server

set specific key to values

{"method": "set", "data": [{"key": "/example/key", "value": 0.2}]}

ERR

both

report certain error, error code in "msg" field

NetworkTable

Server (and also client, if using caching implementations) will store the data in NetworkTable, a key-value pair form data format.

NetoworkTable is an implementation of a distributed key-value pair dictionary. The key and value pairs are created on any server node and are automatically distributed to all the other nodes.

Data is organized in NetworkTables in a hierarchy much like a directory on a computer with folders and files. For any instance of NetworkTables there can be multiple values and subtables that may be nested in whatever way fits the data organization desired. Subtables actually are represented as a long key with slashes (/) separating the nested subtable and value key names, sometimes called a path. Each value has a key associated with it that is used to retrieve the value.

Data types for NetworkTables are either boolean, numeric, or string. Numeric values are written as double precision values. In addition you can have arrays of any of those types to ensure that multiple data items are delivered consistently. There is also the option of storing raw data which can be used for representing structured data.

Default Entries

The following entries will be created when initializing the networktable, and will always be accessible.

Key
R/W
Default Value
Description

/time

R

current timestamp

The current timestamp. Will be updated with every program loop.

/version

R

0.1.0

The version of the NetworkTable. Latest version is v0.1.0

Additioal Functionalities & Best practices

Additional functionalities can be achieved using the following method:

ping

query the current time using get request.

Last updated

Was this helpful?