Skip to content

Refactor Talon HWI: per-joint MotorConfig and revolute joint fix - #61

Merged
IshanDutta11 merged 2 commits into
umdloop:mainfrom
dwarakeshbaraneetharan:talon-fixes
Feb 17, 2026
Merged

IshanDutta11 merged 2 commits into
umdloop:mainfrom
dwarakeshbaraneetharan:talon-fixes

Conversation

@dwarakeshbaraneetharan

Copy link
Copy Markdown
Contributor

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

… 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 IshanDutta11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, great work as always, keep in mind the *5 fudge factor.

@IshanDutta11
IshanDutta11 merged commit b93e73c into umdloop:main Feb 17, 2026
1 check passed
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
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.

2 participants