Go to Post I WANT to see teams succeed. - Steve W [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 18-02-2011, 21:38
sp33chy sp33chy is offline
Registered User
FRC #3332
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Melbourne, FL
Posts: 29
sp33chy is an unknown quantity at this point
I hate Autonomous programming! Why is it so sporadic?

Code:
    public void autonomous() {
        xmove=.25;
        autonomousTimer.start();
        autonomousTimer.reset();
        while(true){
        if(photoSwitch.get()){
            topLeft.set(xmove);
            topRight.set(-xmove);
            bottomLeft.set(xmove);
            bottomRight.set(-xmove);
        }
        if(!photoSwitch.get())
            {
            topLeft.set(0);
            topRight.set(0);
            bottomLeft.set(0);
            bottomRight.set(0);
        }
        if(autonomousTimer.get()>15.0){
            topLeft.set(0);
            topRight.set(0);
            bottomLeft.set(0);
            bottomRight.set(0);
            break;
        }
            Watchdog.getInstance().feed(); //Gotta feed that watchdog

        }
    }
Sometimes, the code works as it's supposed to be, It (the bot)stops when it reaches the end of the line. Sometimes it keeps going indefinitely, and sometimes and it doesn't move. This makes no sense to me. I've been pulling my hair out as to why it keeps doing this. Any help would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2011, 21:46
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: I hate Autonomous programming! Why is it so sporadic?

Have you checked the calibration on the photoreceptor? We've found them to be quite finicky, especially when you move to a new surface (i.e. some carpets are more reflective than others, and the sensors need retuning).
Try getting the robot up on blocks and letting it run, blocking and unblocking the sensors with your hand.
I don't see anything particularly wrong with your program itself - the error is probably coming from other sources.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2011, 21:50
sp33chy sp33chy is offline
Registered User
FRC #3332
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Melbourne, FL
Posts: 29
sp33chy is an unknown quantity at this point
Re: I hate Autonomous programming! Why is it so sporadic?

So I've noticed that the switch glows green, orange, or no color at all, depending on the surface. How should it be calibrated?

edit: yes, it was a calibration issue. The light has to glow green in order for the switch to be closed. I thought it was supposed to glow between nothing and orange.

Last edited by sp33chy : 18-02-2011 at 22:18.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2011, 22:21
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: I hate Autonomous programming! Why is it so sporadic?

No colour at all? That's a new one to me.
Green means that the light is not being reflected.
Yellow (the light in the middle) means that the light is being reflected.
Orange means that the receptor is being overloaded with light. It shouldn't be a problem, but it's not too healthy for the sensor.
With the sensor at the desired distance from the floor, twist the dial on the front (with a screwdriver) until it turns yellow, then turn it back just enough to be green. If you move it over the tape at the same distance away, it should turn yellow. If you move it back onto the non-reflective surface and it is still yellow, it needs to be dialed back just a bit.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
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 11: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