Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Picture Snapshots (http://www.chiefdelphi.com/forums/showthread.php?t=73737)

3DWolf 06-02-2009 13:01

Picture Snapshots
 
So I have found that you can in fact take pictures with your camera then save them onto the cRIO's solid-state memory, then retrieve them with FTP; but my team mates and I were wondering if you could skip that last step. Is there anyway you could have an interface that would accept a thumb drive (standard USB2.0 connection) on or connected to your cRIO that your code could download the images directly too, kind of like mirroring them over, so you could just unplug the thumb drive after matches and throw it in your laptop for quick viewing, that way you don't have to bother with the FTP.

Greg McKaskle 06-02-2009 14:42

Re: Picture Snapshots
 
Since your cRIO will often connect to a computer in the pits, you can pretty easily automate the ftp to grab files and store them on your PC, mem stick, iPod, or wherever you like. If you want to do this in LV, try googling for free ftp VIs. I was surprised I couldn't find them in the palettes. Of course you can write this script in anything you like that lets you access an ftp server.

Greg McKaskle

3DWolf 09-02-2009 16:21

Re: Picture Snapshots
 
OK so I had my buddy write me an autograbber (just for ease, if anyone wants a copy I'll be happy to supply you with it) that you enter in the file names you want as well as the servo info and it will quickly grab all the files in the config file automatically.

My next question is, where can I find the FTP info to actually nab the files from the cRIO? Is there an FTP server setup already on the cRIO or do we have to set one up ourselves?

byteit101 09-02-2009 16:27

Re: Picture Snapshots
 
Quote:

Originally Posted by 3DWolf (Post 817393)
OK so I had my buddy write me an autograbber (just for ease, if anyone wants a copy I'll be happy to supply you with it) that you enter in the file names you want as well as the servo info and it will quickly grab all the files in the config file automatically.

My next question is, where can I find the FTP info to actually nab the files from the cRIO? Is there an FTP server setup already on the cRIO or do we have to set one up ourselves?

ftp://10.15.2.2/
how do you save the images to the cRIO?

3DWolf 09-02-2009 16:30

Re: Picture Snapshots
 
Quote:

Originally Posted by byteit101 (Post 817394)
ftp://10.15.2.2/
how do you save the images to the cRIO?

I'm not sure how someone using LV would do it, but I found some code in I think the DefaultCamera example for WR that had functions to adjust camera settings and to take snapshots.
Here is just the snapshot function, not entirely sure what includes it needs however.
Code:

        /**
        * Store an image on the cRIO
        * @param imageName stored on home directory of cRIO ( "/" )
        **/
        void snapshot(char* imageName)       
        {
                /* this will take one picture and save it to a file
                */
                DPRINTF(LOG_DEBUG, "taking a SNAPSHOT ");
                Image* cameraImage = frcCreateImage(IMAQ_IMAGE_HSL);
                if (!cameraImage) {
                        dprintf (LOG_INFO,"frcCreateImage failed - errorcode %i",GetLastVisionError());
                }
                Wait(1.0);
                if ( !GetImage (cameraImage,NULL) ) {
                          dprintf (LOG_INFO,"\nCamera Acquisition failed %i", GetLastVisionError());
                } else {
                          if (!frcWriteImage(cameraImage, imageName) ) {
                                        dprintf (LOG_INFO,"frcWriteImage failed - errorcode %i",GetLastVisionError());
                          } else {
                                          dprintf (LOG_INFO,"\n>>>>> Saved image to %s", imageName);       
                                        // always dispose of image objects when done
                                        frcDispose(cameraImage);
                          }
                }
        }

I just tried FTPing to the cRIO with ftp://10.15.2.2/ with FileZilla and I got the following errors
Code:

Status:        Connecting to 10.15.2.2:20...
Status:        Connection attempt failed with "ECONNREFUSED - Connection refused by server".
Error:        Could not connect to server
Status:        Waiting to retry...


wt200999 09-02-2009 18:01

Re: Picture Snapshots
 
try ftp://10.15.02.2/ (assuming your team 1502)

3DWolf 10-02-2009 15:14

Re: Picture Snapshots
 
Quote:

Originally Posted by wt200999 (Post 817444)
try ftp://10.15.02.2/ (assuming your team 1502)

Is there any extra username/password data I need? I tried connecting with just that FTP IP and it was refusing connection - do I have to use a crossover cable directly from the cRIO to the laptop?

wt200999 10-02-2009 20:14

Re: Picture Snapshots
 
If you can download code to it you should be able to ftp to it through a web browser (you use ftp to load code on it in the first place)
Just make sure your robot is configured correctly and everything (it should be)


All times are GMT -5. The time now is 02:25.

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