-
Notifications
You must be signed in to change notification settings - Fork 0
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
Wrist initial code #27
Conversation
…rom yesterday. also added motor and encoder ports to the list
BaseStatusSignal.refreshAll(wristPosition, wristVelocity, wristCurrent, | ||
wristTemp, wristVoltage); | ||
//Not sure if this is the fastest way to get encoder pos | ||
//needs optimization!!!!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split this into wristRelativePosition and wristAbsolutePosition, and then update accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you set the different positions to? Is relativePosition relative to the ground, and if so would you then set that to its position + the arm's position and keep absolute as wristMotor.getPosition()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm I think I can figure it out based on the arm class
public double getWristDegrees() { | ||
//may need to add arm degrees here | ||
return inputs.wristPosition; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns wrist rotations
|
||
BaseStatusSignal.setUpdateFrequencyForAll(50, wristPosition, wristVelocity, wristVoltage, wristCurrent, wristTemp); | ||
|
||
wristMotor.optimizeBusUtilization(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this for the encoder as well
} | ||
|
||
public void setPosition(double position){ | ||
wristMotor.setControl(motionMagicControl.withPosition(position).withSlot(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.withEnableFOC(true).withOverrideBrakeDurNeutral(true)
😉
//may need to add arm degrees here | ||
return inputs.wristPosition; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add a way to call the IO methods since WristIO is private (and should stay that way)
double currentTime = Timer.getFPGATimestamp(); | ||
io.setPosition(positionInDegrees); | ||
Logger.recordOutput("Wrist target position", positionInDegrees); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe do this in superstructure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want any subsystem specific functions to be intrinsically reliant on another subsystem, aside from vision processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple nitpicks but they're pretty important
-fixed getWristDegrees method to actually get degrees instead of rotations -split position status signal into absolutePosition and relativePosition -made other changes amber suggested (thanks amber!) -deleted setWristVoltage bc it didn't do anything and wasn't used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!
Here it is. Enjoy :)