Go to Post It is better to err on the side of caution than to put yourself in a position to have a referee or judge make a call against you. Build smart! - Sean Schuff [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-03-2012, 16:17
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Question Auto Code NOT Running (as expected)

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, ????
Attached Thumbnails
Click image for larger version

Name:	2405 AUTO 2012 Comp1.JPG
Views:	77
Size:	148.3 KB
ID:	12241  
Reply With Quote
  #2   Spotlight this post!  
Unread 07-03-2012, 16:27
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Auto Code NOT Running (as expected)

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.
Attached Thumbnails
Click image for larger version

Name:	timer.png
Views:	43
Size:	10.3 KB
ID:	12243  
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #3   Spotlight this post!  
Unread 07-03-2012, 19:58
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
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)
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #4   Spotlight this post!  
Unread 07-03-2012, 21:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Auto Code NOT Running (as expected)

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.)
Attached Thumbnails
Click image for larger version

Name:	snippet.png
Views:	40
Size:	32.3 KB
ID:	12249  
Reply With Quote
  #5   Spotlight this post!  
Unread 07-03-2012, 21:18
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by kws4000 View Post
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.

Last edited by RufflesRidge : 07-03-2012 at 21:40.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-03-2012, 21:39
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: Auto Code NOT Running (as expected)

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...
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #7   Spotlight this post!  
Unread 07-03-2012, 21:43
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 07-03-2012, 21:53
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by RufflesRidge View Post
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!
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #9   Spotlight this post!  
Unread 07-03-2012, 21:58
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
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.
Reply With Quote
  #10   Spotlight this post!  
Unread 07-03-2012, 22:16
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: Auto Code NOT Running (as expected)

Would passing Ultrasonic and Joystick data to the Dashboard inside Robot Main qualify as "modification"?
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #11   Spotlight this post!  
Unread 07-03-2012, 22:40
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by kws4000 View Post
Would passing Ultrasonic and Joystick data to the Dashboard inside Robot Main qualify as "modification"?
Nope, that should be fine.
Reply With Quote
  #12   Spotlight this post!  
Unread 12-03-2012, 16:45
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Question 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?
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #13   Spotlight this post!  
Unread 12-03-2012, 16:48
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 988
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by kws4000 View Post
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?
Reply With Quote
  #14   Spotlight this post!  
Unread 12-03-2012, 16:51
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by RufflesRidge View Post
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.
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #15   Spotlight this post!  
Unread 12-03-2012, 16:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Auto Code NOT Running (as expected)

Quote:
Originally Posted by plnyyanks View Post
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.


Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi