StructArraySubscriber
- class ntcore.StructArraySubscriber
Bases:
Subscriber
NetworkTables struct-encoded value array subscriber.
- close() None
Destroys the subscriber
- get(*args, **kwargs)
Overloaded function.
get(self: ntcore._ntcore.StructArraySubscriber) -> list[object]
Get the last published value. If no value has been published or the value cannot be unpacked, returns the stored default value.
- Returns:
value
get(self: ntcore._ntcore.StructArraySubscriber, defaultValue: List[object]) -> list[object]
Get the last published value. If no value has been published or the value cannot be unpacked, returns the passed defaultValue.
- Parameters:
defaultValue – default value to return if no value has been published
- Returns:
value
- getAtomic(*args, **kwargs)
Overloaded function.
getAtomic(self: ntcore._ntcore.StructArraySubscriber) -> ntcore._ntcore.TimestampedStructArray
Get the last published value along with its timestamp If no value has been published or the value cannot be unpacked, returns the stored default value and a timestamp of 0.
- Returns:
timestamped value
getAtomic(self: ntcore._ntcore.StructArraySubscriber, defaultValue: List[object]) -> ntcore._ntcore.TimestampedStructArray
Get the last published value along with its timestamp. If no value has been published or the value cannot be unpacked, returns the passed defaultValue and a timestamp of 0.
- Parameters:
defaultValue – default value to return if no value has been published
- Returns:
timestamped value
- getTopic() ntcore._ntcore.StructArrayTopic
Get the corresponding topic.
- Returns:
Topic
- readQueue() list[ntcore._ntcore.TimestampedStructArray]
Get an array of all valid value changes since the last call to ReadQueue. Also provides a timestamp for each value. Values that cannot be unpacked are dropped.
Note
The “poll storage” subscribe option can be used to set the queue depth.
- Returns:
Array of timestamped values; empty array if no valid new changes have been published since the previous call.