From a951aed2792e5daeb820f298d58be64be53c879d Mon Sep 17 00:00:00 2001 From: Yannick Richter Date: Mon, 9 Jan 2023 17:20:18 +0100 Subject: [PATCH] Fixed VESC slider rounding --- vesc_ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vesc_ui.py b/vesc_ui.py index 82b1f7b0..d06e9e95 100644 --- a/vesc_ui.py +++ b/vesc_ui.py @@ -116,7 +116,7 @@ def torqueCb(self,v): def posCb(self,v): vesc_encoder_position = ( 360 * v ) / 1000000000 self.label_pos.setText("{:.2f}".format(vesc_encoder_position)) - self.horizontalSlider_pos.setValue(vesc_encoder_position) + self.horizontalSlider_pos.setValue(int(round(vesc_encoder_position))) def errorCb(self,dat): txt = "Ok"