View Single Post
  #9   Spotlight this post!  
Unread 06-02-2012, 20:53
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: "Squaring" robot

That code doesn't do what was described.

Let me describe what it does.

It compares and subtracts two range sensors. If the difference is more than 5, it starts a loop that never ends -- the loop termination is guaranteed to be False wired to the Stop terminal. Inside that infinite loop, it sets the steering repeatedly to the same value with a small delay of 1ms. The motor controllers will only update every 5ms (Jags) or 20ms (Vics) by the way.

Equivalent code is something more like this ...

It only sets the value once to either 0.1 and -0.1, the opposite, or in the True frame it sets it to 0 and 0.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-02-06 at 7.48.00 PM.png
Views:	28
Size:	12.8 KB
ID:	11774  
Reply With Quote