View Single Post
  #1   Spotlight this post!  
Unread 25-02-2010, 17:22
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
imaqWriteJPEG, filesystem, and camera issues

last year, our robot saved the axis images to the onboard flash, we then got the images, processed them, and put them in a video. we used the imaqWriteJPEGfile and imaqWritePNGfile functions, and it worked fine. I tried the (almost exact) code in the 2010 Vision demo (modded for ball tracking, http://www.chiefdelphi.com/forums/sh...php?t=81556#14), using WPILib 4.3, cRIO v20 and got nothing. I don't know if it is expected, but leaving fn to "" causes the file name to be truncated after 3 or 4 loops. the output is "i:0 B123t.jpg" (with code as is).
PHP Code:
charfn="1234567890-qwertyusdfghjcvbn";
//char* fn="";
sprintf(fn,"B%dt.jpg\0",d);//d is a loop counter
// get the camera image
ColorImage *image = new ColorImage(IMAQ_IMAGE_RGB);
camera.GetImage(image);
printf("i:%i %s"imaqWriteJPEGFile(image->GetImaqImage(),fn,1000,NULL),fn);
///imaqWritePNGFile2(image->GetImaqImage(),fn,9,NULL,false); 
Also, is there a way to stream and look at the imaq images like labview to help with debugging?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib