Skip to content

Commit

Permalink
Merge pull request #3 from Team6083/develop
Browse files Browse the repository at this point in the history
Fix for STSP event
  • Loading branch information
kennhung authored Dec 11, 2018
2 parents 1d5cb64 + 5497b2e commit 3edf0bb
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 8 deletions.
127 changes: 123 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ plugins {
id 'eclipse'
id 'idea'
id "jaci.openrio.gradle.GradleRIO" version "2018.03.06"
id 'maven-publish'
}

apply plugin: 'maven-publish'
apply plugin: 'signing'

dependencies {
compile wpilib()
api 'org.apache.commons:commons-math3:3.6.1'
Expand All @@ -38,15 +40,132 @@ jar {
}
}

group = 'org.team6083'
group = 'com.github.team6083'
version = '0.1.0-alpha'

task sourcesJar(type: Jar) {
classifier = 'sources'
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives jar
archives sourceJar
archives javadocJar
}

signing{
sign configurations.archives
}

publishing {
publications {
mavenJava(MavenPublication) {
customizePom(pom)
groupId project.group
artifactId project.name
version project.version

from components.java

// create the sign pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}

artifact(sourceJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}

// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
repositories {
maven {
url ""
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}

def customizePom(pom) {
pom.withXml {
def root = asNode()

// eliminate test-scoped dependencies (no need in maven central POMs)
root.dependencies.removeAll { dep ->
dep.scope == "test"
}

// add all items necessary for maven central publication
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST

description 'A custom lib for Overlooking robots'
name 'OverRobotLib'
url 'https://github.com/Team6083/OverRobotLib'

organization {
name 'com.github.team6083'
url 'https://github.com/Team6083'
}

issueManagement {
system 'GitHub'
url 'https://github.com/Team6083/OverRobotLib/issues'
}

scm {
url 'git@github.com:Team6083/OverRobotLib.git'
connection 'scm:git:git@github.com:Team6083/OverRobotLib.git'
developerConnection 'scm:git:git@github.com:Team6083/OverRobotLib.git'
}

developers {
developer {
name 'KennHuang'
}
}
}
}
}

model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
}
9 changes: 7 additions & 2 deletions src/main/java/org/team6083/RobotPower.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

public class RobotPower {
private static PowerDistributionPanel pdp;
private static final int PDP_CANID = 1;
private static int PDP_CANID = 1;
private static boolean inited = false;

private int devicePort;

public static void init() {
public static void init(int pdp_CANId) {
if(!inited) {
PDP_CANID = pdp_CANId;
pdp = new PowerDistributionPanel(PDP_CANID);
}
}
Expand All @@ -32,4 +33,8 @@ public static double getTotalCurrent() {
return pdp.getTotalCurrent();
}

public static double getRobotVoltage() {
return pdp.getVoltage();
}

}
4 changes: 2 additions & 2 deletions src/main/java/org/team6083/auto/GyroWalker.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public GyroWalker(Gyro gyro) {
rightPower = 0;
targetAngle = 0;

kP = 0.01;
kI = 0.000001;
kP = 0.005;
kI = 10E-6;

maxPower = 0.7;
maxEdit = 0.5;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/team6083/util/DashBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public void putError() {
SmartDashboard.putNumber(partName + "/status", 2);
}

public void putLeftDis(double leftDis) {
SmartDashboard.putNumber("Left Dis", leftDis);
}

public void putRightDis(double rightDis) {
SmartDashboard.putNumber("Right Dis", rightDis);
}

public static void putGyroAngle(double angle) {
SmartDashboard.putNumber("Gyro/angle", angle);
}

private static void dashboardLoop() {
DriverStation ds = DriverStation.getInstance();

Expand Down

0 comments on commit 3edf0bb

Please sign in to comment.