SmartDashboard

class wpilib.SmartDashboard[source]

Bases: builtins.object

The bridge between robot programs and the SmartDashboard on the laptop

When a value is put into the SmartDashboard, it pops up on the SmartDashboard on the remote host. Users can put values into and get values from the SmartDashboard.

These values can also be accessed by a NetworkTables client via the ‘SmartDashboard’ table:

from networktables import NetworkTable
sd = NetworkTable.getTable('SmartDashboard')

# sd.putXXX and sd.getXXX work as expected here
static getBoolean(key, defaultValue=<class 'wpilib.smartdashboard.SmartDashboard._defaultValueSentry'>)[source]

Returns the value at the specified key.

Parameters:
  • key (str) – the key
  • defaultValue – returned if the key doesn’t exist
Returns:

the value

Raises:

KeyError if the key doesn’t exist and defaultValue is not provided.

static getData(key)[source]

Returns the value at the specified key.

Parameters:key (str) – the key
Returns:the value
Raises:KeyError if the key doesn’t exist
static getDouble(key, defaultValue=<class 'wpilib.smartdashboard.SmartDashboard._defaultValueSentry'>)

Returns the value at the specified key.

Parameters:
  • key (str) – the key
  • defaultValue – returned if the key doesn’t exist
Return type:

float

Raises:

KeyError if the key doesn’t exist and defaultValue is not provided.

static getInt(key, defaultValue=<class 'wpilib.smartdashboard.SmartDashboard._defaultValueSentry'>)

Returns the value at the specified key.

Parameters:
  • key (str) – the key
  • defaultValue – returned if the key doesn’t exist
Return type:

float

Raises:

KeyError if the key doesn’t exist and defaultValue is not provided.

static getNumber(key, defaultValue=<class 'wpilib.smartdashboard.SmartDashboard._defaultValueSentry'>)[source]

Returns the value at the specified key.

Parameters:
  • key (str) – the key
  • defaultValue – returned if the key doesn’t exist
Return type:

float

Raises:

KeyError if the key doesn’t exist and defaultValue is not provided.

static getString(key, defaultValue=<class 'wpilib.smartdashboard.SmartDashboard._defaultValueSentry'>)[source]

Returns the value at the specified key.

Parameters:
  • key (str) – the key
  • defaultValue – returned if the key doesn’t exist
Return type:

str

Raises:

KeyError if the key doesn’t exist and defaultValue is not provided.

static putBoolean(key, value)[source]

Maps the specified key to the specified value in this table. The key can not be None.

The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
  • key (str) – the key
  • value – the value
static putData(*args, **kwargs)[source]

Maps the specified key to the specified value in this table. The value can be retrieved by calling the get method with a key that is equal to the original key.

Two argument formats are supported: key, data:

Parameters:
  • key (str) – the key (cannot be None)
  • data – the value

Or the single argument “value”:

Parameters:value – the named value (getName is called to retrieve the value)
static putDouble(key, value)

Maps the specified key to the specified value in this table. The key can not be None. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
  • key (str) – the key
  • value (int or float) – the value
static putInt(key, value)

Maps the specified key to the specified value in this table. The key can not be None. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
  • key (str) – the key
  • value (int or float) – the value
static putNumber(key, value)[source]

Maps the specified key to the specified value in this table. The key can not be None. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
  • key (str) – the key
  • value (int or float) – the value
static putString(key, value)[source]

Maps the specified key to the specified value in this table. The key can not be None. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
  • key (str) – the key
  • value (str) – the value
table = None
tablesToData = {}