Go to Post there is no such thing as too many parts or useless parts, only parts you dont need yet. - Cuog [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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-03-2014, 10:27
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Maintenance mode TeleOp

Hey guys! I figured a new idea would be a refreshing change against all the question threads, so I wanna share something that our team realized. Its a cool little trick for keeping shop code and competition code different!

Up until now, whenever we wanted to test something electronically, we would have to create a new project and just instantiate a single motor or sensor or whatever to make absolutely sure nothing else interfered. However, what we realized is that in the main project you use, in the teleOp branch have a simple couple lines of code:
Code:
(operatorControl())
{
	if(DriverStation->GetDigitalIn(8))
	{
		//Competition code, lots of automation, proper button mappings, 
		//etc.,
	}
	else
	{
		//Shop code, simple button assignments, zero automation,
		//rewritten whenever you need to test something, "whiteboard" 
		//code.
	}
}
This way, so long as you make sure you don't use Digital Input 8 for anything else, you can easily test an isolated motor or sensor or whatever, while keeping your same project. Does anyone else use small tricks like this, or improved versions of this?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote
  #2   Spotlight this post!  
Unread 14-03-2014, 12:08
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,572
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: Maintenance mode TeleOp

Have you tried using Test mode? http://wpilib.screenstepslive.com/s/...sing-test-mode
Reply With Quote
  #3   Spotlight this post!  
Unread 14-03-2014, 12:30
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Maintenance mode TeleOp

No actually I hadn't... I'd always seen it but had no idea what it did, and didn't want something to happen I wasn't expecting. So its just another teleOp code section, to keep your comp code and shop code seperate? Cause that sounds genius and is a whole lot less ghetto than what we're doing.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote
  #4   Spotlight this post!  
Unread 14-03-2014, 12:45
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: Maintenance mode TeleOp

Test mode is explicitly not connected with Teleop. It's another mode in addition to Autonomous and Teleoperated. The idea is to give you direct access via the Dashboard to each individual sensor and actuator on the robot.
Reply With Quote
  #5   Spotlight this post!  
Unread 15-03-2014, 09:29
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Maintenance mode TeleOp

Interesting. I noticed that it doesn't default to having a while loop in it in the simple robot template. Is test mode supposed to just be a run through of every thing, or have some semblance of input control?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."

Last edited by Sparkyshires : 15-03-2014 at 09:57. Reason: typo
Reply With Quote
  #6   Spotlight this post!  
Unread 15-03-2014, 12:38
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,572
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: Maintenance mode TeleOp

Quote:
Originally Posted by Sparkyshires View Post
Interesting. I noticed that it doesn't default to having a while loop in it in the simple robot template. Is test mode supposed to just be a run through of every thing, or have some semblance of input control?
In the simple robot template, teleop doesn't have a while loop by default either. Make of that what you will.
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 14:09.

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