Skip to content

Commit

Permalink
testing numbers from anglesearch
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjcoderman committed Jul 11, 2024
1 parent 7851331 commit b6aa253
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/config/CompConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ class CompConfig {
},
speakerDistanceToAngle -> {
// speakerDistanceToAngle.put(1.38, 58.1);
speakerDistanceToAngle.put(0.001, 89.99508625230978);
speakerDistanceToAngle.put(2.0, 79.94011474683944);
speakerDistanceToAngle.put(2.5, 83.26693402123773);
speakerDistanceToAngle.put(4.0, 79.05038667991023);
speakerDistanceToAngle.put(4.5, 77.5890447990154);
speakerDistanceToAngle.put(6.0, 72.94243600017876);
speakerDistanceToAngle.put(6.5, 77.72974197361495);
speakerDistanceToAngle.put(8.0, 74.61450991899393);
speakerDistanceToAngle.put(0.001, 89.93829077828299);
speakerDistanceToAngle.put(2.0, 33.32759006321753);
speakerDistanceToAngle.put(2.5, 25.716283037988486);
speakerDistanceToAngle.put(4.0, 23.083493490723104);
speakerDistanceToAngle.put(4.5, 23.23035360296336);
speakerDistanceToAngle.put(6.0, 25.214402600059532);
speakerDistanceToAngle.put(6.5, 19.80715521465698);
speakerDistanceToAngle.put(8.0, 21.52122342119286);
},
floorSpotDistanceToAngle -> {
floorSpotDistanceToAngle.put(3.4, 18.0);
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/generated/shooting_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@
{
"rpm": 3000,
"distance": 0.001,
"angle": 89.99508625230978,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 3000,
"distance": 2.0,
"angle": 79.94011474683944,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4000,
"distance": 2.5,
"angle": 83.26693402123773,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4000,
"distance": 4.0,
"angle": 79.05038667991023,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4000,
"distance": 4.5,
"angle": 77.5890447990154,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4000,
"distance": 6.0,
"angle": 72.94243600017876,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4800,
"distance": 6.5,
"angle": 77.72974197361495,
"angle": 84.79775367936183,
"time_of_flight": 100.0
},
{
"rpm": 4800,
"distance": 8.0,
"angle": 74.61450991899393,
"angle": 84.79775367936183,
"time_of_flight": 100.0
}
]
4 changes: 2 additions & 2 deletions src/main/python/modeling/shooter_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def plot(points: [], start: Point, end: Point, dt: float):
rpos = Point(distance, 0)
projectile_motion = ProjectileMotion(0.02)
modelinfo = Model(rpos,goalpos,rpm)
# angle = Vector.fromradians(getangle(modelinfo,projectile_motion))
angle = Vector.fromradians(modelinfo.get_angle())
angle = Vector.fromradians(getangle(modelinfo,projectile_motion))
# angle = Vector.fromradians(modelinfo.get_angle())
points = projectile_motion.getpoints(Vector(Vector.fromdegrees(angle), modelinfo.get_vel(rpm)), rpos)
time_of_flight = projectile_motion.get_travel_time(points)

Expand Down

0 comments on commit b6aa253

Please sign in to comment.