View Single Post
  #1   Spotlight this post!  
Unread 15-01-2009, 09:31
levp92 levp92 is offline
Registered User
FRC #3089
 
Join Date: Jan 2009
Location: Haifa, Israel
Posts: 3
levp92 is an unknown quantity at this point
IsAutonomous() function

When i'm trying to run this code the program it's working:
Code:
#include <iostream.h>
#include "math.h"

#include "AxisCamera.h" 
#include "BaeUtilities.h"
#include "FrcError.h"
#include "TrackAPI.h" 
#include "WPILib.h"

class robot1 : public IterativeRobot
{
public:
	
	TrackingThreshold td;
	ParticleAnalysisReport par;
	ColorReport cReport;
	robot1(void)
	{
		td = GetTrackingData(RED, FLUORESCENT);
		printf("auto5\n");
		if (StartCameraTask(20, 0, k160x120, ROT_0) == -1) {
			printf("Failed to spawn camera task; exiting. Error code %s\n",
					GetVisionErrorText(GetLastVisionError()) );
		}
		printf("auto5\n");
		
	}
	
	
	void AutonomousContinuous(void){
			IsAutonomous();
			if ( FindColor(IMAQ_HSL, &td.hue, &td.saturation, &td.luminance, &par, &cReport) ){
				printf ("**  found: Servo: x: %f  y: %f \n", par.center_mass_x_normalized,	par.center_mass_y_normalized);	 
						
						}
		
		}
};

START_ROBOT_CLASS(robot1);
but if I run this code the program it's working:
Code:
#include <iostream.h>
#include "math.h"

#include "AxisCamera.h" 
#include "BaeUtilities.h"
#include "FrcError.h"
#include "TrackAPI.h" 
#include "WPILib.h"

class robot1 : public IterativeRobot
{
public:
	
	TrackingThreshold td;
	ParticleAnalysisReport par;
	ColorReport cReport;
	robot1(void)
	{
		td = GetTrackingData(RED, FLUORESCENT);
		printf("auto5\n");
		if (StartCameraTask(20, 0, k160x120, ROT_0) == -1) {
			printf("Failed to spawn camera task; exiting. Error code %s\n",
					GetVisionErrorText(GetLastVisionError()) );
		}
		printf("auto5\n");
		
	}
	
	
	void AutonomousContinuous(void){
			
			if ( FindColor(IMAQ_HSL, &td.hue, &td.saturation, &td.luminance, &par, &cReport) ){
				printf ("**  found: Servo: x: %f  y: %f \n", par.center_mass_x_normalized,	par.center_mass_y_normalized);	 
						
						}
		
		}
};

START_ROBOT_CLASS(robot1);
can somebody please explain me why?
Reply With Quote