View Single Post
  #6   Spotlight this post!  
Unread 19-03-2010, 17:26
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Code Inefficient?

I would think that your code is the opposite of bloated, it is quite lightweight as a matter of fact.

We use the iterative robot template which I strongly recommend you do. This allows you to do away with the while loop because teleopperiodic is called automatically each robot cycle. In very simple terms, the periodic robot methods are called, then data packets are sent/received, then the periodic method is called again. I am guessing that your while loop is whipping around too often before a packet is sent and the code is getting confused. I do see a delay in your DualShock class that gets called once an iteration, but I think even that is too quick. You aren't seeing these issues in auto, since each command is called a single time and the system is able to process them within cycle times.

If that makes any sense. I am in the middle of a conference right now, so I can't give any more details.
__________________
I don't need a signature.
Reply With Quote