Go to Post And then I learned how to use the lathe...long story short, I ditched my plans to become a music major and became an engineering student. - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2010, 15:51
frenchie4111 frenchie4111 is offline
Registered User
None #1111
 
Join Date: Jan 2010
Location: Southriver
Posts: 23
frenchie4111 is an unknown quantity at this point
Problem Switching Between Modes | Powerhawks Team 1111

Hello, this is Michael from the GS IPT South River Powerhawks Team 1111,

We have gone through the second section of the manual completely and have been successful in uploading and running code (C++) to the cRIO. However, in order to run the code we must stay in teleoperated because when we switch to autonomous mode it runs the autonomous code correctly but does not allow us to switch back to teleoperated.

tl;dr After switching to autonomous we can't switch back (we select teleoperated but autonomous code continues to run).

Thanks.
  #2   Spotlight this post!  
Unread 17-01-2010, 16:00
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Problem Switching Between Modes | Powerhawks Team 1111

the problem: infinite loops
make sure you have a IsAutonomous check instead of an infinite loop. When you switch to Telop/Auto, The DS informs the cRIO that the state has changed, and you need to manually poll for this info
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #3   Spotlight this post!  
Unread 18-01-2010, 19:48
frenchie4111 frenchie4111 is offline
Registered User
None #1111
 
Join Date: Jan 2010
Location: Southriver
Posts: 23
frenchie4111 is an unknown quantity at this point
Re: Problem Switching Between Modes | Powerhawks Team 1111

Thanks byteit for the quick reply, but the code we have loaded on the cRIO at this time is the default (C++) code and it does not contain any infinate loops.
  #4   Spotlight this post!  
Unread 19-01-2010, 06:57
Diserasta Diserasta is offline
4 Hours of sleep a day on avg.
AKA: Samouil
FRC #3132 (Thunder Down Under)
 
Join Date: Nov 2009
Rookie Year: 2010
Location: Sydney
Posts: 9
Diserasta is an unknown quantity at this point
Re: Problem Switching Between Modes | Powerhawks Team 1111

Doesn't the default code for the autonomous mode use a jumper to decide whether it's in autonomous or not. You could just change that so that when autonomous finishes running (or a set a timer for 15 seconds) it switches to teleop.

Hope this helps.
__________________
Code:
In .h
RobotDrive *ted;
RobotDrive *tedDrive;

In .cpp
DriveTrain::DriveTrain (RobotDrive *ted){
tedDrive = &*ted;
}
Yo dawg, I heard you like pointers, so I put a pointer in yo pointer, so you can de-reference your pointer while you point to yo pointer.

  #5   Spotlight this post!  
Unread 19-01-2010, 08:44
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Problem Switching Between Modes | Powerhawks Team 1111

Are you using the IterativeRobot class? If so, make sure to be using the correct function.
Closed Thread


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
Switching between Autonomous and Teleoperated Technic-R-C National Instruments LabVIEW and Data Acquisition 3 07-02-2009 08:55
Toggling between modes csshakka NI LabVIEW 3 02-02-2009 20:47
Switching between Hybrid and User-Controlled Zyklon Programming 3 13-02-2008 08:30
Question about switching autonomous modes DemonYawgmoth Programming 2 23-03-2005 17:02
switching modes Allison Programming 8 06-04-2004 13:37


All times are GMT -5. The time now is 21:52.

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