Go to Post We've done that autonomous. After several years of refinement we decided to skip the information collection and just drive into the wall at the earliest opportunity. - Greg Young [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 21-04-2016, 12:31
Dpurry23's Avatar
Dpurry23 Dpurry23 is offline
Programmer/Control System/Scout
AKA: Darian Purry
FRC #0207 (Metalcrafters)
Team Role: Programmer
 
Join Date: Sep 2013
Rookie Year: 2012
Location: Hawthorne
Posts: 13
Dpurry23 is an unknown quantity at this point
Thumbs down NavX: Trying to rotate to angle without PID

Code:
             double turnDegrees = ahrs->GetYaw();
      
             while(codriver.GetRawButton(12) == 1)
             {
            	 if(turnDegrees > -10 && turnDegrees < 10 && centered == FALSE )
            	 {
            		 myRobot.Drive(0.0, 0.0);
            		 centered = TRUE;

            	 }
            	 else if (turnDegrees < -11 && turnDegrees > -180 && centered == FALSE)
            	 {
            		 myRobot.Drive(0.4, 1.0);
            		 centered = FALSE;
            	 }
            	 else if (turnDegrees > 11 && turnDegrees < 180 && centered == FALSE)
            	 {
            		 myRobot.Drive(-0.4, 1.0);
            		 centered = FALSE;
            	 }
             }
This is code I have come up with so far any suggestions would help.
Thank You!!

Last edited by Dpurry23 : 21-04-2016 at 12:47. Reason: Syntax
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 02:29.

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