Go to Post It truly is a Merry Vexmas! - Ginger Power [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 06-11-2012, 15:39
y-aji y-aji is offline
Registered User
FRC #3734
 
Join Date: Dec 2011
Location: Lake Forest
Posts: 38
y-aji is an unknown quantity at this point
Lost our last programmer

Welp, it's nearing that time of year yet again and sadly, we have lost our Java programmer. We have yet to get any response out of our robot outside of the hello world program. Would someone verify if the following code (pulled from the generic tutorial) should work?

Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;

public class GroundZeroTemplate extends SimpleRobot {
    
    RobotDrive drive = new RobotDrive(1,3,2,4);
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
            
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {
        /*getWatchdog().setEnabled(true);
        getWatchdog().setExpiration(0.5);
        drive.drive(1,0);
        Timer.delay(2);
        drive.drive(0,0);*/
        for (int i = 0; i < 4; i++) {
            drive.drive(0.5, 0.0); // drive 50% fwd 0% turn
            Timer.delay(2.0); // wait 2 seconds
            drive.drive(0.0, 0.75); // drive 0% fwd 0% turn
        }
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
        while (true && isOperatorControl() && isEnabled()) // loop until change
        {
            drive.tankDrive(leftStick, rightStick); // drive w/ joysticks
            Timer.delay(0.005);
        }
    }
}
The only unique aspect of our setup is that we are using 4 motors connected to 4 jaguars in our setup instead of the default 2.

When we activate this code in both autonomous as well as user-driven modes, we get no visual response from the jaguars whatsoever nor any movement. Should I look at something in this code or do I need to start looking at electrical problems?

Thank you!
Reply With Quote
 


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:33.

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