Skip to content

Commit 78ff69c

Browse files
claim estop on power on only if isn't already acquired (#79)
For spot_driver with estop, if power_off is called, and power_on is called, driver crashes as an error is thrown as it tries to reset estop. Prevent this case. Co-authored-by: bhung-bdai <[email protected]>
1 parent aff9d7d commit 78ff69c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spot_wrapper/wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,8 @@ def power_on(self) -> typing.Tuple[bool, str]:
12841284
"""
12851285
# Don't bother trying to power on if we are already powered on
12861286
if not self.check_is_powered_on():
1287-
# If we are requested to start the estop, we have to acquire it when powering on.
1288-
if self._start_estop:
1287+
# If we are requested to start the estop, we have to acquire it when powering on. Ignore if estop is already acquired.
1288+
if self._start_estop and self._estop_keepalive is None:
12891289
self.resetEStop()
12901290
try:
12911291
self._logger.info("Powering on")

0 commit comments

Comments
 (0)