Go to Post As long as they're not destroying each other, LET THE TEAMS PLAY! - Travis Hoffman [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 08-02-2015, 15:45
Arbalest007 Arbalest007 is offline
Registered User
FRC #2496
 
Join Date: Sep 2014
Location: Irvine, California
Posts: 19
Arbalest007 is an unknown quantity at this point
Help! Gyro Not Helping With Strafing!!

Hi everyone. So our team tested this method on the practice bot with mecanum wheels to see if it would allow the bot to strafe perfectly straight during teleop in order to minimize driver error when strafing.

//This method is called during TeleopPeriodic()
public void driveStraight() {
while(stick.getRawButton(1)) {
double stickDegrees = 0;

if(Math.abs(stick.getDirectionDegrees() % 90) < 30 || Math.abs(stick.getDirectionDegrees() % 90 > 60) {
if(Math.abs(stick.getDirectionDegrees() > 60 && Math.abs(stick.getDirectionDegrees()) < 120) {
if(stick.getDirectionDegrees < 0)
stickDegrees = -90.0;
else
stickDegrees = 90.0;
}
}

gyro.reset();
wholeDrive.mecanumDrive_Polar(stick.getMagnitude() , -stickDegrees, -gyro.getAngle() * .05);
}

This code used to let our practice bot strafe perfectly (The robot would kinda curve back and forth to correct itself to still strafe straight). However, on our competition bot the robot strafes and then starts to curve inwards and I'm not sure what is going on....
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 11:42.

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