Go to Post Uncle Sam wants you to watch NERD Vision. - artdutra04 [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
  #5   Spotlight this post!  
Unread 29-02-2012, 14:33
Unforgiven_Hero Unforgiven_Hero is offline
Registered User
FRC #1989
 
Join Date: Feb 2012
Location: Vernon
Posts: 11
Unforgiven_Hero is an unknown quantity at this point
Re: Programming Mecanum Wheels - 4 Victors

Okay so here is where I stand, don't have a chance to test it on the practice bot today but will tomorrow. Anyone got any advice on the program and is there anything essential I should add or do to this program? Not totally sure how to do the twist part for the Mecanum wheels using an Attack3 joystick...

Here it is:

Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
	RobotDrive *drive;
	
	Victor *leftFrontMotor;
	Victor *leftRearMotor;
	Victor *rightFrontMotor;
	Victor *rightRearMotor;
	
	Joystick *Attack1;
	Joystick *Attack2;
	
public:
	RobotDemo(void)
	{		
		drive = new RobotDrive(leftFrontMotor,leftRearMotor,rightFrontMotor,rightRearMotor);	
		Attack1 = new Joystick(1);		
		Attack2 = new Joystick(2);
		GetWatchdog().SetExpiration(0.1); 
		drive->SetExpiration(0.1);
	}
	void Autonomous(void)
	{
	}
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		drive->SetSafetyEnabled(true);
		while (IsOperatorControl())
		{
			drive->MecanumDrive_Cartesian(Attack1->GetX(),Attack1->GetY(),Attack2->GetTwist());
			Wait(0.005);				
		}
	}
};

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


All times are GMT -5. The time now is 17:41.

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