Go to Post Teams should make it a practice to protect their Victors (all the electronics, really) from the mechanical folks, with their saws and files and stone axes... - DonRotolo [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 01-14-2012, 03:20 PM
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Cannot drive more than 3 jaguars at once

We're having issues getting our 2011 robot to run.

We've got our digital sidecar in slot 2, as the instructions say.

If we use the SimpleTemplate sample, it will drive the Jaguars on PWM 1 and 2 (green lights and the motors turn).

If we modify the SimpleTemplate sample to drive PWMs 3 and 4, it will happily drive those motors (green lights and the motors turn).

If we modify the SimpleTemplate sample to use the RobotDrive constructor that takes PWMs 1, 2, 3, and 4 (as our 2011 robot used 4 drive motors), it fails to send signals to any Jaguar - they give us a slow orange blink.

If we remove the RobotDrive class and manually declare Jaguars attached to various PWMs, it will only work if we use 3 or fewer Jaguars. As soon as we construct the 4th Jaguar (whether or not we call the Set() function on it), the program fails to send a signal to the Jaguars.

To summarize:
-All 4 Jaguars have power and PWMs going to them - we can successfully drive any of them if we set our program to use those PWMs.
-As soon as we attempt to use 4 motors, whether via RobotDrive or via Jaguar class instances, it fails.
-We get no error messages in the console
-If we put a printf in the main operator control loop, it gets called continuously, indicating that the loop is running properly.

I noticed some "syncgroup" parameters in the Jaguar class header that default to 0 - is there something we're supposed to do with that?

Here's the 4-Jaguar code that fails - can someone try it on their robot and confirm whether it works or not?
Code:
#include "WPILib.h"

class RobotDemo : public SimpleRobot
{
	Joystick stick; // only joystick

	Jaguar frontRight;
	Jaguar backRight;
	Jaguar frontLeft;
	Jaguar backLeft;
public:
	RobotDemo(void):
		frontRight(1),
		backRight(2),
		frontLeft(3),
		backLeft(4),
		stick(1)		// as they are declared above.
	{
	}

	void Autonomous(void)
	{
	}

	void OperatorControl(void)
	{
		while (IsOperatorControl())
		{
			frontLeft.Set(0.3);
			frontRight.Set(0.3);
			backLeft.Set(0.3);
			backRight.Set(0.3);
			
			Wait(0.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);

Last edited by Bongle : 01-14-2012 at 03:24 PM.
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


All times are GMT -5. The time now is 09:59 AM.

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