[BUG]: Vauge runtime error: Unable to cast Python instance to C++ type
KenwoodFox opened this issue · 1 comments
KenwoodFox commented
Problem description
This issue comes from here: FRC-1721/1721-ChargedUp#10 and was discussed on the robotpy gitter.
When trying to execute the example code, the robot will lockup and produce this error. Not really telling you much about where it comes from.
Operating System
Linux
Installed Python Packages
Package Version
------------------------ ----------
pip 22.3.1
pyntcore 2023.2.1.0
PyYAML 6.0
robotpy 2023.2.1
robotpy-commands-v2 2023.2.1.0
robotpy-ctre 2023.0.0
robotpy-hal 2023.2.1.0
robotpy-rev 2023.1.2
robotpy-wpilib-utilities 2023.0.0
robotpy-wpimath 2023.2.1.0
robotpy-wpinet 2023.2.1.0
robotpy-wpiutil 2023.2.1.0
setuptools 65.5.0
wpilib 2023.2.1.0
Reproducible example code
# Stabilize robot to drive straight with gyro (software diff lock)
commands2.button.JoystickButton(
self.driverController, self.driveConsts["DiffLock"]
).whileTrue(
commands2.PIDCommand(
wpimath.controller.PIDController(
self.pidConsts["drive"]["kStabilizationP"],
self.pidConsts["drive"]["kStabilizationI"],
self.pidConsts["drive"]["kStabilizationD"],
),
# Close the loop on the turn rate
self.robotDrive.getTurnRate,
# Setpoint is 0xxx
0,
# Pipe the output to the turning controls
lambda output: self.robotDrive.arcadeDrive(
-self.driverController.getLeftY(), output
),
# Require the robot drive
[self.robotDrive],
)
)virtuald commented
OBE because of migration to pure python command framework.