Go to Post Maybe someone should start a FIRST Anonymous meeting to try to help the tragicly addicted... - BiTurboS4 [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 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
  #2   Spotlight this post!  
Unread 08-02-2015, 16:10
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Help! Gyro Not Helping With Strafing!!

Given that you reset the gyro immediately before using it, I'm not sure how this code could have worked.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2015, 16:24
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: Help! Gyro Not Helping With Strafing!!

Seems you are creating a 30 degree deadzone in each straight direction-- if the degrees are on 90 +/- 30? Then you use 0, +90 or -90 depending on which branch you go through. But then you negate it before sending it to direction-- this seems odd to me. Like it would go left when you push right and never be able to go backwards.

Or I overlooked something.

Last edited by cstelter : 08-02-2015 at 16:27.
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 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