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

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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant