Go to Post Ya know something I heard, UFH always look beter in PINK! :) - Kyle Love [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 06-02-2010, 10:39
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
TeleOp Init/Stop vs. Auton-Iterative Init/Stop

I've been going through the subVI's for the Robot Mode and Derived States and I'm having a hard time determining the exact flow that the competition's game-control/management system will push us through ... and do the driver-station buttons emulate what we'll see on the field ...

The Robot Mode has 6 states ... and I'm guessing that they'll flow in this order when we're on the playing field:
Autonomous Disabled
Autonomous Enabled
Teleop Disabled
Teleop Enabled
Finish (?? Maybe a Teleop Disable before the Finish ?? I dunno.)
(the 6th state is Timeout and it's the exception when we don't get a DS packet)

I'm hoping that when we emulate that on the DS, it's the same as what we'll see on the field.

Now, inside both the Auton and Teleop structures, we have the Derived Robot State of
Init
Execute
Stop
... and this is where my analysis of their subVI's breaks down. I'm not sure if we sit, looping, in the INIT state while we're "disabled" the entire time ... or do we only get one time thru the INIT state.

... and will my Auton get a chance to run it's STOP case as we transition between Auton-Enabled and Teleop-Disabled?

... similarly, will my Teleop get a chance to run it's STOP case as we transition to FINISH?

Sorry if this has been asked to death, but the keywords that I searched for brought up quite a mix-mash of posts, and nothing really covering my questions.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2010, 11:14
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

You can use the driver station to simulate a match and get the transitions. I believe your flow is correct, except that finish is never called unless the finish button is clicked in Robot Main. Since you can't do that on the field, finish is never called when you are on the field. If you are just using closing device references, that shouldn't matter since a power cycle clears everything. If you're doing things like closing files, you should either figure out other places to close them (such as right after you write to them), or modify the framework to add another way to get to finish (maybe a switch on the robot). You end the match in Telop Disabled.

As far as the int, execute, stop. Init is called the first time the Robot Mode changes. It's called just once, then Execute happens. When Robot Mode changes again, stop of the old mode is called once, and then the init case of the new mode is called once.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2010, 11:17
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: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Good questions.

The framework for LV will guarantee that the first time through a mode like auto, that you'll run the init once, and when the mode switches to something else, it guarantees that you run Stop once. These are not officially part of the protocol, and if you use Begin, you really don't have to do anything there. The framework was written to support a number of programming styles.

The match states you list skip one transition I think you'll see. Specifically, at the end of auto, I believe the transition is auto-enabled to auto-disabled to tele-disabled, then to tele-enabled. This has only one bit changing at a time.

I believe this is the same transitions you'll see if you use the practice match feature of the DS. On the other hand, it would be best if your resource usage would be robust in case the field starts in tele disabled, say, then goes to auto-disabled before the match. Little glitches like this are not that unusual.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2010, 21:07
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,113
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: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Quote:
Originally Posted by Greg McKaskle View Post
On the other hand, it would be best if your resource usage would be robust in case the field starts in tele disabled, say, then goes to auto-disabled before the match. Little glitches like this are not that unusual.
I'm counting on the field starting in Teleoperated disabled. That's how it has always been in the past, and that's the only way information from the Driver Station can get to the robot before Autonomous begins.

(In the pre-cRIO days, it was not possible for the state to be both Autonomous and Disabled simultaneously.)
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2010, 21:14
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

OK ... really good stuff here. Thanks. I'll update my flows here instead of editing my OP.

When I referred to the "FINISH" state originally, I was referring to every option of the ENUM that defines the Robot Mode, not necessarily the Finish.VI that gets called when you press the button on the RobotMain.vi's front panel.

I took a second look at the default robot project. I had assumed that that ENUM/CaseStructure's possible entries were 1-to-1 with what the FieldManagementSystem (FMS) can send us. But apparently the FINISH state of that ENUM/CaseStructure is only written as the RobotMode when you press that front-panel button. And I agree. It doesn't matter, since the first step of leaving the field is to power down anyway.

... so here are my new assumptions ...


The Robot Mode has 6 states. 4 are controlled by the FMS. They'll normally flow in this order when we're on the playing field:

Autonomous Disabled
Autonomous Enabled - (VisitedAutonomous goes TRUE)
Autonomous Disabled
Teleop Disabled
Teleop Enabled - (VisitedTeleOp goes TRUE)
Teleop Disabled
The 5th state is FINISH and only happens when you have the front-panel's open and can press the FINISH button.

The 6th state is Timeout and it's the exception when we don't get a DS packet.

Now, inside both the Auton and Teleop structures, we have the Derived Robot State of

Init Called when transitioning from Disabled to Enabled.
Execute We spend most of our time in here
Stop Called when leaving Enabled


I learned a few things today. Thanks guys.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2010, 21:21
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Quote:
Originally Posted by Alan Anderson View Post
I'm counting on the field starting in Teleoperated disabled. That's how it has always been in the past, and that's the only way information from the Driver Station can get to the robot before Autonomous begins.

We'll have to get to the bottom of this one ... I don't know why they'd start us up in TeleOp Disabled if Auton is the mode that we switch to when the gun goes off.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #7   Spotlight this post!  
Unread 06-02-2010, 21:21
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: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Hmm. I didn't know about the field before 09. And since I cannot be sure about the field code, I'd say your better odds are on what Alan is saying. On the other hand, I'm certain that the practice match behaves as I described. Of course you can easily flip there from Tele.

Also, you should verify independently, but this year, the robot communications code automatically latches the joystick state and the I/O state before transitioning to Auto Enabled. This acts as both a filter to ensure no joystick inputs drive the robot, and to make it simpler for teams to access their switches and joystick throttles, etc.

Greg McKaskle

Last edited by Greg McKaskle : 06-02-2010 at 21:28.
Reply With Quote
  #8   Spotlight this post!  
Unread 07-02-2010, 03:37
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Quote:
Originally Posted by Alan Anderson View Post
I'm counting on the field starting in Teleoperated disabled. That's how it has always been in the past, and that's the only way information from the Driver Station can get to the robot before Autonomous begins.

(In the pre-cRIO days, it was not possible for the state to be both Autonomous and Disabled simultaneously.)
I'm pretty certain that the FMS will start the round in Auto Disabled. control inputs are sent to the robot during Auto Disabled. Only during Auto Enabled are the control inputs filtered.

Quote:
Originally Posted by Ziaholic View Post
We'll have to get to the bottom of this one ... I don't know why they'd start us up in TeleOp Disabled if Auton is the mode that we switch to when the gun goes off.
Exactly... which is why the FMS starts in Auto Disabled.
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2010, 09:43
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

As a side note, unless you modify Robot Main.vi, it doesn't matter if it starts in Auto Disabled or Telop Disabled, as they both call Disabled.vi.
Reply With Quote
  #10   Spotlight this post!  
Unread 07-02-2010, 09:57
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Quote:
Originally Posted by Joe Ross View Post
As a side note, unless you modify Robot Main.vi, it doesn't matter if it starts in Auto Disabled or Telop Disabled, as they both call Disabled.vi.
Exactly. ... I assumed that Alan's concerns were because his team may not be using Labview, and then that double-state (either/or) case structure wouldn't apply to him. I have zero insight into the C++ or Java frameworks, so I don't know if they provide that "either-or" case like we have in LV.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #11   Spotlight this post!  
Unread 07-02-2010, 14:23
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,113
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: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Quote:
Originally Posted by Greg McKaskle View Post
Also, you should verify independently, but this year, the robot communications code automatically latches the joystick state and the I/O state before transitioning to Auto Enabled. This acts as both a filter to ensure no joystick inputs drive the robot, and to make it simpler for teams to access their switches and joystick throttles, etc.
That's a fundamental change to the way Autonomous mode has handled operator input since it was introduced. Is there some official documentation for that behavior, or should it be considered oral tradition?

If the automatically latched values are indeed something we can count on, implementing code to select autonomous options is now much simpler.

As for joystick values etc. being passed to the robot in Autonomous Disabled, that too contradicts the long-understood condition that Driver Station inputs are not available during Autonomous. Again, is there an official description that tells us how it really works now?

Lest it seem otherwise, I'd like to point out that I'm very happy to know this. I'm only concerned because I don't know how I would have found it out if I hadn't been making reading the Chief Delphi forums a priority.
Reply With Quote
  #12   Spotlight this post!  
Unread 07-02-2010, 22:19
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: TeleOp Init/Stop vs. Auton-Iterative Init/Stop

Very good questions. I'm not sure how the old system was documented, and I'm not sure who's documentation should call this out. But since this change is backwards compatible, it seemed like a simplifying change that still avoids any joystick direction during auto, but instead of zeroing fields, it latches.

If you have an idea of where to add the documentation so that teams will find it, we can provide the technical details.

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a second joystick to TeleOp Init smcmahon NI LabVIEW 14 17-02-2009 20:43
the E-Stop Greg Needel Rules/Strategy 10 13-04-2003 22:13
Wierd basic init Jeremy J Programming 5 06-02-2003 11:42
Basic Init Error yan184 Programming 5 14-12-2002 13:10


All times are GMT -5. The time now is 22:36.

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