From b6aa253ff7811d2570a7a819dc274b1d2f8ca7e2 Mon Sep 17 00:00:00 2001 From: Jordan <117786700+jordanjcoderman@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:45:10 -0700 Subject: [PATCH] testing numbers from anglesearch --- src/main/java/frc/robot/config/CompConfig.java | 16 ++++++++-------- .../frc/robot/generated/shooting_config.json | 16 ++++++++-------- src/main/python/modeling/shooter_model.py | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/frc/robot/config/CompConfig.java b/src/main/java/frc/robot/config/CompConfig.java index 70ceb840..70208065 100644 --- a/src/main/java/frc/robot/config/CompConfig.java +++ b/src/main/java/frc/robot/config/CompConfig.java @@ -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); diff --git a/src/main/java/frc/robot/generated/shooting_config.json b/src/main/java/frc/robot/generated/shooting_config.json index 72145110..89c1cc17 100644 --- a/src/main/java/frc/robot/generated/shooting_config.json +++ b/src/main/java/frc/robot/generated/shooting_config.json @@ -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 } ] \ No newline at end of file diff --git a/src/main/python/modeling/shooter_model.py b/src/main/python/modeling/shooter_model.py index cfcc21dc..079153e2 100644 --- a/src/main/python/modeling/shooter_model.py +++ b/src/main/python/modeling/shooter_model.py @@ -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)