Go to Post I guess this is where theory vs reality comes into play. - PhilBot [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 20-02-2012, 12:30
ehochstein's Avatar
ehochstein ehochstein is offline
Coach, Volunteer & Mentor
AKA: Evan Hochstein
FTC #5943 (ESGM)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Bloomington, Minnesota
Posts: 932
ehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant future
Using throttle to manipulate Autonomous Mode

I am attempting to help the students code in multiple autonomous modes for multiple different positions. We are currently testing two different ones and ran into a problem. Whenever we enable it tries to do both autonomous modes and kind of 'jumps' around. Are we doing something wrong?
Attached Thumbnails
Click image for larger version

Name:	labview_autonomous.jpg
Views:	88
Size:	304.2 KB
ID:	12010  
__________________
Minnesota FIRST Senior Mentor | 2013-?

Stratasys Applications Engineering Technician | 2016-?

2009 Regional Win – 2470 @ 10k Lakes (Thanks 2826 and 1714)
2013 WFFA Recipient – 2470 @ 10K Lakes
2016 Ri3D: 'Snow Problem Reveal

The opinions expressed above are the personal opinions of the author and do not necessarily represent the views and opinions of any organization the author is affiliated with.
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2012, 12:34
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using throttle to manipulate Autonomous Mode

Are the conditional terminals in the while loop set to Stop If True, or Continue If True?

If they're set to Stop, then that means that the while loop will run when the throttle isn't at 1/-1, which is the opposite of what you want.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2012, 12:39
ehochstein's Avatar
ehochstein ehochstein is offline
Coach, Volunteer & Mentor
AKA: Evan Hochstein
FTC #5943 (ESGM)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Bloomington, Minnesota
Posts: 932
ehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant future
Re: Using throttle to manipulate Autonomous Mode

Ah, I see got it now... I knew it was something simple, we'll be testing it in a few minutes hopefully it will work now. Thanks!
__________________
Minnesota FIRST Senior Mentor | 2013-?

Stratasys Applications Engineering Technician | 2016-?

2009 Regional Win – 2470 @ 10k Lakes (Thanks 2826 and 1714)
2013 WFFA Recipient – 2470 @ 10K Lakes
2016 Ri3D: 'Snow Problem Reveal

The opinions expressed above are the personal opinions of the author and do not necessarily represent the views and opinions of any organization the author is affiliated with.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2012, 12:40
rzoeller rzoeller is offline
MN GOFIRST Recruitment Officer
AKA: Ryan Zoeller
FRC #2169 (RI3D 'Snow Problem; KING TeC)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2007
Location: Savage, MN
Posts: 111
rzoeller is a jewel in the roughrzoeller is a jewel in the roughrzoeller is a jewel in the rough
Re: Using throttle to manipulate Autonomous Mode

This may not be what your looking for, but we have found it easier to use inputs from the Driver Station itself instead of a joystick. It allows you to set multiple autonomi up and accurately pick which one to use, instead of relying on a throttle which may get bumped.
__________________
Ri3D - 'Snow Problem Programmer
MN GOFIRST Recruitment Officer
FRC 2169 Alumni
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2012, 14:56
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Using throttle to manipulate Autonomous Mode

instead of using axis=1 or axis=-1, use axis>0 and axis<0. It is (almost???) impossible to get it at exactly 1, so both would be false, meaning that both would run
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2012, 20:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using throttle to manipulate Autonomous Mode

The other comments will improve the code, but you will still find an odd jerk at the beginning as the while loops will both run at least once. You may find it even a bit better to surround the loop with a case statement and change the loops to run forever. The case can be the Boolean results of the compare, or you convert it to an enum or integer using scaling, and put the code in various frames of the case.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2012, 20:54
MAldridge's Avatar
MAldridge MAldridge is offline
Lead Programmer
AKA: Rube #1
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Austin
Posts: 117
MAldridge will become famous soon enoughMAldridge will become famous soon enough
Re: Using throttle to manipulate Autonomous Mode

That has got to be the most creative use of the while loop I have ever seen! I would suggest that, since has already been mentioned, you put your code into a case structure, and you use the DS switches wired into a build array. Then you can do a boolean array to number and have up to 2^8 autonomous modes!
__________________
'Why are you a programer?' --Team Captain
'Because the robot isn't complicated enough!' --Me
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 08:42.

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