Skip to content

Commit

Permalink
Updated the standard recovery method (service)
Browse files Browse the repository at this point in the history
  • Loading branch information
DasGuna committed Apr 23, 2024
1 parent b69a286 commit 41b0feb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions armer/robots/ROSRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,13 +1541,18 @@ def recover_cb(self, req: EmptyRequest) -> EmptyResponse: # pylint: disable=no-s
:return: an empty response
:rtype: EmptyResponse
"""
#self.general_executor(q=self.q, collision_ignore=True, workspace_ignore=True)
rospy.loginfo(f"[RECOVER CB] -> Resetting from {self._controller_mode} state to JOINTS [Default]")
self._controller_mode = ControlMode.JOINTS
self.preempted = False

# Recover from Error if set (basic functionality)
if self._controller_mode == ControlMode.ERROR:
rospy.loginfo(f"[RECOVER CB] -> Resetting from ERROR state to JOINTS [Default]")
self._controller_mode = ControlMode.JOINTS
self.preempted = False
else:
rospy.logwarn(f'RECOVER CB] -> Robot [{self.name}] not in ERROR state. Do Nothing.')
#if self._controller_mode == ControlMode.ERROR:
# rospy.loginfo(f"[RECOVER CB] -> Resetting from ERROR state to JOINTS [Default]")
# self._controller_mode = ControlMode.JOINTS
# self.preempted = False
#else:
# rospy.logwarn(f'RECOVER CB] -> Robot [{self.name}] not in ERROR state. Do Nothing.')

return EmptyResponse()

Expand Down

0 comments on commit 41b0feb

Please sign in to comment.