Skip to content

Commit

Permalink
cleanup and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gerth2 committed Oct 20, 2024
1 parent 3400e5f commit a17dd96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions drivetrain/poseEstimation/drivetrainPoseTelemetry.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import math

import wpilib
from wpimath.units import metersToFeet
from wpimath.trajectory import Trajectory
from wpimath.geometry import Pose2d, Pose3d, Transform2d, Rotation2d, Translation2d
from ntcore import NetworkTableInstance

from utils.signalLogging import addLog
from utils.allianceTransformUtils import transform
from drivetrain.drivetrainPhysical import ROBOT_TO_FRONT_CAM, ROBOT_TO_LEFT_CAM, ROBOT_TO_RIGHT_CAM, robotToModuleTranslations
from wrappers.wrapperedPoseEstPhotonCamera import CameraPoseObservation
Expand Down
9 changes: 2 additions & 7 deletions robot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import math
import random
import sys
import cProfile, pstats
from line_profiler import LineProfiler
import wpilib
from dashboard import Dashboard
from drivetrain.controlStrategies.autoDrive import AutoDrive
Expand All @@ -13,8 +9,7 @@
from humanInterface.ledControl import LEDControl
from navigation.forceGenerators import PointObstacle
from utils.segmentTimeTracker import SegmentTimeTracker
from utils.signalLogging import addLog, addLog, update
import utils.signalLogging
from utils.signalLogging import logUpdate
from utils.calibration import CalibrationWrangler
from utils.faults import FaultWrangler
from utils.crashLogger import CrashLogger
Expand Down Expand Up @@ -84,7 +79,7 @@ def robotPeriodic(self):
self.ledCtrl.update()
self.stt.mark("LED Ctrl")

update()
logUpdate()
self.stt.end()

#########################################################
Expand Down
3 changes: 1 addition & 2 deletions utils/signalLogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import wpiutil.log as wpilog # pylint: disable=import-error,no-name-in-module
from utils.extDriveManager import ExtDriveManager
from utils.singleton import Singleton
from collections import defaultdict


BASE_TABLE = "SmartDashboard"
Expand Down Expand Up @@ -76,7 +75,7 @@ def newLogVal(self, name:str, valGetter:Callable[[],float], units:str|None):

_singletonInst = SignalWrangler() # cache a reference
# Log a new named value
def update():
def logUpdate():
_singletonInst.update()

def addLog(alias: str, value_getter: Callable[[], float], units=None) -> None:
Expand Down

0 comments on commit a17dd96

Please sign in to comment.