Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ats2014

Conflicts:
	WiredCats2014/nbproject/project.bak.xml
	WiredCats2014/nbproject/project.xml
  • Loading branch information
samcrane8 committed Feb 10, 2014
2 parents 9fad52c + 3856cfb commit 02b2d4a
Show file tree
Hide file tree
Showing 16 changed files with 399 additions and 194 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/TestAutotune/nbproject/private/
/WiredCats2415/nbproject/private/
WiredCats2014/nbproject/project.bak.xml
WiredCats2014/nbproject/project.xml
/WiredCats2014/build/
7 changes: 2 additions & 5 deletions WiredCats2014/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/WiredCats/Documents/NetBeansProjects/WiredCats2014/WiredCats2415/src/edu/wpi/first/wpilibj/templates/commands/CommandArcadeDrive.java</file>
<file>file:/C:/Users/WiredCats/Documents/NetBeansProjects/WiredCats2014/WiredCats2415/src/Utilities/TXTReader.java</file>
<file>file:/C:/Users/WiredCats/Documents/NetBeansProjects/WiredCats2014/WiredCats2415/src/edu/wpi/first/wpilibj/templates/WiredCatsRobot.java</file>
<file>file:/C:/Users/WiredCats/Documents/NetBeansProjects/WiredCats2014/WiredCats2415/src/edu/wpi/first/wpilibj/templates/commands/CommandBase.java</file>
<file>file:/C:/Users/WiredCats/Documents/NetBeansProjects/WiredCats2014/WiredCats2415/src/Utilities/GamePad.java</file>
<file>file:/C:/Users/WiredCats/Documents/GitHub/WiredCats2014/WiredCats2014/src/edu/wpi/first/wpilibj/templates/RobotMap.java</file>
<file>file:/C:/Users/WiredCats/Documents/GitHub/WiredCats2014/WiredCats2014/src/edu/wpi/first/wpilibj/templates/subsystems/SubSystemDrive.java</file>
</group>
</open-files>
</project-private>
174 changes: 86 additions & 88 deletions WiredCats2014/nbproject/project.bak.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,89 @@
This is a sample netbeans project file for a Sun Spot Application project.
You may edit it freely, it doesn't affect the ant-powered build.
-->
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
<name>WiredCats2014</name>
<properties>
<property-file>${user.home}/.sunspotfrc.properties</property-file>
<property-file>build.properties</property-file>
<property-file>${sunspot.home}/default.properties</property-file>
</properties>
<folders>
<source-folder>
<label>src</label>
<type>java</type>
<location>src</location>
</source-folder>
</folders>
<ide-actions>
<action name="build">
<target>jar-app</target>
</action>
<action name="clean">
<target>clean</target>
</action>
<action name="run">
<target>deploy</target>
<target>run</target>
</action>
<action name="rebuild">
<target>clean</target>
<target>jar-app</target>
</action>
<action name="debug">
<target>deploy</target>
<target>debug-run</target>
</action>
<action name="javadoc">
<target>javadoc</target>
</action>
</ide-actions>
<export>
<type>folder</type>
<location>build</location>
<build-target>jar-app</build-target>
</export>
<view>
<items>
<source-folder style="packages">
<label>src</label>
<location>src</location>
</source-folder>
<source-file>
<location>build.xml</location>
</source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="clean"/>
<ide-action name="run"/>
<ide-action name="rebuild"/>
<ide-action name="debug"/>
<ide-action name="javadoc"/>
<action>
<label>Sun SPOT-deploy</label>
<target>deploy</target>
</action>
<action>
<label>Sun SPOT-jar-deploy</label>
<target>jar-deploy</target>
</action>
<separator/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
<compilation-unit>
<package-root>src</package-root>
<classpath mode="boot">${sunspot.home}/lib/squawk.jar</classpath>
<classpath mode="compile">${sunspot.home}/lib/wpilibj.jar:${sunspot.home}/lib/networktables-crio.jar</classpath>
<built-to>build</built-to>
<source-level>1.4</source-level>
</compilation-unit>
</java-data>
</configuration>
</project>
--><project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
<name>WiredCats2415</name>
<properties>
<property-file>${user.home}/.sunspotfrc.properties</property-file>
<property-file>build.properties</property-file>
<property-file>${sunspot.home}/default.properties</property-file>
</properties>
<folders>
<source-folder>
<label>src</label>
<type>java</type>
<location>src</location>
</source-folder>
</folders>
<ide-actions>
<action name="build">
<target>jar-app</target>
</action>
<action name="clean">
<target>clean</target>
</action>
<action name="run">
<target>deploy</target>
<target>run</target>
</action>
<action name="rebuild">
<target>clean</target>
<target>jar-app</target>
</action>
<action name="debug">
<target>deploy</target>
<target>debug-run</target>
</action>
<action name="javadoc">
<target>javadoc</target>
</action>
</ide-actions>
<export>
<type>folder</type>
<location>build</location>
<build-target>jar-app</build-target>
</export>
<view>
<items>
<source-folder style="packages">
<label>src</label>
<location>src</location>
</source-folder>
<source-file>
<location>build.xml</location>
</source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="clean"/>
<ide-action name="run"/>
<ide-action name="rebuild"/>
<ide-action name="debug"/>
<ide-action name="javadoc"/>
<action>
<label>Sun SPOT-deploy</label>
<target>deploy</target>
</action>
<action>
<label>Sun SPOT-jar-deploy</label>
<target>jar-deploy</target>
</action>
<separator/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
<compilation-unit>
<package-root>src</package-root>
<classpath mode="boot">${sunspot.home}\lib\squawk.jar</classpath>
<classpath mode="compile">${sunspot.home}\lib\wpilibj.jar;${sunspot.home}\lib\networktables-crio.jar</classpath>
<built-to>build</built-to>
<source-level>1.4</source-level>
</compilation-unit>
</java-data>
</configuration>
</project>
4 changes: 2 additions & 2 deletions WiredCats2014/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
<compilation-unit>
<package-root>src</package-root>
<classpath mode="boot">${sunspot.home}/lib/squawk.jar</classpath>
<classpath mode="compile">${sunspot.home}/lib/wpilibj.jar:${sunspot.home}/lib/networktables-crio.jar</classpath>
<classpath mode="boot">${sunspot.home}\lib\squawk.jar</classpath>
<classpath mode="compile">${sunspot.home}\lib\wpilibj.jar;${sunspot.home}\lib\networktables-crio.jar</classpath>
<built-to>build</built-to>
<source-level>1.4</source-level>
</compilation-unit>
Expand Down
11 changes: 11 additions & 0 deletions WiredCats2014/src/Utilities/ChezyGyro.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ public double getAngle() {
return scaledValue;
}
}
/**
* Returns the angular velocity of the robot.
* @author Sam Crane
* @return
*/
public double getAngularVelocity(){
if (m_analog == null){
return 0.0;
}
return m_analog.getAverageValue();
}

