View Single Post
  #1   Spotlight this post!  
Unread 06-01-2009, 00:54
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: detecting your own alliance(C++)

Before the match, you have what's called a "constructor" period in the SimpleRobot.cpp template which MIGHT be able to be used to run code in disabled, but my sources haven't tried it yet. If you use the BuiltinDefaultCode.cpp template (iterative template), there's a class for disabled mode. Basically, constructor is the equivalent of Initialize() or IO_Initialization() of the PIC version of WPILib, except I think it runs more than once. Using the disabled mode period, you can run code whenever the robot is disabled, the controller is just introverted; you can read inputs and run code, but you cannot run motors or set outputs until you're enabled.

That being said, that period is the perfect time to figure out where you are and what you're doing with the camera right after the cRIO boots up. With the complexity of the control system this year, there is no reason for your processor to have downtime. You can always be reading a sensor or analyzing visual data to find out where your opponents are and where your alliance members are. That way you know where those robots are already, and can track them when they dart off at the beginning of autonomous and plot a projected course for their trailers to meet very nicely with your moon rocks flying through the air But seriously, do use the camera.
Reply With Quote