![]() |
Auto Code NOT Running (as expected)
1 Attachment(s)
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. :confused: I know in previous years we could get the time-elapsed for the auto-period and use that to control the operations. Now, ???? |
Re: Auto Code NOT Running (as expected)
1 Attachment(s)
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.
|
Re: Auto Code NOT Running (as expected)
That would likely do the trick, but it's now commented out because (in theory) the Kinect should be able to replace it!
On a similar note, what are the X and Z axis on the Kinect? ie which bodily function does what? We have Y good! (the arms) |
Re: Auto Code NOT Running (as expected)
1 Attachment(s)
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.) |
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
Lana?:p 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... |
Re: Auto Code NOT Running (as expected)
Heh, that should have said Alan.
Yes, a big while loop with false on the terminator should work just fine. Make sure to put a Wait Ms VI in there, 20 to 50ms should work well. |
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
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.
|
Re: Auto Code NOT Running (as expected)
Would passing Ultrasonic and Joystick data to the Dashboard inside Robot Main qualify as "modification"?
|
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
Annnddddddddd, (drum roll please)
It doesn't work. Error #-44061 at Leftand Right Motors, standard loop starvation code. The joystick z-throttle selector works. We have a loop around all Auto Code, with a Wait in there of 20, and tried again w/ 50. Loop starvation every time! Also, sending kinect2 yaxis back to dashboard. Always sends "0", even when doing the floppy chicken! So therefore, is it some error in setting up the Kinect, or can the robot not reliabley interpret the Kinect data? |
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
Quote:
I think if the dashboard can finally get the proper data, then the robot auto code will work fine. |
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
3 Attachment(s)
Alrighty, I sacrifice confidentiality for operation.
|
Re: Auto Code NOT Running (as expected)
Quote:
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. |
Re: Auto Code NOT Running (as expected)
Quote:
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. |
Re: Auto Code NOT Running (as expected)
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. Greg Mckaskle |
Re: Auto Code NOT Running (as expected)
Quote:
|
Re: Auto Code NOT Running (as expected)
Quote:
Otherwise, code looks good? If it ain't, I'll never hear the end of it! |
| All times are GMT -5. The time now is 22:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi