Go to Post Remember this: A true leader needs no title to make a difference. - Molten [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 18-02-2010, 20:14
nekng's Avatar
nekng nekng is offline
Former 1836 Captain
AKA: Nate
FRC #1836 (MilkenKnights)
Team Role: Alumni
 
Join Date: Aug 2006
Rookie Year: 2007
Location: Los Angeles
Posts: 43
nekng is on a distinguished road
No camera feed

I have spent some time trying to get the camera feed to the netbook to work. I have tried the 2010ImageDemo example code as well as my own code (see below). I am fairly sure that the camera is set up correctly because it worked last year, I can access it from it's web interface and I can successfully run the camera set up tool when I plug the camera into the classmate netbook. Does any one have any ideas as to what we need to do to make it work?
Code:
#include "WPILib.h"
#include "Target.h"
#include "DashboardDataSender.h"
/**
 *2010 code
 */ 
class RobotDemo : public SimpleRobot
{
	Joystick leftStick; 
	Joystick rightStick;
	Victor right1;
	Victor right2;
	Victor left1;
	Victor left2;
	Victor bigmotor;
	Victor babymotor;
	int loop;
	DashboardDataSender *dds;

public:
	RobotDemo():

		leftStick(1),
		rightStick(2),
		right1(2),
		right2(1),
		left1(4),
		left2(3),
		bigmotor(5),
		babymotor(6),
		loop(0)
	{
		dds = new DashboardDataSender();
		GetWatchdog().SetExpiration(0.1);
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(true);
		GetWatchdog().SetExpiration(1.0);
	}

	/**
	 * Runs the motors with tank steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		// 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.
				printf("Getting camera instance\n");
				AxisCamera &camera = AxisCamera::GetInstance();
				printf("Setting camera parameters\n");
				camera.WriteResolution(AxisCamera::kResolution_320x240);
				camera.WriteCompression(20);
				camera.WriteBrightness(0);

		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			GetWatchdog().SetExpiration(1.0);
	
	//		HSLImage *image = camera.GetImage();
			right1.Set(rightStick.GetY());
			right2.Set(rightStick.GetY());
			left1.Set(-leftStick.GetY());
			left2.Set(-leftStick.GetY());  
			
			if (leftStick.GetRawButton(1)==1)
						{
							bigmotor.Set(1.0);
						}
						else 
						{
							bigmotor.Set(0.0);
						}
						if (rightStick.GetRawButton(1)==1)
						{
							babymotor.Set(0.3);				
						}
						else 
						{
			               babymotor.Set(0.0);
						}
			

			loop++;
			printf("Loop: %d", loop);
			dds->sendIOPortData();
			Wait(.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);
__________________
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
Issues with Classmate Camera Feed eovnu87435ds Programming 17 12-02-2010 22:29
2010 FRC Camera Live Feed Lag ideasrule Programming 23 11-02-2010 02:33
Still no camera feed cappielloa Programming 15 26-01-2010 21:54
Live Feed with Axis Camera CHSboy Programming 6 24-03-2009 14:43
Drivers' Station Camera Feed dhawk085 Technical Discussion 4 25-01-2009 19:12


All times are GMT -5. The time now is 18:06.

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