Go to Post *referring to Team Titanium's 2012 robot* If only it could play guitar hero at the same time. sigh. - rsisk [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping a function Tz0m Programming 14 20-02-2007 11:22
Scoring function in C mgreene Programming 7 12-01-2007 02:36
Arcade Function gabrielse Programming 1 08-02-2006 00:49
Limit_Mix() Function EricWilliams Programming 2 27-07-2005 23:19
FreeLibrary() Function Raven_Writer Programming 0 09-08-2003 15:39


All times are GMT -5. The time now is 13:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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