View Single Post
  #8   Spotlight this post!  
Unread 20-01-2011, 20:33
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: Vision Processing / Networking Problems

Thanks for your help.

The DS and development computer in this context are one and the same. I can drive the robot, but not FTP it from the same computer.

I am aware that two computers shouldn't have the same IP address, and I know the wired and wireless have different IP's. That's what I was trying to convey with "I've double checked on all the computers to make sure no adapter has that IP set". I've tried combinations of .5, .6, .21, and several other random ones that I can't remember since they were simply high random ones that I was pretty sure weren't in use.

The networking problems seems to be working itself out though. I'm not sure why, but I'm not exactly complaining. However, the vision's gotten worse. I can get it to send pictures back (which is what I'm trying to do), but as soon as I try to drive the motors, the camera goes out.

Code:
#include "WPILib.h"
#include "Vision/AxisCamera.h"
#include "Vision/PCVideoServer.h"
#include "Vision/AxisCameraParams.h"


/**
 * 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.
 */ 
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick

public:

	RobotDemo(void):
		myRobot((new Victor(1)), (new Victor(2))),	// these must be initialized in the same order
		stick(1)		// as they are declared above.
	{
		//myRobot.SetExpiration(1);
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		//myRobot.SetSafetyEnabled(true);
		AxisCamera& camera = AxisCamera::GetInstance();
		printf("Setting camera parameters\n");
		camera.WriteResolution(AxisCamera::kResolution_160x120);	
		camera.WriteCompression(20);
		camera.WriteBrightness(0);
		camera.WriteMaxFPS(5);
		
		Wait(3.0);
		while (IsOperatorControl())
		{
			printf("Teleop");
			myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
			Wait(0.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);
This fails with the myRobot.SetExpiration(1); and myRobot.SetSafetyEnabled(true); commented out or not. I wasn't sure what they did, so I tried both. I can't find them in the code. Thanks again, this is really frustrating me.

Edit: Forgot to mention. We opened up the target console in windriver and looked at the processes. When the camera gets knocked out, the "FRC_PCVide>" task gets an error number of 3d0004 if that helps.

Last edited by CodeMonkeyMatt : 20-01-2011 at 20:49.
Reply With Quote