View Single Post
  #6   Spotlight this post!  
Unread 04-02-2015, 00:57
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is online now
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,037
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: How goes the build?

Quote:
Originally Posted by AustinH View Post
The problem comes when we attempt to use a PID loop to hold the robot at 180° relative to the field. Normal joystick rotation works just fine.
Which language are you using?

A simple solution for this specific case would be to use the following logic:
if(angle < 0)
adjusted angle = angle + 360
else
adjusted angle = angle

Then, use adjusted angle wherever you would have used angle in the rest of the code. To get it to work for the more general case, you have to be a little more creative, but you can use this same idea.
Reply With Quote