GenericPublisher
- class ntcore.GenericPublisher
Bases:
Publisher
NetworkTables generic publisher.
- getTopic() ntcore._ntcore.Topic
Get the corresponding topic.
- Returns:
Topic
- set(value: ntcore._ntcore.Value) None
Publish a new value.
- Parameters:
value – value to publish
- setBoolean(value: bool, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setBooleanArray(*args, **kwargs)
Overloaded function.
setBooleanArray(self: ntcore._ntcore.GenericPublisher, value: List[bool], time: int = 0) -> bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
setBooleanArray(self: ntcore._ntcore.GenericPublisher, value: List[int], time: int = 0) -> bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setDefault(value: ntcore._ntcore.Value) None
Publish a default value. On reconnect, a default value will never be used in preference to a published value.
- Parameters:
value – value
- setDefaultBoolean(defaultValue: bool) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultBooleanArray(defaultValue: List[int]) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultDouble(defaultValue: float) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultDoubleArray(defaultValue: List[float]) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultFloat(defaultValue: float) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultFloatArray(defaultValue: List[float]) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultInteger(defaultValue: int) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultIntegerArray(defaultValue: List[int]) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultRaw(defaultValue: buffer) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultString(defaultValue: str) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDefaultStringArray(defaultValue: List[str]) bool
Sets the entry’s value if it does not exist.
- Parameters:
defaultValue – the default value to set
- Returns:
False if the entry exists with a different type
- setDouble(value: float, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setDoubleArray(value: List[float], time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setFloat(value: float, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setFloatArray(value: List[float], time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setInteger(value: int, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setIntegerArray(value: List[int], time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setRaw(value: buffer, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setString(value: str, time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type
- setStringArray(value: List[str], time: int = 0) bool
Sets the entry’s value.
- Parameters:
value – the value to set
time – the timestamp to set (0 = nt::Now())
- Returns:
False if the entry exists with a different type