Go to Post Titanium is almost twice as heavy as aluminum. I can have the bragging aspect of making a bullet resistant robot, but if someone is coming into a competition and shooting my robot, I have more important things to worry about! - Andrew Blair [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
  #2   Spotlight this post!  
Unread 01-17-2013, 06:59 PM
2472Programer 2472Programer is offline
Programming Captain
AKA: Dane Jensen
FRC #2472 (The Centurions)
Team Role: Programmer
 
Join Date: May 2012
Rookie Year: 2006
Location: Circle Pines, MN
Posts: 13
2472Programer is an unknown quantity at this point
Re: Drive system + encoders

Though i don't know how to use encoders, there is a first made tutorial based on them. I do however know how to program a basic arcade drive.
one joystick:
Code:
public class Main extends IterativeRobot {
    AxisCamera camera = AxisCamera.getInstance();
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Joystick joypad = new Joystick(3);
    CriteriaCollection cc;
    RobotDrive robotDrive = new RobotDrive(1,2,3,4);
    //Encoder shooterSpeed = new Encoder(1,2);
    //float Kp = 3.f;
    //float Ki = 0.f;
    //float Kd = 0.f;
    //private final PIDController shooterPID;
   
    public void robotInit() {
        
        cc = new CriteriaCollection();
        
        cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 30, 400, false);
        
        cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 40, 400, false);

    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        
        robotDrive.arcadeDrive(leftStick);

2 Joysticks
Code:
public class Main extends IterativeRobot {
    AxisCamera camera = AxisCamera.getInstance();
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Joystick joypad = new Joystick(3);
    CriteriaCollection cc;
    RobotDrive robotDrive = new RobotDrive(1,2,3,4);
    //Encoder shooterSpeed = new Encoder(1,2);
    //float Kp = 3.f;
    //float Ki = 0.f;
    //float Kd = 0.f;
    //private final PIDController shooterPID;
   
    public void robotInit() {
        
        cc = new CriteriaCollection();
        
        cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 30, 400, false);
        
        cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_AREA, 40, 400, false);

    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        
        robotDrive.arcadeDrive(leftStick, rightStick);
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 07:40 AM.

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