wpilibsuite / shuffleboard

A modern dashboard for FRC
Other
80 stars 84 forks source link

Add ability to add camera widgets to layout based on URL or networktables name. #582

Closed Daltz333 closed 2 years ago

Daltz333 commented 5 years ago

Is your feature request related to a problem? Please describe.
Unable to add camera server to layout using the FRC Raspberry Pi image. You currently cannot do this via the Shuffleboard Python API on the Raspberry Pi because you cannot install pyfrc on a raspberry pi. A simple solution to this would be to allow the Shuffleboard API to take a NetworkTables entry instead.

Describe the solution you'd like
Allow the Shuffleboard addCamera API to take a NetworkTables entry of the camera server.

Describe alternatives you've considered
Possibly the ability to get PyFRC to build and install on the RaspberryPi? But would having multiple locations setting layouts really be the best idea? I'm open to ideas.

virtuald commented 5 years ago

Strictly speaking, there's nothing preventing you from installing pyfrc on an RPi -- but that isn't the actual problem anyways, as pyfrc is a helper library that allows you to do various things -- it doesn't have a shuffleboard API. The actual work is all in the wpilib package.

What you really want is the ability to use the wpilib.shuffleboard package. If you install the wpilib and robotpy-hal-sim packages on the RPi via pip, (I haven't tried it, but...) you should be able to use wpilib.shuffleboard as expected.

It would be nice if you could just install the wpilib package, but unfortunately we do a lot of default imports and so the hal package is also necessary.

Daltz333 commented 5 years ago

That will probably work in the meantime, but my feature request still stands. Thanks @virtuald ❤️

auscompgeek commented 5 years ago

One can already programmatically add a camera widget by name to Shuffleboard. This is used by the WPILib Shuffleboard API to add a cscore VideoSource to a ShuffleboardContainer.

The FRCVision image has both WPILibJ and WPILibC simulation libraries available (as added after a request to be able to use the Shuffleboard APIs).

auscompgeek commented 5 years ago

If you're trying to ask to be able to feed the WPILib Shuffleboard API (which is not here) a CameraServer name, wpilibsuite/allwpilib#1587 is already open for that.

Daltz333 commented 5 years ago

@auscompgeek I was looking for a method that adds by NetworkTables name/URL. Not the VideoSource as that means Shuffleboard can NOT create a camera widget from a remote stream

auscompgeek commented 5 years ago

For adding a stream by URL, that is already possible by adding a VideoSource to Shuffleboard. (See the example provided in the issue linked above.)