Windriver downloading code problems.

What i’ve done so far:
Installed WorkbenchUpdateV1.2.1562.exe
Updated cRIO image to FRC_2009_V7.ZIP using the labview image tool with FRCNIWRUpdate2.0.zip

I undeploy the code then clicked on download. (The download is linked to the .out compiled code that is made after your build the default program).

but i get no response from the jaguer motor controllers.

Is using the FRC Simple Robot Program sufficient for testing at least arcade drive? Nothing seem to be responding.
It feels like i have code on there but nothing responds.

When i debug the code it doesn’t work either and received exception errors after a while.

Anyone have any idea what i have done wrong? I’ve been hacking at this for a week now and can’t figure this out.

EDIT: Some other team believes that our windriver is downloading suspiciously quickly onto the robot (2.5seconds).
Should it matter if Windriver and Labview are installed on the same computer?

I can confirm that our download is definitely that fast and works fine. If you could post the relevant code we might be able to help you more, but assuming its not code I would suggest re-imaging once again, making sure you set it to expect the right environment, and testing again.

We have just been using the template code, but i’ll go ahead and post a copy here:

#include “WPILib.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(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
GetWatchdog().SetExpiration(100);
}

/**

  • 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)
    }
    }
    };

START_ROBOT_CLASS(RobotDemo);

However, we have also tried and in-progress version of our modified code:

#include “WPILib.h”
#include “AxisCamera.h”

#define JAGUAR_PORT_LEFT 9
#define JAGUAR_PORT_RIGHT 10
#define JOYSTICK_PORT_LEFT 1
#define JOYSTICK_PORT_RIGHT 2
#define ACCEL_PORT_LEFT 3
#define ACCEL_PORT_RIGHT 4
#define COMPRESSOR_PORT 5
#define RELAY_PORT 6
#define SOLENOID_PORT_UP 7
#define SOLENOID_PORT_DOWN 8
#define TRACTION_CONTROL .5
#define VICTOR_PORT_LEFT 9
#define VICTOR_PORT_RIGHT 10

class RobotDemo : public SimpleRobot
{
RobotDrive *myRobot; // robot drive system pointer
Joystick *stickLeft; // Joystick 1 (Left Stick) pointer
Joystick *stickRight; // Joystick 2 (Right Stick) pointer
DriverStation *ds; // create a driver station pointer;
Accelerometer *accLeft; //create the left accelerometer pointer
Accelerometer *accRight; //create the right accelerometer pointer
Compressor *comp; // Create the compressor pointer
Relay *compSpike; //create the pointer for the compressor spike
Solenoid *noidUp; //create the first solenoid
Solenoid *noidDown; //create the second solenoid
Jaguar *motorControllerLeft; //create the motor controllers
Jaguar *motorControllerRight;
Victor *intakeRollerLeft; //intake motors
Victor *intakeRollerRight;

float CurrentAccLeft; //thar be some temp vars
float CurrentAccRight;
int tractionControl;
int holdButton;

void TankDriveFunction(float accL,float accr);
void UpdateAccel(float &accL,float &accR);
void BasketInput(Joystick *Lstick, Joystick *Rstick);
void TractionControl(Joystick *Lstick);
void IntakeControl();

public:
RobotDemo(void) //Constructor Function
{
//!!Important!! All of the numbers being used in the functions are completely arbitrary
// Change them eventually!

  ds = DriverStation::GetInstance();	// attach the pointer to the driverstation
  myRobot = new RobotDrive(1, 2); 	// create robot drive base
  stickLeft = new Joystick(JOYSTICK_PORT_LEFT); 			// create the joysticks
  stickRight = new Joystick(JOYSTICK_PORT_RIGHT); 
  GetWatchdog().SetExpiration(100);	//Need to feed the watchdog ever 100 milliseconds
  accLeft = new Accelerometer(ACCEL_PORT_LEFT);		//attach the left and right accelerometers
  accRight = new Accelerometer(ACCEL_PORT_RIGHT);
  comp = new Compressor(COMPRESSOR_PORT, RELAY_PORT);			//attach the compressor pointer to the compressor
  compSpike = new Relay (RELAY_PORT);			//attach the compressor spike pointer
  noidUp = new Solenoid(SOLENOID_PORT_UP); 				//attach the solenoid pointers
  noidDown = new Solenoid(SOLENOID_PORT_DOWN);
  motorControllerLeft = new Jaguar(JAGUAR_PORT_LEFT); //attach motor controllers
  motorControllerRight = new Jaguar(JAGUAR_PORT_RIGHT);
  intakeRollerLeft = new Victor(VICTOR_PORT_LEFT);
  intakeRollerRight = new Victor(VICTOR_PORT_RIGHT);
  holdButton = 0;

}

void Autonomous(void) //Autonomous Function
{
//We’ll wait and do autonomous when we have a robot.
}

void OperatorControl(void) //Tele-Op Function
{
while (IsOperatorControl()) //While in Tele-Op mode, run.
{
GetWatchdog().Feed(); //Feed that @#@#@#@# watchdog.

  	TractionControl(stickLeft); //toggle traction control
  	UpdateAccel(CurrentAccLeft, CurrentAccRight);	//Update the accelerometers
  	TankDriveFunction(CurrentAccLeft, CurrentAccRight);	//go go Go Go GO GOOOOOO!
  	BasketInput(stickLeft, stickRight);	//move the basket
  	IntakeControl();
  	
  } 

}
};
void RobotDemo::TankDriveFunction(float accL,float accR)
{
if (tractionControl)
{
if (accL > .06 || accR > .06) //If the acceleration isn’t too great…
{
motorControllerRight->Set(TRACTION_CONTROL);
motorControllerLeft->Set(TRACTION_CONTROL);
return;
}
}
else
{
motorControllerLeft->Set(stickRight->GetThrottle());
motorControllerRight->Set(stickLeft->GetThrottle());
}
}

void RobotDemo::UpdateAccel(float &accL,float &accR)
{
accL = accLeft->GetAcceleration(); //check the current acceleration of the left side
accR = accRight->GetAcceleration(); //check the right side
}

void RobotDemo::BasketInput(Joystick *Lstick, Joystick *Rstick)
{
if (Lstick->GetRawButton(2)) //The basket goes down
{
noidUp->Set(false);
noidDown->Set(true);
}
else if (Rstick->GetRawButton(3)) //The basket goes up
{
noidDown->Set(false);
noidUp->Set(true);
}
}

void RobotDemo::TractionControl(Joystick *Lstick)
{
if (Lstick->GetRawButton(4)) tractionControl = 0;
else if (Lstick->GetRawButton(5)) tractionControl = 1;
}

void RobotDemo::IntakeControl()
{

if (stickLeft->GetRawButton(7))
{
intakeRollerLeft->Set(-1.0);
intakeRollerRight->Set(-1.0);
}
else
{
if(stickLeft->GetRawButton(6))
{
if(holdButton!=1)
{
if (intakeRollerLeft->Get())
{
intakeRollerLeft->Set(0);
intakeRollerRight->Set(0);
holdButton = 1;
}
else
{
intakeRollerLeft->Set(1.0);
intakeRollerRight->Set(1.0);
holdButton = 1;
}
}
}
else
{
intakeRollerLeft->Set(0);
intakeRollerRight->Set(0);
holdButton = 0;
}
}
}

START_ROBOT_CLASS(RobotDemo);

any and all help/comments are appreciated!

Hydra Robotics
Team #2425

You seem to have the same problem as us. We weren’t even sure if the code we were downloading, SimpleRobot, was even running even though it said it downloaded. However, I think I finally figured out how this system works. If you are downloading the code to ram, then make sure that there is no currently deployed code by undeploying in the first menu. What lead me to this conclusion is that after figuring out how to enable target console, whenever I tried to download and run a program in ram, it said Default code already running or something like that. After undeploying, I no longer got that error and my printf’s in the constructor said something. Yay! so try seeing if it’s running first of all. Only today did I finally get some code running (printf’s) and figuring out exactly how it executes code in Autonomous and Operator how the watchdog works… I’ve yet to figure out how to do digital io’s, motors, dashboard, and if possible driver station lcd. What I’ve learned though, if it’s not working, restart the cRio. It’s hard to say technically what’s the problem but the console output can usually give a lead on problems.
Anyways This is my modified version of the SimpleRobot just to see if anything is running. Open up the target console(make sure Console Out dipswitch is on and default settings for the target console should work) by right clicking on the vxworks>target tools. After building and downloading the program, you should see the printfs when the program starts and when the operator/autonomous switch is toggled.

#include "WPILib.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
{
	/* Template stuff
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick
	*/
	
public:
	RobotDemo(void)
		/* Template stuff
		myRobot(1, 2),	// these must be initialized in the same order
		stick(1)		// as they are declared above.
		*/
	{
		GetWatchdog().SetExpiration(100);
		printf("Justin:WTF DO YOU WORK
");
		printf("FFS
");
		printf("cRio: Why yes, I do in fact work
");
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		printf("Im in your autonomous, running your codez
");
		GetWatchdog().SetEnabled(false);
		
		while (IsAutonomous())
		{
			
		}
		//haha, infinite loop!
		//while(1)
		//	printf("NOOOOO");
		
		/* Template stuff
		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)
	{
		printf("All crews reporting.  Make it happen
");
		
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			/* Template stuff
			myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
			*/
		}
	}
};

START_ROBOT_CLASS(RobotDemo);


Your code should download quickly; it is transferring through FTP just a .out file.

There is a common problem where code that is deployed to the robot will prevent debug code from executing properly. Whenever the cRIO is reimaged, a sample program is deployed. You must undeploy it before debugging your new program. That is likewise true if you deployed your own program and are now debugging a new version of the code. First undeploy, do your debugging, then deploy whatever version you want to use on power-on.

There will be messages on the console that say if there is a conflict when running code if you happen to have the console open.