![]() |
Refreshing SmartDashboard Simple Camera Feed
We want to run two cameras this year (for alignment purposes). Right now we're using the Axis M1011 and 206. We would like to turn off a camera when it's not needed to conserve bandwith. We couldn't find a function to turn it off and on. Is there anyway to do that?
We then tried to set the camera that's not in use to a terrible resolution (compression -> 100) after pressing a button on the joystick. However, the SmartDashboard doesn't automatically refresh the feed. We have to disconnect and reconnect for the new settings to take effect or close/reopen SmartDashboard. Does anyone have a workaround for this? We program in C++ & use Windows. |
Re: Refreshing SmartDashboard Simple Camera Feed
I don't know if there is a function to turn off a camera but you can choose which image gets sent to the dashboard/smartdashboard (whichever you're using, doesn't really matter).
|
Re: Refreshing SmartDashboard Simple Camera Feed
Quote:
We know how to delete and add widgets on SmartDashboard, but during competition, that would eat up a lot of time, especially if we need to switch angles quickly. |
Re: Refreshing SmartDashboard Simple Camera Feed
The connection to the camera is an http session. In LV, if you close the TCP handle, the camera will stop sending images. I'm not sure how to do the equivalent in SD.
Greg McKaskle |
Re: Refreshing SmartDashboard Simple Camera Feed
The "Intermediate Vision" example project contains an example of getting an image from usb camera, modifying it, and then sending it to the dashboard. To have a system where you have multiple cameras and want to choose which img from which camera gets sent to the dashboard you'll need to do several things. The following code examples are in java but it should be similar in c++.
1) You need to create ids for each camera by supplying the camera name, the camera name shows up on the roborio interface ("roborio-TEAM.local/" where TEAM is your team number, "roborio-2853.local/" in your case) Code:
// Get camera ids by supplying camera name ex 'cam0', found on roborio web interfaceCode:
// Img that will contain camera imgCode:
NIVision.IMAQdxStopAcquisition(prevCamId);Code:
NIVision.IMAQdxGrab(curCamId, frame, 1);If you have any questions feel free to ask :) |
| All times are GMT -5. The time now is 02:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi