From 24a77aac88b0273fda0a3006efd64d400e5fe0dc Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi <38268229+sadachi5@users.noreply.github.com> Date: Thu, 30 Nov 2023 00:20:31 +0900 Subject: [PATCH] Fix bug in speed_rate limitation in wiregrid_actuator/drivers/Actuator.py (#579) * update wiregrid_actuator.rst * add speedrate parameter in insert/eject() in wiregrid_actuator --- docs/agents/wiregrid_actuator.rst | 7 ++++--- socs/agents/wiregrid_actuator/drivers/Actuator.py | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index 1bcfba852..280b2b2e4 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -77,6 +77,10 @@ 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: 1.0) + **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches - check_stopper(): Check ON/OFF (lock/unlock) of the stoppers @@ -100,9 +104,6 @@ The parameter details are here: - distance: Actuator moving distance [mm] (default: 10) - speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) -.. warning:: - DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! - Hardware Configurations ``````````````````````` diff --git a/socs/agents/wiregrid_actuator/drivers/Actuator.py b/socs/agents/wiregrid_actuator/drivers/Actuator.py index 12265c048..ed5c23b44 100644 --- a/socs/agents/wiregrid_actuator/drivers/Actuator.py +++ b/socs/agents/wiregrid_actuator/drivers/Actuator.py @@ -212,12 +212,12 @@ def move(self, distance, speedrate=0.1): msg = 'Actuator:move(): WARNING!: Did NOT move due to STOP flag.' print(msg) return False - if speedrate < 0. or speedrate > 1.: + if speedrate < 0. or speedrate > 5.: print('Actuator:move(): WARNING!: ' - 'Speedrate should be between 0 and 1.') + 'Speedrate should be between 0 and 5.') print('Actuator:move(): WARNING!: ' - 'Speedrate is sed to 0.1.') - speedrate = 0.1 + 'Speedrate is set to 1.0.') + speedrate = 1.0 speed = \ int(speedrate * (self.speed_max - self.speed_min) + self.speed_min) # distance_count is an absolute value