From 4ed787240ebb24ef18e3d525c8e4f3dea67d06c8 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Tue, 28 Jan 2020 17:53:11 +0100 Subject: [PATCH] api/builtins: drop motor setting setters this will be done through the control attribute instead --- doc/api/signaltypes.rst | 5 ++- pybricks/builtins.py | 86 ----------------------------------------- 2 files changed, 3 insertions(+), 88 deletions(-) diff --git a/doc/api/signaltypes.rst b/doc/api/signaltypes.rst index ec6908c..b9e0e2d 100644 --- a/doc/api/signaltypes.rst +++ b/doc/api/signaltypes.rst @@ -39,8 +39,9 @@ rotational speed: deg/s Rotational speed, or *angular velocity* describes how fast something rotates, expressed as the number of degrees per second (deg/s). -For example, the rotational speed values of a ``Motor`` or the :meth:`GyroSensor -<.ev3devices.GyroSensor.speed>` are expressed in degrees per second. +For example, the rotational speed values of a ``Motor`` or the +:meth:`GyroSensor <.ev3devices.GyroSensor.speed>` are expressed in degrees +per second. While we recommend working with degrees per second in your programs, you can use the following table to convert between commonly used units. diff --git a/pybricks/builtins.py b/pybricks/builtins.py index aed23f0..ccde1ad 100644 --- a/pybricks/builtins.py +++ b/pybricks/builtins.py @@ -27,36 +27,6 @@ class DCMotor(): """ pass - def set_dc_settings(self, duty_limit, duty_offset): - """Configure the settings to adjust the behavior of the :meth:`.dc` - command. This also affects all of the ``run`` commands, which use - the :meth:`.dc` method in the background. - - Arguments: - duty_limit (:ref:`percentage`): Relative torque limit during - subsequent motor commands. This - sets the maximum duty cycle that is - applied during any subsequent motor - command. This reduces the maximum - torque output to a percentage of - the absolute maximum stall torque. - This is useful to avoid applying - the full motor torque to a geared - or lever mechanism, or to prevent - your motor from - unintentionally going at full - speed. (*Default*: 100). - duty_offset (:ref:`percentage`): Minimum duty cycle given when you - use :meth:`.dc`. This adds a small - feed forward torque so that your - motor will move even for very low - duty cycle values, which can be - useful when you create your own - feedback controllers - (*Default*: 0). - """ - pass - class Control(): """Class to interact with PID controller and settings.""" @@ -316,62 +286,6 @@ class Motor(DCMotor): """ pass - def set_run_settings(self, max_speed, acceleration): - """Configure the maximum speed and acceleration/deceleration of the - motor for all run commands. - - This applies to the ``run``, ``run_time``, ``run_angle``, - ``run_target``, or ``run_until_stalled`` commands you give the motor. - - Arguments: - max_speed (:ref:`speed`): Maximum speed of the motor during a motor - command. - acceleration (:ref:`acceleration`): Acceleration towards the target - speed and deceleration towards - standstill. This should be a - positive value. The motor will - automatically change the sign - to decelerate as needed. - - """ - pass - - def set_pid_settings(self, kp, ki, kd, tight_loop_limit, angle_tolerance, - speed_tolerance, stall_speed, stall_time): - """Configure the settings of the position and speed controllers. - - Arguments: - kp (int): Proportional position (and integral speed) control - constant. - ki (int): Integral position control constant. - kd (int): Derivative position (and proportional speed) control\ - constant. - tight_loop_limit (:ref:`time`): If you execute any of the ``run`` - commands within this interval after - starting the previous command, the - controllers assume that you want to - control the speed directly. This - means that it will ignore the - acceleration setting and - immediately begin tracking the - speed you give in the ``run`` - command. This is useful in a fast - loop, where you usually want the - motors to respond quickly rather - than accelerate smoothly, for - example with a line-following - robot. - angle_tolerance (:ref:`angle`): Allowed deviation from the target - angle before motion is considered - complete. - speed_tolerance (:ref:`speed`): Allowed deviation from zero speed - before motion is considered - complete. - stall_speed (:ref:`speed`): See :meth:`.stalled`. - stall_time (:ref:`time`): See :meth:`.stalled`. - """ - pass - def dc(self, duty): """Rotate the motor at a given duty cycle (also known as "power").