Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 16, 2023
1 parent a0cdf60 commit 6151300
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions socs/agents/hwp_gripper/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def shutdown(self, session, params=None):
for actuator, _ in enumerate(finished):
while not finished[actuator]:
session.data['response'] = self._run_client_func(
self.client.move, 'POS', actuator+1, 0.2, job='shutdown', check_shutdown=False)
self.client.move, 'POS', actuator + 1, 0.2, job='shutdown', check_shutdown=False)

return_dict = self._run_client_func(
self.client.reset, job='shutdown', check_shutdown=False)
Expand All @@ -312,14 +312,13 @@ def shutdown(self, session, params=None):
time.sleep(1)

session.data['response'] = self._run_client_func(
self.client.move, 'POS', actuator+1, -0.5, job='shutdown', check_shutdown=False)
self.client.move, 'POS', actuator + 1, -0.5, job='shutdown', check_shutdown=False)

session.data['response'] = self._run_client_func(
self.client.is_cold, False, job='shutdown', check_shutdown=False)
time.sleep(1)

finished[actuator] = True


session.data['response'] = self._run_client_func(
self.client.brake, True, job='shutdown', check_shutdown=False)
Expand Down Expand Up @@ -357,15 +356,15 @@ def monitor_state(self, session, params=None):
)
except TimeoutError:
self.log.warn('monitor_state: Query Timeout')

now = time.time()

# Dict of the 'GripperState' class from the pru_monitor
state = return_dict['result']
data = {
'last_packet_received': state['last_packet_received'],
}

data.update({
'jxc_setup': int(state['jxc']['setup']),
'jxc_svon': int(state['jxc']['svon']),
Expand Down Expand Up @@ -482,8 +481,8 @@ def main(args=None):

agent, runner = ocs_agent.init_site_agent(args)
gripper_agent = HWPGripperAgent(agent, mcu_ip=args.mcu_ip,
control_port=args.control_port,
supervisor_id=args.supervisor_id)
control_port=args.control_port,
supervisor_id=args.supervisor_id)
agent.register_task('init_connection', gripper_agent.init_connection,
startup=init_params)
agent.register_process('monitor_state', gripper_agent.monitor_state,
Expand Down
4 changes: 2 additions & 2 deletions socs/agents/hwp_supervisor/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,8 @@ def __init__(self, agent, args):
temp_field=self.ybco_temp_field,
temp_thresh=args.ybco_temp_thresh,
ups_minutes_remaining_thresh=args.ups_minutes_remaining_thresh,
iboot_outlet1=int(self.iboot_outlets[0])-1,
iboot_outlet2=int(self.iboot_outlets[1])-1,
iboot_outlet1=int(self.iboot_outlets[0]) - 1,
iboot_outlet2=int(self.iboot_outlets[1]) - 1,
)
self.control_state_machine = ControlStateMachine()
self.forward_is_cw = args.forward_dir == 'cw'
Expand Down

0 comments on commit 6151300

Please sign in to comment.