robotpy / robotpy-commands-v2

Python implementation of the WPILib Command Framework (2020+)
Other
2 stars 14 forks source link

[BUG]: commands2.CommandBase.runOnce() not implemented. #15

Closed BerkeSinanYetkin closed 1 year ago

BerkeSinanYetkin commented 1 year ago

Problem description

I'm writing a frisbeebot example as per #49 Issue in robotpy/examples

Unlike wpilibj, runOnce() does not exist in the commands2 package.

grep "runOnce" .local/lib/python3.10/site-packages/*.py does not return anything.

Operating System

Linux

Installed Python Packages

Package                      Version
---------------------------- ---------------
absl-py                      1.3.0
aiohttp                      3.8.1
aiosignal                    1.2.0
apturl                       0.5.2
arandr                       0.1.10
astunparse                   1.6.3
async-generator              1.10
async-timeout                4.0.2
attrs                        22.1.0
bcrypt                       3.2.0
beautifulsoup4               4.11.1
black                        21.10b0
blinker                      1.4
Brlapi                       0.8.3
cachetools                   5.2.0
certifi                      2022.6.15.1
chardet                      4.0.0
charset-normalizer           2.1.1
chrome-gnome-shell           0.0.0
click                        8.0.3
colorama                     0.4.4
command-not-found            0.3
cryptography                 3.4.8
cupshelpers                  1.0
cv                           1.0.0
cycler                       0.11.0
dbus-python                  1.2.18
defer                        1.0.6
discord.py                   2.0.1
distro                       1.7.0
distro-info                  1.1build1
duplicity                    0.8.21
fasteners                    0.14.1
flatbuffers                  22.12.6
fonttools                    4.37.1
frozenlist                   1.3.1
future                       0.18.2
gast                         0.4.0
google-auth                  2.15.0
google-auth-oauthlib         0.4.6
google-pasta                 0.2.0
gpg                          1.16.0-unknown
grpcio                       1.51.1
h11                          0.13.0
h5py                         3.7.0
httplib2                     0.20.2
idna                         3.3
importlib-metadata           4.6.4
iniconfig                    1.1.1
jeepney                      0.7.1
keras                        2.11.0
keyring                      23.5.0
kiwisolver                   1.4.4
labelImg                     1.8.6
language-selector            0.1
launchpadlib                 1.10.16
lazr.restfulclient           0.14.4
lazr.uri                     1.0.6
libclang                     14.0.6
lockfile                     0.12.2
louis                        3.20.0
lxml                         4.9.1
macaroonbakery               1.3.1
Mako                         1.1.3
Markdown                     3.4.1
MarkupSafe                   2.1.1
matplotlib                   3.5.3
monotonic                    1.6
more-itertools               8.10.0
multidict                    6.0.2
mypy-extensions              0.4.3
netifaces                    0.11.0
numpy                        1.23.3
oauthlib                     3.2.0
olefile                      0.46
opencv-python                4.6.0.66
opt-einsum                   3.3.0
outcome                      1.2.0
packaging                    21.3
pandas                       1.4.4
paramiko                     2.9.3
pathspec                     0.9.0
pexpect                      4.8.0
Pillow                       9.0.1
Pint                         0.19.2
pip                          22.0.2
pkgconfig                    1.5.5
platformdirs                 2.5.1
pluggy                       1.0.0
protobuf                     3.12.4
ptyprocess                   0.7.0
py                           1.11.0
pyasn1                       0.4.8
pyasn1-modules               0.2.8
pycairo                      1.20.1
pycryptodomex                3.11.0
pycups                       2.0.1
pyfrc                        2022.1.5
Pygments                     2.11.2
PyGObject                    3.42.1
PyJWT                        2.3.0
pymacaroons                  0.13.0
PyNaCl                       1.5.0
pynetconsole                 2.0.4
pynetworktables              2021.0.0
pyntcore                     2022.4.1.0
pyparsing                    2.4.7
PyQt5                        5.15.6
PyQt5-sip                    12.9.1
pyRFC3339                    1.1
PySocks                      1.7.1
pytest                       7.1.3
pytest-reraise               2.1.1
python-apt                   2.3.0+ubuntu2.1
python-dateutil              2.8.1
python-debian                0.1.43ubuntu1
python-dotenv                0.21.0
pytz                         2022.1
PyVirtualDisplay             3.0
pyxattr                      0.7.2
pyxdg                        0.27
PyYAML                       5.4.1
reportlab                    3.6.8
requests                     2.25.1
requests-oauthlib            1.3.1
robotpy                      2022.4.8
robotpy-commands-v1          2022.4.1.0
robotpy-commands-v2          2022.4.1.1
robotpy-ctre                 2022.1.1
robotpy-hal                  2022.4.1.2
robotpy-halsim-gui           2022.4.1.1
robotpy-installer            2022.1.1
robotpy-navx                 2022.0.2
robotpy-photonvision         2022.1.1
robotpy-rev                  2022.0.1
robotpy-romi                 2022.2.1.0
robotpy-wpilib-utilities     2022.0.5
robotpy-wpimath              2022.4.1.3
robotpy-wpiutil              2022.4.1.2
rsa                          4.9
SecretStorage                3.3.1
selenium                     4.4.3
setuptools                   59.6.0
six                          1.16.0
sniffio                      1.3.0
sortedcontainers             2.4.0
soupsieve                    2.3.2.post1
systemd-python               234
teachable-machine            1.0
tensorboard                  2.11.0
tensorboard-data-server      0.6.1
tensorboard-plugin-wit       1.8.1
tensorflow                   2.11.0
tensorflow-estimator         2.11.0
tensorflow-io-gcs-filesystem 0.28.0
termcolor                    2.1.1
tomli                        2.0.1
torbrowser-launcher          0.3.3
tqdm                         4.64.1
trio                         0.21.0
trio-websocket               0.9.2
typing-extensions            3.10.0.2
ubuntu-advantage-tools       27.11.3
ubuntu-drivers-common        0.0.0
ufw                          0.36.1
unattended-upgrades          0.1
urllib3                      1.26.5
usb-creator                  0.3.7
vboxapi                      1.0
wadllib                      1.3.6
webdriver-manager            3.8.3
Werkzeug                     2.2.2
wheel                        0.37.1
wpilib                       2022.4.1.6
wrapt                        1.14.1
wsproto                      1.2.0
xdg                          5
xkit                         0.0.0
yarl                         1.8.1
youtube-dl                   2021.12.17
zipp                         1.0.0

Reproducible example code

grep "runOnce" .local/lib/python3.10/site-packages/*.py
BerkeSinanYetkin commented 1 year ago

@auscompgeek @PeterJohnson @virtuald @calcmogul If you give me the go-ahead I might try to implement it on my own, though i have no experience with these stuff.

virtuald commented 1 year ago

There's a whole pile of decorator methods that were introduced in 2023 beta that I haven't gotten around to implementing, this might be one of them? Feel free to do it.

Also, check C++, since that's what we're forking.

auscompgeek commented 1 year ago

Weird, that factory should be available as commands2.cmd.runOnce.

BerkeSinanYetkin commented 1 year ago

Weird, that factory should be available as commands2.cmd.runOnce.

Well, turns out it was available! Just rebuilt it from source and they are there.

There's a whole pile of decorator methods that were introduced in 2023 beta that I haven't gotten around to implementing, this might be one of them? Feel free to do it.

Also, check C++, since that's what we're forking.

It was one of the those new 2023 decorators, Being the smart cookie that i am, i just wasn't on the beta.

Sorry for the inconvenience.