127
127
128
128
def convert_ticks_to_degrees (ticks , model ):
129
129
resolutions = MODEL_RESOLUTION [model ]
130
- # Convert the ticks to degrees
131
- return ticks * (360.0 / resolutions )
130
+ # Convert the ticks to degrees
131
+ return ticks * (360.0 / resolutions )
132
132
133
133
134
134
def convert_degrees_to_ticks (degrees , model ):
135
135
resolutions = MODEL_RESOLUTION [model ]
136
136
# Convert degrees to motor ticks
137
- return int (degrees * (resolutions / 360.0 ))
137
+ return int (degrees * (resolutions / 360.0 ))
138
138
139
139
140
140
def adjusted_to_homing_ticks (
@@ -158,7 +158,7 @@ def adjusted_to_homing_ticks(
158
158
drive_mode = 0
159
159
if motorbus .calibration is not None :
160
160
drive_mode = motorbus .calibration ["drive_mode" ][motor_id - 1 ]
161
-
161
+
162
162
if drive_mode :
163
163
ticks *= - 1
164
164
@@ -177,7 +177,7 @@ def adjusted_to_motor_ticks(
177
177
drive_mode = 0
178
178
if motorbus .calibration is not None :
179
179
drive_mode = motorbus .calibration ["drive_mode" ][motor_id - 1 ]
180
-
180
+
181
181
if drive_mode :
182
182
adjusted_pos *= - 1
183
183
@@ -508,7 +508,6 @@ def revert_calibration(self, values: np.ndarray | list, motor_names: list[str] |
508
508
values = np .round (values ).astype (np .int32 )
509
509
return values
510
510
511
-
512
511
def read_with_motor_ids (self , motor_models , motor_ids , data_name , num_retry = NUM_READ_RETRY ):
513
512
if self .mock :
514
513
import tests .mock_scservo_sdk as scs
@@ -736,4 +735,3 @@ def disconnect(self):
736
735
def __del__ (self ):
737
736
if getattr (self , "is_connected" , False ):
738
737
self .disconnect ()
739
-
0 commit comments