Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Switch camera on SmartDashboard based upon value of Network Tables? (http://www.chiefdelphi.com/forums/showthread.php?t=154806)

onenerdyguy 06-02-2017 08:42

Switch camera on SmartDashboard based upon value of Network Tables?
 
Is there a way to have the camera on the smart dashboard switch to another source based on a value we put into network tables?

We're basically wanting a backup cam to turn on when we invoke our 'reverse' function. I've got it putting a value into network tables, the reversing works, but I'm at a bit of a loss with the SD side.

Otherwise, we're debating putting the camera itself on a little servo and just having it flip, but I prefer software fixes to a potentially damagable hardware one.

We're in python, if it matters. The cameras are all streaming via mjpeg.

Ken Streeter 06-02-2017 09:44

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
Quote:

Originally Posted by onenerdyguy (Post 1640975)
Is there a way to have the camera on the smart dashboard switch to another source based on a value we put into network tables?

If your cameras are sufficiently low bandwidth, I'd suggest streaming both all the time, with side-by-side displays.

gerthworm 06-02-2017 10:00

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
We did something similar for 2016 - we streamed both via mjpg streamer, and then wrote a smartdashboard plugin to switch between displaying one stream or the other based on the value of a boolean.... I'm struggling to find the source code for it though... If you're curious, I can ask our lead SW mentor tonight if he still has it.

onenerdyguy 06-02-2017 10:49

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
Quote:

Originally Posted by gerthworm (Post 1641015)
We did something similar for 2016 - we streamed both via mjpg streamer, and then wrote a smartdashboard plugin to switch between displaying one stream or the other based on the value of a boolean.... I'm struggling to find the source code for it though... If you're curious, I can ask our lead SW mentor tonight if he still has it.

I'd be interested, if only to see how it was done!

onenerdyguy 06-02-2017 10:55

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
Quote:

Originally Posted by Ken Streeter (Post 1641005)
If your cameras are sufficiently low bandwidth, I'd suggest streaming both all the time, with side-by-side displays.

That is one thing we're looking into as well. it should be low enough bandwidth, considering they're just 160x120 10fps

gerthworm 06-02-2017 11:58

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
Quote:

Originally Posted by onenerdyguy (Post 1641034)
I'd be interested, if only to see how it was done!

Got the repo:

https://github.com/RobotCasserole173...am_SDExtension

onenerdyguy 06-02-2017 12:22

Re: Switch camera on SmartDashboard based upon value of Network Tables?
 
Quote:

Originally Posted by gerthworm (Post 1641073)

Nice! This is exactly what we're hoping for. Thanks!


All times are GMT -5. The time now is 22:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi