Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent color sensor calls when not needed. #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 16, 2022

  1. Prevent color sensor calls when not needed.

    This small change means the color sensor will only be called when the code asks instead of always.
    
    The code happens to always call the color sensor UNLESS the switch closest to the shooter is pressed.
    
    Hopefully this break in color sensor calls can fix the issue.
    
    In match 105 at DCMP, ColorSensorSubsystem.periodic was reported at taking 0.35s.
    
    Here is my detailed notes on what I found reading the driverstation logs:
    
    Loop overrun message, displays time of each subsystem/command:
    Match 68 -> All ColorSensorSubsystem.periodic were below 0.0025s
    Match 95 -> All ColorSensorSubsystem.periodic were below 0.0025s
    Match 105 Auto Period -> All ColorSensorSubsystem.periodic were below 0.0025s
    Match 105 Tele Period -> ALL ColorSensorSubsystem.periodic were ABOVE 0.35s
    The moment teleoperated started, ColorSensorSubsystem.periodic() was taking way too long to run.
    Motor safety was saying "hey, I haven't gotten a new percent output for the drivetrain motors in awhile I'm going to stop the motors from moving."
    
    Battery Voltage reported from the driver station, voltage was a flat line for over 20 seconds :
    Beginning of the match = 12.7 V
    End of the match = 12.3 V
    Number of reported brownouts = 7
    ErikCald committed Apr 16, 2022
    Configuration menu
    Copy the full SHA
    76a4fb7 View commit details
    Browse the repository at this point in the history