View Single Post
  #5   Spotlight this post!  
Unread 09-02-2009, 16:30
3DWolf's Avatar
3DWolf 3DWolf is offline
Boots - Head Programmer / 3D
AKA: Jake
FRC #1502 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Dec 2006
Rookie Year: 2005
Location: Chelsea Michigan
Posts: 97
3DWolf is on a distinguished road
Send a message via AIM to 3DWolf Send a message via MSN to 3DWolf
Re: Picture Snapshots

Quote:
Originally Posted by byteit101 View Post
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...
__________________
You can call it the programming teams fault, but we'll just force your arguments nil.

There are 10 kinds of people in the world -> Those who understand binary and those who don't.

WYSIWYG - In FIRST: Greatness

Last edited by 3DWolf : 09-02-2009 at 16:33.