robotpy / robotpy-rev

RobotPy bindings for REV Robotics' REVLib
Other
9 stars 15 forks source link

[BUG]: SparkFlexConfig.apply method overloads are unavailable #68

Open mythgarr opened 3 days ago

mythgarr commented 3 days ago

Problem description

The apply methods defined on SparkBaseConfig cannot be invoked on a SparkFlexConfig object. Calling apply(EncoderConfig()) for example results in a runtime exception:

TypeError: apply(): incompatible function arguments. The following argument types are supported:
    1. (self: rev._rev.SparkFlexConfig, config: rev._rev.SparkFlexConfig) -> rev._rev.SparkFlexConfig
    2. (self: rev._rev.SparkFlexConfig, config: rev._rev.ExternalEncoderConfig) -> rev._rev.SparkFlexConfig

As a workaround the SparkBaseConfig method can be called explicitly:

SparkBaseConfig.apply(config, EncoderConfig())

Operating System

Windows

Installed Python Packages

No response

Reproducible example code

from rev import SparkFlexConfig, EncoderConfig

config = SparkFlexConfig()
config.apply(EncoderConfig())
virtuald commented 3 days ago

This is fixed in #69, but there's an MSVC issue so it's likely that this will have to wait until the next beta release (should be soon). All of the non-MSVC build artifacts are at https://github.com/robotpy/robotpy-rev/actions/runs/11876044988?pr=69 if you really want the fix, but I think your current workaround should be sufficient.