robotpy-pykit 0.2.1__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/LICENSE +1 -1
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/PKG-INFO +1 -1
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/pyproject.toml +1 -1
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/logger.py +6 -1
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/wpilog/wpilogreader.py +6 -4
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/wpilog/wpilogwriter.py +8 -24
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/README.md +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/__init__.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/alertlogger.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/autolog.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/inputs/__init__.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/inputs/loggableds.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/inputs/loggablepowerdistribution.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/inputs/loggablesystemstats.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/logdatareciever.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/loggedrobot.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/logreplaysource.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/logtable.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/logvalue.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/__init__.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggeddashboardchooser.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggednetworkboolean.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggednetworkinput.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggednetworknumber.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggednetworkstring.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggednetworkvalue.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/nt4Publisher.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/wpilog/__init__.py +0 -0
- {robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/wpilog/wpilogconstants.py +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2025 Westwood Robotics. All rights reserved.
|
|
1
|
+
Copyright (c) 2025-2026 Westwood Robotics. All rights reserved.
|
|
2
2
|
|
|
3
3
|
Redistribution and use in source and binary forms, with or without
|
|
4
4
|
modification, are permitted provided that the following conditions are met:
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "robotpy-pykit"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "A logging, telemetry, and replay framework for FRC robots running python"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Luke Maxwell", email = "luke@whsrobotics.org" }]
|
|
@@ -269,7 +269,12 @@ class Logger:
|
|
|
269
269
|
rs = cls.replaySource
|
|
270
270
|
if rs is None or not rs.updateTable(cls.entry):
|
|
271
271
|
print("End of replay reached")
|
|
272
|
-
cls.
|
|
272
|
+
if cls.cycleCount == 1:
|
|
273
|
+
print(
|
|
274
|
+
"[ERROR] This robot did not start properly, is the replay logfile from PyKit?"
|
|
275
|
+
)
|
|
276
|
+
else:
|
|
277
|
+
cls.end()
|
|
273
278
|
raise SystemExit(0)
|
|
274
279
|
|
|
275
280
|
dsStart = RobotController.getFPGATime()
|
|
@@ -5,6 +5,7 @@ from wpiutil.log import DataLogReader, DataLogRecord
|
|
|
5
5
|
from pykit.logreplaysource import LogReplaySource
|
|
6
6
|
from pykit.logtable import LogTable
|
|
7
7
|
from pykit.logvalue import LogValue
|
|
8
|
+
from pykit.wpilog import wpilogconstants
|
|
8
9
|
|
|
9
10
|
T = TypeVar("T")
|
|
10
11
|
|
|
@@ -46,10 +47,8 @@ class WPILOGReader(LogReplaySource):
|
|
|
46
47
|
self.reader = DataLogReader(self.filename)
|
|
47
48
|
self.isValid = (
|
|
48
49
|
self.reader.isValid()
|
|
49
|
-
|
|
50
|
+
and self.reader.getExtraHeader() == wpilogconstants.extraHeader
|
|
50
51
|
)
|
|
51
|
-
print(self.reader.isValid())
|
|
52
|
-
print(self.reader.getExtraHeader())
|
|
53
52
|
self.records = iter(())
|
|
54
53
|
|
|
55
54
|
if self.isValid:
|
|
@@ -61,7 +60,10 @@ class WPILOGReader(LogReplaySource):
|
|
|
61
60
|
self.entryCustomTypes: dict[int, str] = {}
|
|
62
61
|
|
|
63
62
|
else:
|
|
64
|
-
print(
|
|
63
|
+
print(
|
|
64
|
+
"[WPILogReader] invalid data log!\n"
|
|
65
|
+
+ "WPILogReader MUST use a WPILog generated with a WPILOGWriter"
|
|
66
|
+
)
|
|
65
67
|
|
|
66
68
|
def updateTable(self, table: LogTable) -> bool:
|
|
67
69
|
"""
|
|
@@ -6,7 +6,8 @@ from tempfile import gettempdir
|
|
|
6
6
|
from typing import TYPE_CHECKING
|
|
7
7
|
|
|
8
8
|
from hal import MatchType
|
|
9
|
-
from wpilib import
|
|
9
|
+
from wpilib import RobotBase, RobotController
|
|
10
|
+
from wpiutil import DataLogWriter
|
|
10
11
|
from pykit.logdatareciever import LogDataReciever
|
|
11
12
|
from pykit.logger import Logger
|
|
12
13
|
from pykit.logtable import LogTable
|
|
@@ -66,7 +67,7 @@ class WPILOGWriter(LogDataReciever):
|
|
|
66
67
|
if filename is not None
|
|
67
68
|
else f"pykit_{self.randomIdentifier}.wpilog"
|
|
68
69
|
)
|
|
69
|
-
self.autoRename =
|
|
70
|
+
self.autoRename = filename is None
|
|
70
71
|
|
|
71
72
|
def start(self) -> None:
|
|
72
73
|
"""
|
|
@@ -82,16 +83,11 @@ class WPILOGWriter(LogDataReciever):
|
|
|
82
83
|
if os.path.exists(fullPath):
|
|
83
84
|
print("[WPILogWriter] File exists, overwriting")
|
|
84
85
|
os.remove(fullPath)
|
|
85
|
-
if not RobotBase.isReal():
|
|
86
|
-
DataLogManager.stop()
|
|
87
86
|
try:
|
|
88
|
-
|
|
87
|
+
self.log = DataLogWriter(fullPath, wpilogconstants.extraHeader)
|
|
89
88
|
except PermissionError as e:
|
|
90
|
-
print(f"Failed to open WPILOG file! ({e})")
|
|
89
|
+
print(f"[WPILogWriter] Failed to open WPILOG file! ({e})")
|
|
91
90
|
return
|
|
92
|
-
print(DataLogManager.getLogDir())
|
|
93
|
-
DataLogManager.logNetworkTables(False)
|
|
94
|
-
self.log = DataLogManager.getLog()
|
|
95
91
|
|
|
96
92
|
self.isOpen = True
|
|
97
93
|
self.timestampId = self.log.start(
|
|
@@ -106,7 +102,7 @@ class WPILOGWriter(LogDataReciever):
|
|
|
106
102
|
self.entryTypes: dict[str, LogValue.LoggableType] = {}
|
|
107
103
|
self.entryUnits: dict[str, str] = {}
|
|
108
104
|
self.logDate = None
|
|
109
|
-
self.logMatchText =
|
|
105
|
+
self.logMatchText = ""
|
|
110
106
|
|
|
111
107
|
def end(self) -> None:
|
|
112
108
|
"""
|
|
@@ -197,21 +193,9 @@ class WPILOGWriter(LogDataReciever):
|
|
|
197
193
|
if self.filename != filename:
|
|
198
194
|
# Rename log file by closing current and opening new
|
|
199
195
|
print(f"[WPILogWriter] Renaming log to {filename}")
|
|
200
|
-
self.log.stop()
|
|
201
196
|
fullPath = os.path.join(self.folder, self.filename)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
os.remove(fullPath)
|
|
205
|
-
|
|
206
|
-
DataLogManager.stop()
|
|
207
|
-
DataLogManager.start(self.folder, filename)
|
|
208
|
-
self.log = DataLogManager.getLog()
|
|
209
|
-
self.timestampId = self.log.start(
|
|
210
|
-
"/Timestamp",
|
|
211
|
-
LogValue.LoggableType.Integer.getWPILOGType(),
|
|
212
|
-
wpilogconstants.entryMetadata,
|
|
213
|
-
0,
|
|
214
|
-
)
|
|
197
|
+
os.rename(fullPath, os.path.join(self.folder, filename))
|
|
198
|
+
|
|
215
199
|
self.filename = filename
|
|
216
200
|
|
|
217
201
|
# Write timestamp entry
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotpy_pykit-0.2.1 → robotpy_pykit-0.2.3}/src/pykit/networktables/loggeddashboardchooser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|