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?