Go to Post In an education culture that hinges on having the perfect grades and perfect SAT scores to get into the perfect colleges, I enjoy providing an environment where students are encouraged to test their own hypothesis, challenge their assumptions, and regularly fail. - Michael Corsetto [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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
  #3   Spotlight this post!  
Unread 09-02-2013, 11:28
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,752
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: Robot "twitching?"

The problem is that Fire has a number of large delays.

If the safety feature is active and the motors aren't updated by that deadline, the motors will be set to speed zero. This is primarily to keep the robot safer when you hit a breakpoint in the code or get into an infinite loop, etc.

The other reason you don't really want large delays in teleop is that it will cause the code to ignore the joystick for several seconds. Depending on what the robot and driver are doing at the time, this could be fine. In that rare case, simply turn off the safety config in Begin. Typically, the better solution is to move the delayed code out of teleop and run it in parallel, or make it into a state machine that performs the operations a little at a time over a number of teleop calls.

Both of these are valid approaches, but the easier of the two is probably to take the Safety code and place it into a loop in Periodic Tasks. Have the periodic loop read a global that tells it to fire, and in teleop, set the global instead of calling the function. Be sure to reset the global. You can also look at using a notifier if you feel up to it.

Greg McKaskle
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 22:51.

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