robotpy / mostrobotpy

Official Repository of python implementation of WPILib components
https://robotpy.github.io
Other
10 stars 11 forks source link

[BUG]: PWMMotorController.addFollower causes segfaults on motor.set #64

Closed auscompgeek closed 8 months ago

auscompgeek commented 8 months ago

Problem description

When adding a follower to a PWMMotorController without keeping a reference to the follower, a subsequent call to .set() will segfault when trying to set the follower.

Operating System

Windows, MacOS, Linux, RoboRIO, Raspbian

Installed Python Packages

No response

Reproducible example code

import wpilib

class Robot(wpilib.TimedRobot):
    def robotInit(self):
        self.motor = wpilib.PWMSparkMax(1)
        self.motor.addFollower(wpilib.PWMSparkMax(2))

    def autonomousPeriodic(self):
        self.motor.set(0.5)
virtuald commented 8 months ago

Lame.