Using a PDP widget in Shuffleboard

I have this code:

private PowerDistribution pdp = new PowerDistribution();
private ShuffleboardTab sbRobotTab;

sbRobotTab = Shuffleboard.getTab(“Robot”);
sbRobotTab.add(“PDP”, pdp).withWidget(BuiltInWidgets.kPowerDistribution);

When I run Shuffleboard, on the Robot Tab I get a PDP widget as expected, but it never populates with data, it just stays blank. If I open up the NT tree, I can see the PDP data updating as expected, but it doesn’t update in the widget. Am I doing something wrong? I did a look up on Github for kPowerDistribution, and I notice that the vast majority of the times it is mentioned is a bit of code similar to mine, that is commented out.

1 Like

This looks like it should work, but we’ve always just added the PowerDistribution without adding withWidget and it just works.

Edit: Looking at the code, I suspect that the problem may be that the PowerDistribution class is now internally specialised into either Rev PDH or CTRE PDP.

That doesn’t affect the Sendable funtionality. Because OP says the data is updating properly in NT but not in the dashboard I suspect there may be an issue on the dashboard side.

Indeed. I tried it again removing the “withWidget” part and I get very nicely updating table.

Yes. https://github.com/wpilibsuite/shuffleboard/pull/741

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.