Skip to content

Commit

Permalink
Merge pull request #216 from thedropbears/comp_tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienMorey authored Jul 24, 2024
2 parents 36f6b97 + cf8847f commit 2d6231b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/intake.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@


class IntakeComponent:
motor_speed = tunable(0.8)
inject_intake_speed = tunable(0.3)
motor_speed = tunable(0.7)
inject_intake_speed = tunable(0.5)
inject_shoot_speed = tunable(1.0)

INTAKE_GEAR_RATIO = 2
Expand Down
14 changes: 12 additions & 2 deletions components/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class VisualLocalizer:
should_log = tunable(True)

last_pose_z = tunable(0.0, writeDefault=False)
linear_vision_uncertainty = tunable(0.04)
rotation_vision_uncertainty = tunable(0.03)
reproj_error_threshold = 1

def __init__(
self,
Expand Down Expand Up @@ -91,11 +94,18 @@ def execute(self) -> None:

self.field_pos_obj.setPose(pose)

if self.add_to_estimator:
if (
self.add_to_estimator
and self.current_reproj < self.reproj_error_threshold
):
self.chassis.estimator.addVisionMeasurement(
pose,
timestamp,
(reprojectionErr * 1.5, reprojectionErr * 1.5, reprojectionErr / 2),
(
self.linear_vision_uncertainty,
self.linear_vision_uncertainty,
self.rotation_vision_uncertainty,
),
)

if self.should_log:
Expand Down

0 comments on commit 2d6231b

Please sign in to comment.