Verificando que SmartDashboard está funcionando

Indicador de conexión

SmartDashboard incluirá automáticamente el estado de la conexión y la dirección IP de la fuente NetworkTables en el título de la ventana.

SmartDashboard disconnected. SmartDashboard connected and showing the IP address.

Widget de indicador de conexión

SmartDashboard includes a connection indicator widget which will turn red or green depending on the connection to NetworkTables, usually provided by the roboRIO. For instructions to add this widget, look at Adding a Connection Indicator in the SmartDashboard Intro.

Ejemplo de programa de robot

public class Robot extends TimedRobot {
   double counter = 0.0;

   public void teleopPeriodic() {
      SmartDashboard.putNumber("Counter", counter++);
   }
}
#include "Robot.h"
float counter = 0.0;

void Robot::TeleopPeriodic() {
   frc::SmartDashboard::PutNumber("Counter", counter++);
}
from wpilib import SmartDashboard

self.counter = 0.0

def teleopPeriodic(self) -> None:
   SmartDashboard.putNumber("Counter", self.counter += 1)

Este es un programa de robot mínimo que escribe un valor en el SmartDashboard. Simplemente incrementa un contador 50 veces por segundo para verificar que la conexión está funcionando. Sin embargo, para minimizar el uso de ancho de banda, NetworkTables de forma predeterminada acelerará las actualizaciones a 10 veces por segundo.

Salida de SmartDashboard para el programa de muestra

SmartDashboard showing the output of "counter" set up in the code above.

La pantalla SmartDashboard debería verse así después de aproximadamente 6 segundos de que el robot se haya habilitado en el modo Teleop. Si no es así, debe verificar que la conexión esté configurada correctamente.

Verificación de la dirección IP en SmartDashboard

Checking the "Team Number" property in the Preferences dialog box.

Si la pantalla del valor no aparece, verifique que el número de equipo esté configurado correctamente como se muestra en esta imagen. El cuadro de diálogo de preferencias se puede ver seleccionando Archivo y luego `` Preferencias``.

Verificación del programa mediante OutlineViewer

You can verify that the robot program is generating SmartDashboard values by using the OutlineViewer program.

Expand the SmartDashboard row. The value Counter is the variable written to the SmartDashboard via NetworkTables. As the program runs you should see the value increasing (1398.0 in this case). If you don’t see this variable in the OutlineViewer, look for something wrong with the robot program or the network configuration.

Using OutlineViewer to view the NetworkTables data used by the program.