Go to Post The reason I care about it is that I don't want minorities (whether that's females or other racial minorities) to see the STEM world as only inclusive of majorities or men. - Monochron [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 14-01-2015, 09:52
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Autonomous Mode

While in autonomous mode runs do TelOp and Timed Tasked also run. I would really like to be able to use are code from TelOp and Timed Tasked to do autonomous but i am not sure that would work
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2015, 09:54
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Autonomous Mode

Quote:
Originally Posted by Bpk9p4 View Post
While in autonomous mode runs do TelOp and Timed Tasked also run. I would really like to be able to use are code from TelOp and Timed Tasked to do autonomous but i am not sure that would work
I believe your timed tasks will run, but teleop will not.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2015, 09:58
TylerStaudigel's Avatar
TylerStaudigel TylerStaudigel is offline
Registered User
FRC #0144 (R.O.C.K)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2014
Location: United States
Posts: 39
TylerStaudigel is an unknown quantity at this point
Re: Autonomous Mode

Quote:
Originally Posted by notmattlythgoe View Post
I believe your timed tasks will run, but teleop will not.
Agreed. Tele-op will only run when that mode is enabled. What you can do if you want to share data between modes is create a global variable to send it where it needs to go. You can place the vi for your sensor in either the timed tasks section or directly under the main control loop if you are using the default example. Good luck this season.
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2015, 10:03
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
Re: Autonomous Mode

thanks for the quick response. I was thinking that was true but wanted to double check.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2015, 12:30
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 250
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Autonomous Mode

Just so you have an idea on what runs and when, take a look into the Main.vi. You shouldn't need to edit anything in it, but you will see that autonomous only executes once, while periodic tasks runs at startup and teleop runs 20 times a second. There is of course more to it, but it'll give you a good idea of what code and loops are running at any given time.
Reply With Quote
  #6   Spotlight this post!  
Unread 14-01-2015, 14:26
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Autonomous Mode

What we usually do (and what I would recommend), is that you put any software that you intend to use in both teleop and auton in the periodic tasks VI. You can then pass data from auton and teleop to periodic tasks with global variables.

That may not make sense at first so I'll give an example.

Let's say you have a lifting mechanism to lift the totes. You decide that it would be ideal to command your lift to a height (using presets on buttons) and use a PID to control the lift to the commanded height. At the same time, it would make sense for autonomous to command the lift to a height and use a PID to control the lift to the commanded height.

Since both your autonomous strategy and your teleop strategy both rely on commanded heights and a PID, it would make sense to move your lift control code to periodic tasks so it can be shared by autonomous and teleop. You could then create a global variable called "LiftHeightCommand" that is the set point of the PID. In teleop, do your button processing to decide on the commanded lift height and assign the output of your logic to LiftHeightCommand. In autonomous, just set LiftHeightCommand directly.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2015, 06:59
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,752
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: Autonomous Mode

Good advice already. I'll add just one thing.

If the code will execute quickly. If it is reading sensors and comparing to some limit, for example, you can also make that code into a subVI and call the subVI from auto, tele, and periodic too if that makes sense.

If the code will wait for a mechanism to move, or time a mechanism's movement, you do not want to put it into teleOp, or it will prevent the next joystick inputs from being read on time.

Greg McKaskle
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 02:17.

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