/**
* Set the gyro type based on the sensitivity.
Expand Down
14 changes: 9 additions & 5 deletions WiredCats2014/src/Utilities/WiredVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,30 @@ public WiredVector() {
* This function adds a value to the Blackbox's list of values
* @param input Value to be added
*/
public void addVal(int input) {
public void addVal(float input) {
valueList.addElement(new OurInteger(input));
}

public int getVal(int index){
public float getVal(int index){
return((OurInteger)valueList.elementAt(index)).i;
}

public int lastElement(){
public float lastElement(){
return ((OurInteger)valueList.lastElement()).i;
}

public void removeFirst(){
if (valueList.elementAt(0) != null) valueList.removeElementAt(0);
}

public int size(){
return valueList.size();
}

private class OurInteger {
public int i;
public float i;

public OurInteger(int i){
public OurInteger(float i){
this.i = i;
}
}
Expand Down
29 changes: 15 additions & 14 deletions WiredCats2014/src/edu/wpi/first/wpilibj/templates/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ public class RobotMap {

public static final int DRIVER = 1;

public static final int DRIVE_LEFT = 2;
public static final int DRIVE_RIGHT = 1;
public static final int DRIVE_GYRO = 2;
public static final int DRIVE_ACCEL = 10;

public static final int ARM_MOTOR = 3;
public static final int ARM_ENCODER_A = 9;
public static final int ARM_ENCODER_B = 8;


// If you are using multiple modules, make sure to define both the port
// number and the module. For example you with a rangefinder:
// public static final int rangefinderPort = 1;
// public static final int rangefinderModule = 1;
//PWM
public static final int DRIVE_LEFT_MOTOR_1 = 1;
public static final int DRIVE_LEFT_MOTOR_2 = 2;
public static final int DRIVE_RIGHT_MOTOR_1 = 3;
public static final int DRIVE_RIGHT_MOTOR_2 = 4;
//analog
public static final int DRIVE_GYRO = 1;
// public static final int DRIVE_ACCEL = 10;
public static final int DRIVE_LOW_SPEED_SOLENOID = 1;
public static final int DRIVE_HIGH_SPEED_SOLENOID = 2;
//digital
public static final int DRIVE_LEFT_ENCODER_A = 1;
public static final int DRIVE_LEFT_ENCODER_B = 2;
public static final int DRIVE_RIGHT_ENCODER_A = 3;
public static final int DRIVE_RIGHT_ENCODER_B = 4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void teleopInit() {
// continue until interrupted by another command, remove
// this line or comment it out.
//autonomousCommand.cancel();

CommandBase.resources.getFromFile("wiredCatsConfig.txt");
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package edu.wpi.first.wpilibj.templates.commands.AutonomousCommands;

import edu.wpi.first.wpilibj.templates.commands.CommandBase;

/**
* Drives in a straight line from whatever orientation
* the robot is in upon execution of the command.
* @author WiredCats
*/
public class CommandStraightDrive extends CommandBase {

public CommandStraightDrive(float distance){

}

protected void initialize() {
}

protected void execute() {
}

protected boolean isFinished() {
return false;
}

protected void end() {
}

protected void interrupted() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package edu.wpi.first.wpilibj.templates.commands.AutonomousCommands;

import edu.wpi.first.wpilibj.templates.commands.CommandBase;

/**
*
* @author WiredCats
*/
public class CommandTurn extends CommandBase {

/**
* Turns this many degrees from the current orientation.
* @param goal the desired orientation.
*/
public CommandTurn(float goal){

}

protected void initialize() {

}

protected void execute() {

}

protected boolean isFinished() {
//TODO
return false;
}

protected void end() {

}

protected void interrupted() {

}

}
Loading

0 comments on commit 02b2d4a

Please sign in to comment.