OCCRA
Go to Post You can lead a horse to water but you can't make it drink. Our job is to make the horse thirsty. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-14-2008, 01:05 PM
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 483
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Leaving Autonomous

When Autonomous is over, will easyC Pro stop sensors (encoders, sonar, etc) automatically?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-14-2008, 01:24 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Itinerant Programmer
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: 7,454
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: Leaving Autonomous

Everything you have going in the Autonomous block will stop, but anything in Initialize will still be going, and the Operator block will begin. The code will essentially restart.

So if you started the sensor in Autonomous, it will stop.
The sensor itself doesn't generally stop what it's doing, it's just that your program will ignore it.
Some sensors that rely on the code to tell them when to send out a Ping for example, will just sit quietly waiting.
__________________
The mind sees only what the mind is prepared to comprehend - Henri Bergson
358 Beta notes & results

Last edited by Mark McLeod : 02-14-2008 at 01:28 PM.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-14-2008, 01:59 PM
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 483
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: Leaving Autonomous

So if the quadrature encoders start an interrupt routine, I don't have to worry about it stealing overhead from the operator control? Interrupts will be stopped?
Reply With Quote
  #4   Spotlight this post!  
Unread 02-14-2008, 02:10 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Itinerant Programmer
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: 7,454
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: Leaving Autonomous

Quote:
Originally Posted by Dad1279 View Post
So if the quadrature encoders start an interrupt routine, I don't have to worry about it stealing overhead from the operator control? Interrupts will be stopped?
If you use Optical Quad Encoder in Autonomous, the interrupts [edit]will[/edit] continue in Operator.
However, I think I'll go test that to be sure some other EasyC behavior isn't cropping up...

PPS: It's going to depend on how the WPILIB kernal is setup, so restarting the user process may leave the interrupts running. I'll test it when I get near a controller and report back.

PPSS: Background processes do continue between the Autonomous & Operator blocks.
__________________
The mind sees only what the mind is prepared to comprehend - Henri Bergson
358 Beta notes & results

Last edited by Mark McLeod : 02-14-2008 at 09:24 PM. Reason: Incorrect answer
Reply With Quote
  #5   Spotlight this post!  
Unread 02-14-2008, 09:19 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Itinerant Programmer
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: 7,454
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: Leaving Autonomous

I checked and the kernal does maintain the interrupt schedule created in the Autonomous block.
Sorry for the misinformation.

So to answer your question, you will have to stop the Quad Encoder as your first step in the Operator block.
Put the call before the while(1) loop, as it only needs to be called once.

This'll be true for any of the sensor commands with a "Stop" option (Encoder, Gear tooth, Ultrasonic, Gyro, Accelerometer, Interrupt Watcher).
__________________
The mind sees only what the mind is prepared to comprehend - Henri Bergson
358 Beta notes & results

Last edited by Mark McLeod : 02-14-2008 at 09:28 PM.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-14-2008, 10:23 PM
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 483
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: Leaving Autonomous

Thank you. I had a feeling I would need to stop these sensors.

Edit... I know there is a 'while(1) loop in the default IFI code, but don't see while(1) loop in EasyC OperatorControl...???

Last edited by Dad1279 : 02-14-2008 at 11:18 PM.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-15-2008, 10:18 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Itinerant Programmer
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: 7,454
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: Leaving Autonomous

A while(1) isn't absolutely necessary in the Operator block.

I just teach the students to use one, so they can use the beginning of Operator for initialization, then follow that with a while(1) to do the repeating part of their processing.
__________________
The mind sees only what the mind is prepared to comprehend - Henri Bergson
358 Beta notes & results
Reply With Quote
  #8   Spotlight this post!  
Unread 02-15-2008, 01:34 PM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 858
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Leaving Autonomous

You should use a while(1) in operator control as the looping behavior was not intentional on our part and more a function of WPILIB. EasyC V2 doesn't use WPILIB, and doesn't loop in operator control for competition templates in Vex which could lead to a headache if you don't get in the habit.
__________________
Intelitek Support

[BFIRST Team 146 Blue Lightning - Alumni[/b]
FIRST Team 40 Checkmate
Reply With Quote
  #9   Spotlight this post!  
Unread 02-19-2008, 03:06 AM
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 537
BradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud of
Re: Leaving Autonomous

To answer your question about switching from Autonomous to OperatorControl, here's what happens:

When you put the robot on the field and turn it on (or anytime you reset it), your Initialize() function runs from the start to completion. If there are sensors like gyros that are initialized in the Initialize function, they will completely initialize. This can take a few seconds to complete, so if you reset the robot in the middle of a match you might see this delay before the robot starts driving again.

When the match starts and hybrid mode starts, your Autonomous() function will start running. Your Autonomous() function will either run to completion or...

When the field switches to tele-operation, your Autonomous() function will be interrupted (stopped), and the OperatorControl() function starts executing. As was said, you would typically put a while (1) loop in there to repeatitively read controls and send values to motors.

The switching from Autonomous to OperatorControl is automatic and you don't have to do anything to make it happen. Any background processing of sensors that you start in Autonomous or Initialize will continue until you explicitly stop it. Background processing starts whenever you do a Startxxx function on a sensor. For example StartGyro causes the code for the Gyro to automatically start polling it and computing headings in the background. You don't have to do anything else to make it work. The reason the background stuff doesn't stop between Autonomous and OperatorControl is so teams that want to use the Gyros and Cameras in their operator control programs won't have to wait for them to reinitialize at the start of the OperatorControl() function.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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
Leaving for college... aallen88 Chit-Chat 5 08-18-2006 11:57 AM
Leaving for the IRI.... archiver 2001 2 06-24-2002 04:03 AM
Leaving for West Mich... archiver 2001 0 06-24-2002 01:53 AM
Leaving for the BOMB.... archiver 2000 3 06-23-2002 11:17 PM


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

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


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