Go to Post Your primary job is not to build the most technically advanced robot, but build the best possible team. - PayneTrain [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 17-01-2013, 18:29
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Exclamation Drive system + encoders

Hey guys... I'm new to the java for FRC and i was wondering if you guys can help me out with the basic code for our iterative robot project. We have 2 jaguars on pwn 1 and 2 on the DSC and arcade drive. Also we have encoders for the drive system and i dont know how to do them either. Can you guys point me in the right direction? Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2013, 18:59
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
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 09:51.

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