You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
Today my team was trying to take a characteristic of our robot using the FRC Characterization tool, but are having issues getting proper encoder readouts.
When we got the project generated using the CTRE template and drove the robot forward, we discovered that our right side drive encoders were reading negative values, so we tried to use the Tool’s function to invert the encoder. It turns out, the change that the tool makes in the code was setSensorPhase() which doesn’t work for the TalonFX per this topic: Talon .setSensorPhase issues - Programming - Chief Delphi
When we found this post, I looked in the code and verified that it is using setSelectedSensorPosition, so there isn’t a problem there, but while digging around in the code, we found that is makes use of the WPILib DifferentialDrive class which automatically inverts the right side drive power.
This function of DifferentialDrive seems to cause an issue where the right side drive will always drive opposite of the internal encoder’s value.
The text was updated successfully, but these errors were encountered:
Is this actually an issue when analyzing the data? The analyzer takes the absolute value of the encoder measurements and applies the sign of the voltage to compensate for these weird scenarios.
In addition to what Prateek said, as far as I know you should still be able to get all the inversions right, it's just that the right side might be flipped in a way that it isn't if you don't use DifferentialDrive.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Today my team was trying to take a characteristic of our robot using the FRC Characterization tool, but are having issues getting proper encoder readouts.
When we got the project generated using the CTRE template and drove the robot forward, we discovered that our right side drive encoders were reading negative values, so we tried to use the Tool’s function to invert the encoder. It turns out, the change that the tool makes in the code was setSensorPhase() which doesn’t work for the TalonFX per this topic: Talon .setSensorPhase issues - Programming - Chief Delphi
When we found this post, I looked in the code and verified that it is using setSelectedSensorPosition, so there isn’t a problem there, but while digging around in the code, we found that is makes use of the WPILib DifferentialDrive class which automatically inverts the right side drive power.
This function of DifferentialDrive seems to cause an issue where the right side drive will always drive opposite of the internal encoder’s value.
The text was updated successfully, but these errors were encountered: