Go to Post I can attest that mentoring is probably the most important aspect of this program. - Tom Bottiglieri [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 02-13-2013, 02:46 PM
MoMo MoMo is offline
Registered User
FRC #1721
 
Join Date: Jan 2013
Location: Concord, NH
Posts: 18
MoMo will become famous soon enoughMoMo will become famous soon enough
Deadband Help

Hello we have a working mecanum code but we need to add dead band for a little better control. can any one help?
Code:
#include "WPILib.h"

// Team 1721 mecanum code 2013 By: Zakary Tobine at 2/11/13 10:33am

// Needs to add 2 relays; one for motor for shooter; one for frishbee pusher 



class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick

public:
	RobotDemo(void):
		myRobot(1, 2, 3, 4),	// these must be initialized in the same order
		stick(1)		// as they are declared above.
	{
		
		
		stick.SetAxisChannel(Joystick::kTwistAxis, 3);// Add the 3rd axis 
		myRobot.SetExpiration(0.1);// The time the motors stop moving after a value is sent  
	}

	
	void Autonomous(void)
	{
		// Commented out till a later date 
		
		//myRobot.SetSafetyEnabled(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 one joystick mecanum. 
	 */
	void OperatorControl(void)
	{
		myRobot.SetSafetyEnabled(true);
		while (IsOperatorControl())
		{
		myRobot.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetTwist());// Mecanum drive single joystick drive 
			
		
		
		
		Wait(0.005);				// wait for a motor update time
		}
	}
	
	/**
	 * Runs during test mode
	 */
	void Test() {

	}
};

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 09:29 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