PDA

View Full Version : Driver Interface


ajdecker1022
01-14-2010, 11:25 AM
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
01-14-2010, 12:02 PM
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
01-14-2010, 04:28 PM
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
01-14-2010, 06:51 PM
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
01-15-2010, 01:10 AM
Out of curiousity, how would you wire a second camera for one CRio?

ajdecker1022
01-15-2010, 07:34 AM
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
01-15-2010, 10:15 AM
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
01-16-2010, 03:38 PM
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
01-16-2010, 05:28 PM
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
01-16-2010, 07:42 PM
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
01-16-2010, 08:39 PM
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
01-16-2010, 08:58 PM
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
01-16-2010, 10:52 PM
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
01-16-2010, 11:15 PM
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
01-17-2010, 10:58 PM
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.

ericarseneau
01-18-2010, 09:40 PM
There is a demo program that shows the data being displayed on the Dashboard built in LabVIEW working with Java and the target finding.

Dont hold your breath, but I am in the process of working on a dashboard for Java, have been for over a week, but other things keep coming up :(