Skip to content

Add StatusSignalRefresher and update MotorIOTalonFX to use it#249

Merged
aidnem merged 4 commits intomainfrom
248-add-statussignal-refresher
Mar 2, 2026
Merged

Add StatusSignalRefresher and update MotorIOTalonFX to use it#249
aidnem merged 4 commits intomainfrom
248-add-statussignal-refresher

Conversation

@aidnem
Copy link
Copy Markdown
Contributor

@aidnem aidnem commented Mar 2, 2026

Adds a StatusSignalRefresher based on team422's CtreBaseRefreshManager.

Updates MotorIOTalonFX to use this signal refresher.

@aidnem aidnem linked an issue Mar 2, 2026 that may be closed by this pull request
1 task
@aidnem aidnem requested a review from godmar March 2, 2026 13:52
Copy link
Copy Markdown
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

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

Easy enough. Good to have confirmation from another team.

Could be further optimized.

* @param signal A BaseStatusSignal to add
*/
public static void addSignal(CANBus bus, BaseStatusSignal signal) {
if (!canBusToSignalsMap.containsKey(bus)) {
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.

ditto

@aidnem aidnem requested a review from godmar March 2, 2026 16:34
Copy link
Copy Markdown
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

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

I think it can be more optimized a bit

@aidnem aidnem requested a review from godmar March 2, 2026 16:47
@aidnem aidnem enabled auto-merge (squash) March 2, 2026 17:22
Copy link
Copy Markdown
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

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

OK

* CommandScheduler.getInstance().run()} in the robot periodic to work properly.
*/
public static void refreshAll() {
if (canBusToSignalsMap.isEmpty()) {
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.

This check is redundant. If canBusToSignalsMap is empty, then buses.length == 0 and the next loop will be skipped.

@aidnem aidnem merged commit c42ac0a into main Mar 2, 2026
6 checks passed
godmar added a commit that referenced this pull request Mar 2, 2026
aidnem added a commit that referenced this pull request Mar 3, 2026
* (#246) Add arbitrary feedforward support

* (#246) Rename arbitrary to supplemental, fix typo in javadoc mixing up spark with talon

* (#246) Name back to arbitrary at preston's request

* (#246) Add arb FF voltage option for SparkMax IOs

* (#249) removed redundant if() in refreshAll

(this is logically part of #249)

---------

Co-authored-by: Godmar Back <godmar@gmail.com>
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.

Add single StatusSignal refresher

2 participants