Skip to content

Commit

Permalink
Fixed differential drive sliders publishing old data
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Jan 31, 2024
1 parent b49f0ca commit 7a88935
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/widgets/nt_widgets/multi-topic/differential_drive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ class DifferentialDrive extends NTWidget {
ntConnection.nt4Client.publishTopic(leftSpeedTopic!);
}

ntConnection.updateDataFromTopic(leftSpeedTopic!, value);
ntConnection.updateDataFromTopic(
leftSpeedTopic!, leftSpeedCurrentValue);

leftSpeedPreviousValue = value;
leftSpeedPreviousValue = leftSpeedCurrentValue;
},
),
],
Expand Down Expand Up @@ -210,9 +211,10 @@ class DifferentialDrive extends NTWidget {
ntConnection.nt4Client.publishTopic(rightSpeedTopic!);
}

ntConnection.updateDataFromTopic(rightSpeedTopic!, value);
ntConnection.updateDataFromTopic(
rightSpeedTopic!, rightSpeedCurrentValue);

rightSpeedPreviousValue = value;
rightSpeedPreviousValue = rightSpeedCurrentValue;
},
),
],
Expand Down

0 comments on commit 7a88935

Please sign in to comment.