Go to Post "So Ken Patton, Paul Copioli, and John V-Neun walk into a bar..." - JVN [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

 
Reply
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 19-02-2010, 15:02
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: No camera feed

do you have v20 on the cRIO?
do you have WPILib 4.3?
did you run the Camera config tool?
are you using a crossover cable from port 2 on the cRIO to the cam?
is the camera's status ring green?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2010, 17:20
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
Re: No camera feed

Yes to all of your questions.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2010, 18:30
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: No camera feed

are there any firewalls on the network or computer?
did you update the dashboard to 1.1?
do you have the local dashboard option checked under setup?
have you tried installing dashboard update 1.1 on a different computer with remote dashboard selected under Driverstation setup, and correct IP?
try this code:
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
	AxisCamera &cam;
public:
	RobotDemo():cam(AxisCamera::GetInstance())
	{
		
	}

	void Autonomous()
	{
		
	}

	void Operator Control()
	{
	
	}
};
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2010, 20:15
misko misko is offline
Registered User
FRC #0852
 
Join Date: Dec 2009
Location: California
Posts: 22
misko is an unknown quantity at this point
Re: No camera feed

What accounts are configured on your camera, and what permissions for each account? i.e. in Setup on the camera, select Users, what is the output?
Do you have a user FRC?
Reply With Quote
Reply


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 03:23.

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