Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Maintenance mode TeleOp (http://www.chiefdelphi.com/forums/showthread.php?t=127858)

Sparkyshires 14-03-2014 10:27

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?

Joe Ross 14-03-2014 12:08

Re: Maintenance mode TeleOp
 
Have you tried using Test mode? http://wpilib.screenstepslive.com/s/...sing-test-mode

Sparkyshires 14-03-2014 12:30

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.

Alan Anderson 14-03-2014 12:45

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.

Sparkyshires 15-03-2014 09:29

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?

Joe Ross 15-03-2014 12:38

Re: Maintenance mode TeleOp
 
Quote:

Originally Posted by Sparkyshires (Post 1359144)
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.


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

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