View Single Post
  #13   Spotlight this post!  
Unread 13-02-2010, 20:34
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Re: absolute minimum for displaying image on dashboard

hmm..I still can't get the camera working. Rather, now I'm getting the 'watch dog not fed' message in the DS. Does anybody have a suggestion? I have set up the camera, my DS is up-to-date, the only thing I havn't done is the recent update of the workbench, but I am sure that is not necessary as that is for the DS LCD.
Here is my code btw:
Code:
#include "WPILib.h"

#include "Vision/AxisCamera2010.h"
#include "Vision/HSLImage.h"
#include "PIDController.h"
#include "Gyro.h"
#include "Target.h"
#include "DashboardDataSender.h"

//#define MINIMUM_SCORE 0.01

/**
 * This is a demo program showing the use of the RobotBase class.
 * The SimpleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 */ 
bool moveState = false;
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick
	Jaguar leftMotors;
	Jaguar rightMotors;
	Compressor *m_com;
	//DashboardDataSender *dds;
	//Gyro *gyro;
	//PIDOutput *pidOutput;

public:
	RobotDemo(void):
		myRobot(3, 4),	// these must be initialized in the same order
		stick(1),		// as they are declared above.
		leftMotors(1),
		rightMotors(2)
	{
		m_com = new Compressor(4,2);
		AxisCamera &camera = AxisCamera::getInstance();
		//dds = new DashboardDataSender();
		//gyro = new Gyro(1);
		//pidOutput = new SamplePIDOutput(myRobot);
		GetWatchdog().SetExpiration(0.1);
		
		
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);
		myRobot.Drive(0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			//myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
			if(stick.GetRawButton(1))
			{
				moveState = 0;
			}
			if(stick.GetRawButton(3))
			{
				moveState = 1;
			}
			if(moveState == false)
			{
				//do nothing
			}
			if(moveState == true)
			{
				leftMotors.Set(-stick.GetY());
				rightMotors.Set(stick.GetZ());
				Wait(0.005);
			}
			
			// Create and set up a camera instance. first wait for the camera to start
					// if the robot was just powered on. This gives the camera time to boot.
					//Wait(10.0);
					//printf("Getting camera instance\n");
			
		}
	}
};

START_ROBOT_CLASS(RobotDemo);
any body see any problems?
Reply With Quote