Go to Post To borrow a slogan from the last place KC Royals "It's Our Time" The curse will be broken! ;) - Alpha Beta [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-02-2011, 15:08
RoboElite640 RoboElite640 is offline
Registered User
FRC #0640
 
Join Date: Nov 2010
Location: NY
Posts: 36
RoboElite640 is an unknown quantity at this point
robotDrive.drive help?

So we had the program work so that if (stickRight.getRawButton(1) == true)
{robotDrive.drive(1.0,0.0); }
if (stickLeft.getRawButton(1) == true)_
{robotDrive.drive(0.2,0.0); }

but when we try this it works partially. When we push button 1 on stickRight, it moves faster but only one motor moves faster. Vice versa with button 1 on stickLeft, only one motor moves slow. Any help?
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2011, 16:28
xinchi.he's Avatar
xinchi.he xinchi.he is offline
Registered User
AKA: Xinchi He
FRC #1209
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Tulsa,OK
Posts: 9
xinchi.he is an unknown quantity at this point
Send a message via MSN to xinchi.he
Re: robotDrive.drive help?

try robotDrive.arcadeDrive(speed,turn);
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2011, 21:10
RoboElite640 RoboElite640 is offline
Registered User
FRC #0640
 
Join Date: Nov 2010
Location: NY
Posts: 36
RoboElite640 is an unknown quantity at this point
Re: robotDrive.drive help?

well, i didnt get a chance to try that, but essentially I'm trying to have it set up so that when i press one button the robot will drive faster. And if i press another button the robot will drive slower.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-02-2011, 10:07
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: robotDrive.drive help?

Quote:
Originally Posted by RoboElite640 View Post
well, i didnt get a chance to try that, but essentially I'm trying to have it set up so that when i press one button the robot will drive faster. And if i press another button the robot will drive slower.
Ah, okay. What you're doing in the code above is basically autonomous. It'll just drive instead of powering the motors to a set limit.

I'd recommend having your program use Jaguar objects in your Drive train instead of integers (assuming you are using int's)

Once you do this you should be able to limit it in teleop.
Code:
RobotDrive drive = new RobotDrive(leftMotor, rightMotor);

if(leftMotor.get() >= 0.5) {
    leftMotor.set(0.5);
} else if(rightMotor.get() >= 0.5) {
    rightMotor.set(0.5);
}

// then call your drive methods and it'll limit the max speed to 0.5
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2011, 11:19
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: robotDrive.drive help?

Quote:
Originally Posted by RoboElite640 View Post
So we had the program work so that if (stickRight.getRawButton(1) == true)
{robotDrive.drive(1.0,0.0); }
if (stickLeft.getRawButton(1) == true)_
{robotDrive.drive(0.2,0.0); }

but when we try this it works partially. When we push button 1 on stickRight, it moves faster but only one motor moves faster. Vice versa with button 1 on stickLeft, only one motor moves slow. Any help?
The other advice given has been good but don't address directly your statement that only one motor works in each case. The 'if' control statements shouldn't affect the .drive that way regardless of your reason for wantign to do it. What does your RobotDrive constructor call look like?
Reply With Quote
Reply


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 00:40.

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