Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Driver Interface (http://www.chiefdelphi.com/forums/showthread.php?t=80175)

ajdecker1022 14-01-2010 12:25

Driver Interface
 
Hi, all! Apologies is this has been asked before (I did a search and nothing came up), but I was wondering how/if the camera's input will be displayed during the competition. On the supplied laptop in the Kit of Parts, there is a driver login that goes directly into what appears to be a LabView program.

Is there a Java equivalent to that, and can we modify it?

Thanks!

whytheheckme 14-01-2010 13:02

Re: Driver Interface
 
The supplied laptop's driver interface is THE driver interface, and it works just great with java programs.

However, I'm also curious as to how to pass the camera feed through to the interface. Maybe someone who has experience with this can comment.

Jacob

BradAMiller 14-01-2010 17:28

Re: Driver Interface
 
There are two programs that start with the driver station. One is the driver station itself. In addition, when it runs, it also starts the dashboard program. The camera images will come out in the large window on the left side of the dashboard when the camera is running.

The camera code in the robot will start the video server by default, but won't send images until the dashboard connects to it. So you don't need to do anything to make it start.

ajdecker1022 14-01-2010 19:51

Re: Driver Interface
 
Is there anyway the dashboard program could be modified in anyway, say, for a second camera? How would one go about doing that? Thanks for your prompt replies, by the way!

ranc 15-01-2010 02:10

Re: Driver Interface
 
Out of curiousity, how would you wire a second camera for one CRio?

ajdecker1022 15-01-2010 08:34

Re: Driver Interface
 
Honestly, I hadn't even considered that...but I had read elsewhere on the forums people talking of using two cameras. Anyone know about this?

BradAMiller 15-01-2010 11:15

Re: Driver Interface
 
I believe that connecting another device to the 2nd ethernet port on the cRIO is legal provided that you can come up with a switch that runs off robot power. You should check the rules yourself to be sure.

Given that, I'd expect that the cRIO might have trouble doing image processing from two cameras at the same time depending on what operations your're performing. The problem with doing that is that the AxisCamera class is currently a singleton, meaning that it assumes that there is only a single camera connected.

It might be that this can be changed in an update so that multiple cameras can be supported or it might be something that you can look at.

As for the question of modifying the dashbaord program... the source code is available as a LabVIEW application. You can modify it as needed. You have to be careful to keep the data in sync between the robot and dashboards ends. You can look at both samples to see how this works.

James Dempsey 16-01-2010 16:38

Re: Driver Interface
 
For those of you using NetBeans as an IDE. Create a new project, go to samples, then Java FRC, then pick DashboardExample(possibly slightly out of order). The methods used there will interface with the Dashboard which I believe is LabView based. The basic code supplied there should give you some visual feedback when the driver station is set to tel-op with your analog, digital, io stuff(if I remember correctly). One of the other programmers on my team will be posting that details this code in a tank drive type robot. You can also look at the example code that FIRST provided for dealing with target recognition. It is example code that is used for recognizing Lunacy targets but you should get the general idea of how the AxisCamera is used and how it displays images on the driver station. Hope this helps any and all who are looking for help dealing with the Dashboard. Keep a lookout for a post that has example code that we have prepared for the forums.

-
James D

drakesword 16-01-2010 18:28

Re: Driver Interface
 
sort of out of topic.

we updated our dashboard and now only the lower panel shows up. is this normal or do we have a problem?

James Dempsey 16-01-2010 20:42

Re: Driver Interface
 
That is a problem. If you had this after running code, then you may have a coding error which may end up causing the dashboard to not appear. However, the more likely case is that there was an error during your last install. Did you by any chance use the update installer or did you do an entire install of the WBILib and Dashboard combined?

Greg McKaskle 16-01-2010 21:39

Re: Driver Interface
 
Just to clarify, the driver station is closed, but can run and communicate to a locally running dashboard that defaults to running on the upper portion of the screen, or communicating to a remote dashboard. These dashboards can indeed be written in any language you like. I'm not sure what templates are out there, but the LV sample code wizard will produce the source for the default dashboard.

To launch a custom dashboard, either name it the same and place it in the same location as the default (Program Files\FRC Dashboard\Dashboard.exe) -- I think that is the location. Another option is to modify the All Users\Documents\FRC DS Data Storage.ini and set the DashboardCmdLine to point to your new EXE.

Greg McKaskle

whytheheckme 16-01-2010 21:58

Re: Driver Interface
 
Quote:

Originally Posted by BradAMiller (Post 899718)
I believe that connecting another device to the 2nd ethernet port on the cRIO is legal provided that you can come up with a switch that runs off robot power. You should check the rules yourself to be sure.

Given that, I'd expect that the cRIO might have trouble doing image processing from two cameras at the same time depending on what operations your're performing. The problem with doing that is that the AxisCamera class is currently a singleton, meaning that it assumes that there is only a single camera connected.

It might be that this can be changed in an update so that multiple cameras can be supported or it might be something that you can look at.

As for the question of modifying the dashbaord program... the source code is available as a LabVIEW application. You can modify it as needed. You have to be careful to keep the data in sync between the robot and dashboards ends. You can look at both samples to see how this works.

Might it be more viable to simply write code to pass the packets from the camera directly through to the DS/dashboard? Or would this utilized too much bandwidth?

drakesword 16-01-2010 23:52

Re: Driver Interface
 
The cmd line in the ini file was blank. I tried setting it to "C:\Program Files\FRC Dashboard\Dashboard.exe" But it still wont come up OR it may be comming up minimized. the update disables alt-tab so i cannot bring it up

EDIT

Scratch the disabled alt tab it does work its just not launching the software

EDIT

Figured it out . . . gotta double backslash the commands
"C:\\Program Files\\FRC Dashboard\\Dashboard.exe"

James Dempsey 17-01-2010 00:15

Re: Driver Interface
 
Quote:

Originally Posted by whytheheckme (Post 900754)
Might it be more viable to simply write code to pass the packets from the camera directly through to the DS/dashboard? Or would this utilized too much bandwidth?

I haven't calculated it but I would think that passing the data stream directly to the dashboard would be a feasible option that doesn't eat up the bandwidth. However, I may be wrong since the camera feed is a direct stream of jpgs(if I am not mistaken). This may result in a large consumption of bandwidth due to the quantity and quality of the jpgs but I would assume that FIRST designed this to not eat up your bandwidth.

-
James D

jhersh 17-01-2010 23:58

Re: Driver Interface
 
Quote:

Originally Posted by whytheheckme (Post 900754)
Might it be more viable to simply write code to pass the packets from the camera directly through to the DS/dashboard? Or would this utilized too much bandwidth?

This is essentially what the video to dashboard server on the cRIO does. The JPEGs from the camera are not recompressed... they are simply forwarded on.


All times are GMT -5. The time now is 12:44.

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