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

SendableRegistry Add/AddLW/AddChild are broken #83

Open
virtuald opened this issue Mar 2, 2024 · 0 comments
Open

SendableRegistry Add/AddLW/AddChild are broken #83

virtuald opened this issue Mar 2, 2024 · 0 comments
Labels
bug Something isn't working package: wpiutil subprojects/robotpy-wpiutil

Comments

@virtuald
Copy link
Member

virtuald commented Mar 2, 2024

They are trying to use keep alives to keep the pointers alive but it's not the right solution.

Probably need to do the same thing we do for SmartDashboard with a separate hash map to hold references.

import wpilib
import wpilib.drive
import wpiutil

leftLeader = wpilib.PWMSparkMax(1)
rightLeader = wpilib.PWMSparkMax(2)
drive = wpilib.drive.DifferentialDrive(
            leftLeader,
            rightLeader,
        )

wpiutil.SendableRegistry.addChild(drive, leftLeader)
$ python ../../t.py 
Traceback (most recent call last):
  File "../../t.py", in <module>
    wpiutil.SendableRegistry.addChild(drive, leftLeader)
RuntimeError: Could not activate keep_alive!
@auscompgeek auscompgeek added bug Something isn't working package: wpiutil subprojects/robotpy-wpiutil labels Dec 30, 2024
@auscompgeek auscompgeek moved this to Ready in 2025 Season Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: wpiutil subprojects/robotpy-wpiutil
Projects
Status: Ready
Development

No branches or pull requests

2 participants