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

Temporarily set talon to disabled before giving a new setpoint in motionmagic mode #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kjaget
Copy link
Member

@kjaget kjaget commented Apr 12, 2019

Hopefully this will cause the talon to path from current encoder value to new setpoint instead of current behavior of pathing from current setpoint to new one

The current behavior seems to be that it assumes it hit the previous setpoint, or if interrupting motion, it is where it thinks it is along the current trajectory. This seems to lead to accumulated error when this is not the case - for example when tuning PID values and the mechanism isn't tracking correctly.

The behavior when disabling and reenabling the robot looks like on the first setpoint after reenable, a new path is generated from the actual encoder position to the desired setpoint. This PR will attempt to recreate that behavior for every new setpoint given to the talon.

NEEDS TO BE TESTED ON HARDWARE BEFORE MERGING. YOU HAVE BEEN WARNED.

@kjaget
Copy link
Member Author

kjaget commented Apr 12, 2019

One possible point of failure - will this correctly handle e.g. swerve rotation where we're likely to give it a new setpoint before it has reached the current one. Does the motion magic code use 0 as the starting velocity or does it get it from encoder data when coming out of disabled?

in motionmagic mode. Hopefully this will cause the talon
to path from current encoder value to new setpoint instead of
current behavior of pathing from current setpoint to new one
@kjaget kjaget removed the request for review from nmullane August 21, 2019 15:39
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

Successfully merging this pull request may close these issues.

1 participant