@@ -143,14 +143,26 @@ def change_servo_id(old_id: int, new_id: int, ip: str) -> None:
143
143
144
144
@cli .command ()
145
145
@click .argument ("servo_id" , type = int )
146
+ @click .option ("--speed" , "-s" , type = int , default = 300 ,
147
+ help = "Calibration speed in degrees per second. Default: 300" )
148
+ @click .option ("--current" , "-c" , type = float , default = 600.0 ,
149
+ help = "Current threshold in mA to detect end stops. Default: 600.0" )
146
150
@click .argument ("ip" , default = DEFAULT_IP )
147
- def start_calibration (servo_id : int , ip : str ) -> None :
148
- """Start calibration for a specific servo."""
151
+ def start_calibration (servo_id : int , speed : int , current : float , ip : str ) -> None :
152
+ """Start calibration for a specific servo.
153
+
154
+ The calibration process will move the servo until it detects end stops based on current draw.
155
+ Use --speed to adjust movement speed and --current to adjust sensitivity."""
149
156
hal = HAL (ip )
150
157
try :
151
- success = hal .servo .start_calibration (servo_id )
158
+ success = hal .servo .start_calibration (
159
+ servo_id ,
160
+ calibration_speed = speed ,
161
+ current_threshold = current
162
+ )
152
163
if success :
153
164
click .echo (f"Calibration started for servo { servo_id } " )
165
+ click .echo (f"Speed: { speed } deg/s, Current threshold: { current } mA" )
154
166
else :
155
167
click .echo (f"Failed to start calibration for servo { servo_id } " )
156
168
except Exception as e :
0 commit comments