Go to Post We honor those who are unsung - those without a trophy or a plaque to show their efforts. Those who may or may not get those things... but will still be on the sidelines, helping to guide FIRST in all the right directions. - Amanda Morrison [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 02-03-2011, 19:02
RoboTigers1796 RoboTigers1796 is offline
Registered User
FRC #1796 (RoboTigers)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: New York City
Posts: 129
RoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of light
Victors in reverse not responding.

Hi there!
I'm one of the programming mentors for Team 1796 and we're encountering a problem with our Victors not responding when trying to go in reverse; the Victors respond moving forward. I've included a scaled down base code that still won't work. I know there must be something simple I'm missing...what is it??? Thanks in advance, everyone!



Code:
package org.team1796;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.camera.AxisCamera;


public class FRC2010Team1796 extends SimpleRobot {
    private RobotDrive robotDrive = new RobotDrive(1,2);
    private Joystick stickLeft = new Joystick(1);
    private Joystick stickRight = new Joystick(2);
    private AxisCamera cam;
    private Victor claw1 = new Victor(3);
    private Victor claw2 = new Victor(4);
    private Victor arm1 = new Victor(5);
    private Victor arm2 = new Victor(6);
    private Compressor compressor = new Compressor(1,1);
    private Solenoid armup = new Solenoid(7);
    private Solenoid armdown = new Solenoid(8);


    public FRC2010Team1796() {
         getWatchdog().setExpiration(0.1);

         compressor.start();


    }
 
    public void operatorControl() {
        getWatchdog().setEnabled(false);

        while (isEnabled() && isOperatorControl()) {
            getWatchdog().feed();

             if (stickRight.getRawButton(4)) {
                    claw1.set(-1.0);
                    claw2.set(-1.0);
                } else {
                    claw1.set(0.0);
                    claw2.set(0.0);
                }
            if (stickRight.getTrigger()) {
                    claw1.set(1.0);
                    claw2.set(1.0);
                } else {
                    claw1.set(0.0);
                    claw2.set(0.0);
                }
            if (stickRight.getRawButton(3)) {
                    claw1.set(-1.0);
                    claw2.set(1.0);
                } else {
                    claw1.set(0.0);
                    claw2.set(0.0);
                }
            if (stickLeft.getRawButton(5)) {
                   arm1.set(1.0);
                   arm2.set(1.0);
                } else {
                    arm1.set(0.0);
                    arm2.set(0.0);
                }
            if (stickLeft.getRawButton(4)) {
                     arm1.set(-1.0);
                     arm2.set(-1.0);
                } else {
                     arm1.set(0.0);
                     arm2.set(0.0);
                }
            if (stickLeft.getTrigger()) {
                     armup.set(true);
                } else {
                     armup.set(false);
                }
            if (stickLeft.getRawButton(3)) {
                     armdown.set(true);
                } else {
                     armdown.set(false);
                }
                robotDrive.arcadeDrive(stickLeft);
            }
        //}
    }
}
Thanks! We're really stuck here.
__________________
2014 Attended: NYC Regional, SBPLI Regional NYC Regional- Imagery Award in honor of Jack Kamen
2013 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- Gracious Professionalism Award sponsored by Johnson & Johnson,SBPLI Regional- #4 Alliance Captain & Regional Winner- With our impeccable alliance 358 and 3171
2012 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- #7 Ranked Seed & Semi-Finalists, SBPLI Regional- #3 Seed & Regional Winner- With our very awesome alliance 527 and 870, Industrial Design Award sponsored by General Motors
2011 Attended: NYC Regional, SBPLI Regional SPBLI Regional- Xerox Creativity Award and #5 Alliance Captain
2009 Attended: NYC Regional, FIRST Championships NYC Regional Winner- With our amazing alliance 1807 and 56

Last edited by RoboTigers1796 : 02-03-2011 at 19:08.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-03-2011, 19:03
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,567
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: Victors in reverse not responding.

What do the LEDs on the Victors do when you command reverse?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-03-2011, 19:12
RoboTigers1796 RoboTigers1796 is offline
Registered User
FRC #1796 (RoboTigers)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: New York City
Posts: 129
RoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of light
Re: Victors in reverse not responding.

the LED's don't change (remains orange).
__________________
2014 Attended: NYC Regional, SBPLI Regional NYC Regional- Imagery Award in honor of Jack Kamen
2013 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- Gracious Professionalism Award sponsored by Johnson & Johnson,SBPLI Regional- #4 Alliance Captain & Regional Winner- With our impeccable alliance 358 and 3171
2012 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- #7 Ranked Seed & Semi-Finalists, SBPLI Regional- #3 Seed & Regional Winner- With our very awesome alliance 527 and 870, Industrial Design Award sponsored by General Motors
2011 Attended: NYC Regional, SBPLI Regional SPBLI Regional- Xerox Creativity Award and #5 Alliance Captain
2009 Attended: NYC Regional, FIRST Championships NYC Regional Winner- With our amazing alliance 1807 and 56
Reply With Quote
  #4   Spotlight this post!  
Unread 02-03-2011, 19:44
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,567
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: Victors in reverse not responding.

If button 4 is pressed but not the trigger button, then claw 1 and 2 will be set to -1 and then immediately overwritten by 0 based on the trigger button if statement.

A nested if - else if - else structure is what you need.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-03-2011, 20:36
RoboTigers1796 RoboTigers1796 is offline
Registered User
FRC #1796 (RoboTigers)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: New York City
Posts: 129
RoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of lightRoboTigers1796 is a glorious beacon of light
Re: Victors in reverse not responding.

of course! a million thank you's!!!!!
__________________
2014 Attended: NYC Regional, SBPLI Regional NYC Regional- Imagery Award in honor of Jack Kamen
2013 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- Gracious Professionalism Award sponsored by Johnson & Johnson,SBPLI Regional- #4 Alliance Captain & Regional Winner- With our impeccable alliance 358 and 3171
2012 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- #7 Ranked Seed & Semi-Finalists, SBPLI Regional- #3 Seed & Regional Winner- With our very awesome alliance 527 and 870, Industrial Design Award sponsored by General Motors
2011 Attended: NYC Regional, SBPLI Regional SPBLI Regional- Xerox Creativity Award and #5 Alliance Captain
2009 Attended: NYC Regional, FIRST Championships NYC Regional Winner- With our amazing alliance 1807 and 56
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 22:19.

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