Skip to content

Commit

Permalink
Merge branch 'Fairbotics' of https://github.com/Team-Optix-3749/Team-…
Browse files Browse the repository at this point in the history
…3749-2024 into Fairbotics
  • Loading branch information
SlushEE0 committed Oct 9, 2024
2 parents 54813c9 + eeea8c0 commit 1c3762f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04

steps:
- uses: actions/checkout@v4

# prevents Dubious Ownership err
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE

# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +777 ./gradlew
working-directory: ./Team-3749-2024

# Runs a single command using the runners shell
- name: Compile and run tests on robot code
run: ./gradlew build
working-directory: ./Team-3749-2024
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public enum ArmStates {
// parameter

// Field Parameters

public static final double speakerHeight = Units.inchesToMeters(78.35);; // likely thing you'll need to tune
public static final double minDistance = 0.9; // / NOTE: Not percise, please check

Expand Down
22 changes: 0 additions & 22 deletions Team-3749-2024/wristRegressoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
x2 = data["Arm Position Deg"].values/180.0 * math.pi
y = data["Gravity Voltage"].values


# if (x1.size != x2.size or x2.size!= y.size):c1
# throw Exception

# Create design matrix
X = np.column_stack((np.ones(x1.size),
x1,
Expand All @@ -40,7 +36,6 @@
x1_str = 'x'
x2_str = 'y'


# Construct the equation string
print(coefficients)

Expand All @@ -57,28 +52,11 @@
equation += f'{coefficients[10]} * {x1_str+"^2"+x2_str+"^2"} '
equation += f'{coefficients[11]} * {x1_str+"^3"+x2_str+"^2"} '


# def predict(x1,x2):
# return coefficients[0] + coefficients[1] * x1 + coefficients[2] * x1**2 + coefficients[3] * x1**3 + coefficients[4] * x2**1 + coefficients[5] * x2**2
rmse = mean_squared_error(y, predicted_y, squared=False)

# Print or use the equation string
print("Equation of the fitted quadratic regression model:")
print(equation)
# print(predicted_y)
# print("Predicition: 15, 0")
# print("0 " + str(predict(0,0)))
# print(predict(15,0))
# print(predict(30,0))
# print("45 " + str(predict(45,0)))
# print(predict(60,0))
# print(predict(75,0))
# print("90 "+ str(predict(90,0)))
# print(predict(105,0))
# print(predict(120,0))
# print("135 " + str(predict(135,0)))
# print(predict(150,0))


print("R Squared")
print(results.rsquared)
Expand Down

0 comments on commit 1c3762f

Please sign in to comment.