Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in speed_rate limitation in wiregrid_actuator/drivers/Actuator.py #579

Merged
merged 8 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/agents/wiregrid_actuator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```````````````````````
Expand Down
8 changes: 4 additions & 4 deletions socs/agents/wiregrid_actuator/drivers/Actuator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down