Go to Post No matter what happens to the robot we learned our lesson and we had fun. That's what matters. - David Guzman [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 22-01-2011, 18:16
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Switching from Autonomous to Tele-op

We are having problems getting the driver station to run through autonomous then tele-op. If we start up in practice, it runs our autonomous code, then stops, then starts tele-op. Only thing is that the autonomous code does not stop. the wheels continue to turn and tele op has no motor control. solenoids, servos and the compressor all turn on.

Does anyone know how to fix this?
Ethan

Edit Attached is our Autonomous code, everything is running under robot main.vi
Attached Thumbnails
Click image for larger version

Name:	Build 1-20-11 1.jpg
Views:	59
Size:	90.1 KB
ID:	9778  

Last edited by Ethan Spitz : 22-01-2011 at 18:33.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2011, 18:20
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Switching from Autonomous to Tele-op

In your code, do you have the Jaguar objects (or similar) placed somewhere where it would be local to your autonomous routines? IIRC, the motors will keep running until set otherwise, which might be occurring (as the teleop routines don't have direct access to them).

That is the only thing I can think of, last year we used a built-in arcade drive system, which I can only assume does some sort of reset.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2011, 18:23
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Its using the robot main.vi.

I have the code in the autonomous independent.vi

its in a while loop for line tracking

Do i need a condition to end the while loop?

Ethan
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2011, 18:29
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Switching from Autonomous to Tele-op

Yes. Although I do not program in LabVIEW, I assume it uses a similar calling structure, e.g., the appropriately named functions are called when required. If you loop forever (no exit condition) it will never return, and whatever calls the appropriate routines will never be given time.

From what I've done in Java, there's some isTeleoperated() and isAutonomous() type functions. See if you can find something similar, I guess.
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2011, 18:32
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Each vi is like its own method. The robot main.vi calls the other methods.

From my reading the driver station console is supposed to terminate each vi when the round is over.
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2011, 18:47
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Switching from Autonomous to Tele-op

Hrrrm, I'll let someone who has more experience with LabVIEW try to help you then (the calling scheme is different than for other languages). If you'd try commenting out the autonomous (or finding a sure way to terminate it), that'd probably be a decisive answer to your problem (or, rather, if what I thought is true. It could understandably be something else, in which case we'll have to wait for someone else).
Reply With Quote
  #7   Spotlight this post!  
Unread 22-01-2011, 19:37
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Switching from Autonomous to Tele-op

I'd recommend opening devices in Begin.vi and nowhere else.
I think that's your basic issue here.

What you posted has some problems, but the full answer is in all your code, not just this one piece. I'm just speculating because I'd need to see the rest of your code to positively tell you what 's wrong.

What is happening is that you are opening your drive motors in this vi, then going into an infinite loop. This vi (and only this Autonomous Independent.vi) gets killed automatically at the end of the Autonomous period. That means the Motor closes never happen by the way and they maintain the last value given them in the Autonomous loop.

I bet you try to open the motors again somewhere else (like in Begin.vi maybe?) and that leaves the motor reference in Teleop.vi invalid. You can't Open the same motor more than once.

So Autonomous leaves your motors running forever, and Teleop can't reference those same motors, as it normally should, to stop them.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 19:40.
Reply With Quote
  #8   Spotlight this post!  
Unread 22-01-2011, 21:00
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Thanks! That did the trick! And man the code is so much neater and easier to read now

Just one thing, it runs straight through once on practice mode, but autonomous doesn't run if you try a second time without rebooting the cRIO. I was wondering if this was possible a safety feature that it will only run autonomous once in one boot.

If not, do you have any idea why it would do that?

Ethan
Reply With Quote
  #9   Spotlight this post!  
Unread 22-01-2011, 22: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,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: Switching from Autonomous to Tele-op

Are you getting errors on the second run? It may be that you are closing references in tele or somewhere so that auto will get errors when it tries to use the refnums again. First, look at the Diagnostics tab on the DS when running the second auto, and you may need to look at VIs that contain Close, to see where this is happening.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 22-01-2011, 22:25
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Unfortunately I just left the shop, so I can't test it out, but from what I remember I believe we were getting some watchdog errors. Also errors dealing with not powering the motors with enough, but that was only during tele-op because we are using the axis 3 slider on the joystick to be a multiplier of speed of the motors.

Here is the code we have in tele-op and autonomous

Thanks,
Ethan
Attached Thumbnails
Click image for larger version

Name:	Build 1-21-11 2.jpg
Views:	17
Size:	84.1 KB
ID:	9783  Click image for larger version

Name:	Build 1-21-11 1.jpg
Views:	18
Size:	123.3 KB
ID:	9784  
Reply With Quote
  #11   Spotlight this post!  
Unread 22-01-2011, 22:39
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Switching from Autonomous to Tele-op

The Closes in teleop are killers.

Yea, all the Closes you have in both those vi's should be removed.
Put all your Closes in Finish.vi instead.

The While loop in Autonomous Independent.vi is necessary and that's fine.
However, you don't need the While loop in Teleop.vi. Teleop operates differently.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 22:43.
Reply With Quote
  #12   Spotlight this post!  
Unread 22-01-2011, 22:48
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Ok, I'll recode it use the final.vi. Do you just use the same referencing methods?

Also how would you code it without the while loop?

Ethan
Reply With Quote
  #13   Spotlight this post!  
Unread 22-01-2011, 22:56
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Switching from Autonomous to Tele-op

Yes, the Closes are handled with a Refnum Get straight to a Close.
There are some already in Finish.vi to guide you.

The fundamental difference between Autonomous Independent.vi and Teleop.vi is that Auto gets called only once, so you want to stay in there until you've done all you want to, while Tekeop gets called ~50 times a second, so you'll be back again and again.

In teleop if you leave everything, but just remove the While loop it'll be fine.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 23:01.
Reply With Quote
  #14   Spotlight this post!  
Unread 22-01-2011, 22:59
Ethan Spitz Ethan Spitz is offline
President
FRC #3637 (The Daleks)
Team Role: Leadership
 
Join Date: Feb 2009
Rookie Year: 2011
Location: New Jersey
Posts: 133
Ethan Spitz is an unknown quantity at this point
Re: Switching from Autonomous to Tele-op

Ok

I'm a little confused, when I code the closes, do I need to make references to them in the autonomous mode or tele-op mode, or do I just use the get reference and then close, and never use set reference in the tele-op or autonomous vi's

Ethan
Reply With Quote
  #15   Spotlight this post!  
Unread 22-01-2011, 23:04
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Switching from Autonomous to Tele-op

Opens go in Begin.vi
Closes go in Finish.vi
Sets go in Autonomous Independent.vi and Teleop.vi

I'm working from a Mac without LabVIEW, so I can't give you a graphical example right now.
It takes a while to shutdown all the computers in the house and the PCs have already been put to bed.

The Auto that you posted is fine, just remove the Closes to keep it clean.

The Teleop you posted is also fine, just remove the Closes and the While loop (but not the contents).
The Get Refnums feed directly into the Sets in Teleop.
Think of the whole Teleop.vi as one giant While loop.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 23:12.
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 04:01.

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