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

Add support to Talon SRX for an integrated absolute encoder #208

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

WispySparks
Copy link

First time working around the codebase, I went this route because I don't think you can really have a reference to a talon's sensor like you can with revlib. Not sure if this all looks right

@thenetworkgrinch
Copy link
Contributor

This shouldnt work, you didnt create the wrapper for a psuedo absolute encoder like we discussed.

It is a good attempt but I would not accept it in its current state. The other issue is you seem to forget that the absolute encoder is ALWAYS right, the absolute encoder can change the position, NOT the motor controller.

An acceptable trade off which i may consider is implementing both abstractions for motor controllers and absolute encoders in one class but i dont think that will work out well.

@@ -188,7 +190,9 @@ public SwerveMotor createMotor(boolean isDriveMotor)
case "talonfx":
return new TalonFXSwerve(id, canbus != null ? canbus : "", isDriveMotor);
case "talonsrx":
return new TalonSRXSwerve(id, isDriveMotor);
return new TalonSRXSwerve(id, isDriveMotor, FeedbackDevice.QuadEncoder);
case "talonsrx_pwm":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this name, it implies that the SRX is controlled over PWM

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this an alright name for the encoder section?

@thenetworkgrinch
Copy link
Contributor

You can rely on the TalonSRX sensor which is an attached absolute encoder. You just need to create a wrapper which stores the same motor object (NOT CREATE A NEW ONE) and exclusively polls the encoder position in the correct units.

@thenetworkgrinch
Copy link
Contributor

You're getting closer!! Good job!

@thenetworkgrinch
Copy link
Contributor

Last thing is, since this is a larger change than normal, please test this on an actual robot and let us know when you do! Once it is tested it can be merged. (Note: This does NOT need to be tested by you, just an actual robot)

@WispySparks
Copy link
Author

WispySparks commented May 20, 2024

Okay it might be a while until this is able to be tested but I'll let you know

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.

None yet

2 participants