From df0b372d07e75f1328331b03efc8fe5613183a38 Mon Sep 17 00:00:00 2001 From: laurensvalk Date: Tue, 25 Oct 2022 10:19:30 +0200 Subject: [PATCH] droid-commander: Drop limit adjustments. (#72) Changing the limits should no longer be required just to change the acceleration. --- sets/boost/droid-commander/r2-d2/main.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sets/boost/droid-commander/r2-d2/main.py b/sets/boost/droid-commander/r2-d2/main.py index 2ce651d..ad1c0c2 100644 --- a/sets/boost/droid-commander/r2-d2/main.py +++ b/sets/boost/droid-commander/r2-d2/main.py @@ -1,6 +1,6 @@ from pybricks.hubs import MoveHub from pybricks.pupdevices import ColorDistanceSensor, Motor -from pybricks.parameters import Port, Stop, Color, Direction +from pybricks.parameters import Port, Direction from pybricks.robotics import DriveBase from pybricks.tools import wait @@ -26,11 +26,6 @@ sensor = ColorDistanceSensor(Port.C) # The gears are configured for the head. actuator = Motor(Port.D, Direction.COUNTERCLOCKWISE, gears=(24, 40)) - -# Work around . -drive.distance_control.limits(duty=100) - - ################################# # Define some helpful functions # ################################# @@ -52,11 +47,9 @@ def stand_up(): # Save the old settings to restore later. settings = drive.settings() - limits = drive.distance_control.limits() # Set speed and acceleration high so that # we can make R2-D2 jerk forward or backward. - drive.distance_control.limits(1000, 5000) drive.settings(1000, 5000) # Drive quickly and stop to make R2-D2 change position. @@ -65,7 +58,6 @@ def stand_up(): # Restore the old settings. drive.settings(*settings) - drive.distance_control.limits(*limits) drive.straight(-40) wait(500) @@ -116,7 +108,6 @@ print('starting:', 'upright' if is_upright() else 'tripod') # If you want to adjust the settings, it can be useful # to print the defaults so you know where to start. # print('default drive settings', drive.settings()) -# print('default drive limits', drive.distance_control.limits()) ################