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

DS402: Remove set_new_home functionality from homing procedure (fixes #246) #250

Merged
merged 1 commit into from
Aug 16, 2021
Merged
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
9 changes: 1 addition & 8 deletions canopen/profiles/p402.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,10 @@ def is_homed(self, restore_op_mode=False):
self.op_mode = previous_op_mode
return homingstatus in ('TARGET REACHED', 'ATTAINED')

def homing(self, timeout=TIMEOUT_HOMING_DEFAULT, set_new_home=True):
def homing(self, timeout=TIMEOUT_HOMING_DEFAULT):
"""Execute the configured Homing method on the node.

:param int timeout: Timeout value (default: 30).
:param bool set_new_home:
Defines if the node should set the home offset object (0x607C) to the current
position after the homing procedure (default: true).
:return: If the homing was complete with success.
:rtype: bool
"""
Expand All @@ -327,10 +324,6 @@ def homing(self, timeout=TIMEOUT_HOMING_DEFAULT, set_new_home=True):
time.sleep(self.INTERVAL_CHECK_STATE)
if time.monotonic() > t:
raise RuntimeError('Unable to home, timeout reached')
if set_new_home:
actual_position = self.sdo[0x6063].raw
self.sdo[0x607C].raw = actual_position # Home Offset
logger.info('Homing offset set to {0}'.format(actual_position))
logger.info('Homing mode carried out successfully.')
return True
except RuntimeError as e:
Expand Down