Skip to content

Commit

Permalink
Add method signature overrides and format docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Nov 27, 2023
1 parent 43c6a07 commit b0673e4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
8 changes: 3 additions & 5 deletions docs/agents/wiregrid_actuator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ The main functions are ``insert()`` and ``eject()``.
In the both of the functions, after the inserting/ejecting, the stopper locks the actuators again.
However, the motor power is not turned ON or OFF during the both functions.

The parameter details are here:
- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2)
DO NOT use speedrate > 1.0 if el != 90 deg!!

**Test Functions**
- check_limitswitch(): Check ON/OFF of the limit switches
- check_stopper(): Check ON/OFF (lock/unlock) of the stoppers
Expand All @@ -103,7 +99,9 @@ The parameter details are here:

- distance: Actuator moving distance [mm] (default: 10)
- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2)
DO NOT use speedrate > 1.0 if el != 90 deg!!

.. warning::
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!


Hardware Configurations
Expand Down
28 changes: 16 additions & 12 deletions socs/agents/wiregrid_actuator/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,16 @@ def _eject(self, main_distance=920, main_speedrate=1.0):
check=lambda x: 0.0 < x <= 5.0)
@ocs_agent.param('high_speed', default=False, type=bool)
def insert(self, session, params=None):
"""insert()
"""insert(speedrate=1.0, high_speed=False)
**Task** - Insert the wire-grid into the forebaffle interface above the
SAT.
Parameters:
speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0)
DO NOT use speedrate > 1.0 if el != 90 deg!!
high_speed (bool): If False, speedrate is limited to 1.0
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!
high_speed (bool): If False, speedrate is limited to 1.0. Defaults
to False.
"""
# Get parameters
speedrate = params.get('speedrate')
Expand Down Expand Up @@ -321,15 +322,16 @@ def insert(self, session, params=None):
check=lambda x: 0.0 < x <= 5.0)
@ocs_agent.param('high_speed', default=False, type=bool)
def eject(self, session, params=None):
"""eject()
"""eject(speedrate=1.0, high_speed=False)
**Task** - Eject the wire-grid from the forebaffle interface above the
SAT.
Parameters:
speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0)
DO NOT use speedrate > 1.0 if el != 90 deg!!
high_speed (bool): If False, speedrate is limited to 1.0
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!
high_speed (bool): If False, speedrate is limited to 1.0. Defaults
to False.
"""
# Get parameters
speedrate = params.get('speedrate')
Expand Down Expand Up @@ -484,16 +486,17 @@ def eject_homing(self, session, params=None):
check=lambda x: 0.0 < x <= 5.0)
@ocs_agent.param('high_speed', default=False, type=bool)
def insert_test(self, session, params):
"""insert_test(distance=10, speedrate=0.1)
"""insert_test(distance=10, speedrate=0.2, high_speed=False)
**Task** - Insert slowly the wire-grid into the forebaffle interface
above the SAT with a small distance.
Parameters:
distance (float): Actuator moving distance [mm] (default: 10)
speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2)
DO NOT use speedrate > 1.0 if el != 90 deg!!
high_speed (bool): If False, speedrate is limited to 1.0
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!
high_speed (bool): If False, speedrate is limited to 1.0. Defaults
to False.
"""
# Get parameters
distance = params.get('distance')
Expand Down Expand Up @@ -541,16 +544,17 @@ def insert_test(self, session, params):
check=lambda x: 0.0 < x <= 5.0)
@ocs_agent.param('high_speed', default=False, type=bool)
def eject_test(self, session, params):
"""eject_test(distance=10, speedrate=0.1)
"""eject_test(distance=10, speedrate=0.2, high_speed=False)
**Task** - Eject slowly the wire-grid from the forebaffle interface
above the SAT with a small distance.
Parameters:
distance (float): Actuator moving distance [mm] (default: 10)
speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2)
DO NOT use speedrate > 1.0 if el != 90 deg!!
high_speed (bool): If False, speedrate is limited to 1.0
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!
high_speed (bool): If False, speedrate is limited to 1.0. Defaults
to False.
"""
# Get parameters
distance = params.get('distance', 10)
Expand Down

0 comments on commit b0673e4

Please sign in to comment.