Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Auto Code NOT Running (as expected) (http://www.chiefdelphi.com/forums/showthread.php?t=104335)

kws4000 07-03-2012 16:17

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, ????

plnyyanks 07-03-2012 16:27

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.

kws4000 07-03-2012 19:58

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)

Alan Anderson 07-03-2012 21:10

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.)

RufflesRidge 07-03-2012 21:18

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by kws4000 (Post 1140759)
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)

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.

kws4000 07-03-2012 21:39

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...

RufflesRidge 07-03-2012 21:43

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.

kws4000 07-03-2012 21:53

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by RufflesRidge (Post 1140798)
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.

Okay, but any infinite loops are on your tab next week, I've already footed the bill my team gives the programmers long enough!

RufflesRidge 07-03-2012 21:58

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.

kws4000 07-03-2012 22:16

Re: Auto Code NOT Running (as expected)
 
Would passing Ultrasonic and Joystick data to the Dashboard inside Robot Main qualify as "modification"?

RufflesRidge 07-03-2012 22:40

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by kws4000 (Post 1140817)
Would passing Ultrasonic and Joystick data to the Dashboard inside Robot Main qualify as "modification"?

Nope, that should be fine.

kws4000 12-03-2012 16:45

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?

RufflesRidge 12-03-2012 16:48

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by kws4000 (Post 1143000)
Annnddddddddd, (drum roll please)

So therefore, is it some error in setting up the Kinect, or can the robot not reliabley interpret the Kinect data?

If you run the default dashboard, does the Kinect "green man" and Y-axis data show up?

kws4000 12-03-2012 16:51

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by RufflesRidge (Post 1143002)
If you run the default dashboard, does the Kinect "green man" and Y-axis data show up?

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.

Ether 12-03-2012 16:56

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by plnyyanks (Post 1140714)
you have to measure the change in timer value, which will give you milliseconds elapsed. Try the attached snippet instead.

The output of your feedback node in that snippet never changes.



kws4000 12-03-2012 17:02

Re: Auto Code NOT Running (as expected)
 
3 Attachment(s)
Alrighty, I sacrifice confidentiality for operation.

plnyyanks 12-03-2012 17:46

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by Ether (Post 1143011)
The output of your feedback node in that snippet never changes.

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.

Mark McLeod 12-03-2012 17:51

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by kws4000 (Post 1143000)
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?

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.

Greg McKaskle 12-03-2012 17:52

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

Ether 12-03-2012 17:53

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by plnyyanks (Post 1143045)
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).

OK sorry I misunderstood the OP's intent.



kws4000 12-03-2012 18:32

Re: Auto Code NOT Running (as expected)
 
Quote:

Originally Posted by Mark McLeod (Post 1143048)
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.

That may be it, Mark. We'll try it either tomarrow or Wednesday, we may be doing something with team Wavelength in Norton Shores.

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