Repository navigation
Refactor Talon HWI: per-joint MotorConfig and revolute joint fix - #61
Merged
Merged
Conversation
… MotorConfig struct - Add MotorConfig struct with configurable encoder_resolution, gear_ratio, distance_per_rev, PID gains, motor inversion, and sensor phase - All talon_control functions now accept MotorConfig instead of using #defines - Fix read() bug: revolute joints now report radians/rad-s instead of meters/m-s - Parse per-joint motor params from URDF (all optional, Pololu 37D defaults) - Update science and arm XACRO files with explicit motor config params - Remove hardcoded 'cansend can0', use configured can_interface - Clean up unused variables and mystery fudge factor in velocity conversion
IshanDutta11
approved these changes
Feb 17, 2026
IshanDutta11
left a comment
Contributor
There was a problem hiding this comment.
Looks good, great work as always, keep in mind the *5 fudge factor.
IshanDutta11
pushed a commit
to IshanDutta11/athena-code
that referenced
this pull request
Feb 17, 2026
… MotorConfig struct (umdloop#61) - Add MotorConfig struct with configurable encoder_resolution, gear_ratio, distance_per_rev, PID gains, motor inversion, and sensor phase - All talon_control functions now accept MotorConfig instead of using #defines - Fix read() bug: revolute joints now report radians/rad-s instead of meters/m-s - Parse per-joint motor params from URDF (all optional, Pololu 37D defaults) - Update science and arm XACRO files with explicit motor config params - Remove hardcoded 'cansend can0', use configured can_interface - Clean up unused variables and mystery fudge factor in velocity conversion
a-cires
pushed a commit
to a-cires/athena-code
that referenced
this pull request
Apr 13, 2026
… MotorConfig struct (umdloop#61) - Add MotorConfig struct with configurable encoder_resolution, gear_ratio, distance_per_rev, PID gains, motor inversion, and sensor phase - All talon_control functions now accept MotorConfig instead of using #defines - Fix read() bug: revolute joints now report radians/rad-s instead of meters/m-s - Parse per-joint motor params from URDF (all optional, Pololu 37D defaults) - Update science and arm XACRO files with explicit motor config params - Remove hardcoded 'cansend can0', use configured can_interface - Clean up unused variables and mystery fudge factor in velocity conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces all hardcoded Pololu 37D motor constants (#defines for encoder resolution, gear ratio, PID gains, etc.) with a per-joint MotorConfig struct that is parsed from URDF parameters, with Pololu defaults as fallback
Fixes a bug where revolute joints (science lift/scoop) reported position in meters and velocity in m/s instead of radians and rad/s
Adds proper revolute joint support: getPositionRadians(), getAngularVelocity(), setVelocityFromAngularVelocity(), setPositionFromJointCommand()
Removes the unexplained *5 fudge factor in the old velocity conversion
Updates science and arm XACRO files with per-joint motor parameters