Here’s a screen capture of auto code.
As it is supposed to run, shooter starts immediatly.
After 3 second wait, conveyor2 starts.
After 7.5 seconds, conveyor1 starts.
All run until end of Auto.
BUT all turn on at beginning of Auto at the same time.
I know in previous years we could get the time-elapsed for the auto-period and use that to control the operations. Now, ???
The problem is with your usage of the millisecond timer. It has no reference time (i.e. millisecond zero is just an arbitrary point in time). Therefore, you have to measure the change in timer value, which will give you milliseconds elapsed. Try the attached snippet instead.
Autonomous Independent is only called once, when autonomous mode begins, and runs until it’s done (or until it’s aborted by the framework when teleop mode begins). It’s not like Teleop, which gets called every time new data arrives from the Driver Station and needs to finish quickly. If you want to do different things at different times, you’ll have to put the code that reads the time and decides what to do inside a while loop.
But since you’re just doing a sequence of events with delays between them, you can use a Flat Sequence structure very effectively. See the attached code snippet. (You can put it inside a case structure to control whether or not it runs, based on the joystick throttle the way you did it in your code.)
The default gestures in the FRC Kinect Server do not map anything to the X or Z axis, they always return 0. Note that Alan’s point about loops also applies to Kinect code. Your Kinect code must be in a loop to read new values from the Kinect and update motors with them.
Lana? Yeah that is EXACTLY what we were looking at.
Shucks, that’ll take more thinking…thinking always gets me in trouble…
So just put everything in one giant loop w/ a FALSE wired to the Terminator? On second thought, that may be a bad idea… I have bad memories of that angry little doggie…
As long as you have not modified Robot Main, the Autonomous Independent VI will be automatically terminated when the robot changes modes, regardless of whether it is currently “caught” in a loop or not.
yep. The little bars work fine, but the robot won’t reliably read the kinect and sentd that data back to a custom readout, and yes the indicator works properly just like the other 2 windows we have right above it.
I think if the dashboard can finally get the proper data, then the robot auto code will work fine.
Nor is it supposed to. If I recall correctly, the OP wanted something to do with total time elapsed since the start of auto mode (i.e. drive motor A for 7 seconds, then turn it off). The snippet will calculate the total time elapsed since the first iteration (not the time elapsed since the previous iteration, which is what I think you interpreted it to be). Make sense?
However, I probably could have phrased my explanation of the code better. Saying change in timer value probably implied change over one iteration, rather than over total execution. I intended the latter.
By any chance do you have the Driver Station I/O Tab set to Enhanced Mode without the Cypress connected?
That’s a unique case (bug) where the Kinect data will not get sent properly to the robot, but will be seen just fine on the Dashboard Kinect skeleton feedback.
Left and right motors are never set in your auto loop. If you open it, leave the safety enabled, and don’t update it, the RobotDrive will complain and set it to zero.
If you set the left right drive, I predict the error will go away. Other choice is to disable the safety. This is primarily there to make debugging safer and isn’t required by the field. If debugging with it off, the robot should be on blocks since a breakpoint will leave drive motors running.
I couldn’t tell if you had a Kinect issue or not. Please summarize the symptoms.