Skip to content

Commit

Permalink
Merge pull request #2 from automata-tech/update-goto
Browse files Browse the repository at this point in the history
added time and velocity options to goto
  • Loading branch information
LouisBrunner committed Jun 6, 2019
2 parents 86618a1 + d123cf0 commit 0c464eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions automata/Eva.py
Expand Up @@ -162,9 +162,9 @@ def control_run(self, loop=1, wait_for_ready=True):
return self.__http_client.control_run(loop=1, wait_for_ready=True)


def control_go_to(self, joints, wait_for_ready=True):
def control_go_to(self, joints, wait_for_ready=True, velocity=None, time=None):
self.__logger.debug('Eva.control_go_to called')
return self.__http_client.control_go_to(joints, wait_for_ready=True)
return self.__http_client.control_go_to(joints, wait_for_ready=wait_for_ready, velocity=velocity, time=time)


def control_pause(self, wait_for_paused=True):
Expand Down
11 changes: 9 additions & 2 deletions automata/eva_http_client.py
Expand Up @@ -251,8 +251,15 @@ def control_run(self, loop=1, wait_for_ready=True):
self.control_wait_for(RobotState.READY)


def control_go_to(self, joints, wait_for_ready=True):
r = self.api_call('POST', 'controls/go_to', json.dumps({'joints': joints}))
def control_go_to(self, joints, wait_for_ready=True, velocity=None, time=None):
if velocity is not None:
body = json.dumps({'joints': joints, 'velocity': velocity})
elif time is not None:
body = json.dumps({'joints': joints, 'time': time})
else:
body = json.dumps({'joints': joints})

r = self.api_call('POST', 'controls/go_to', body)
if r.status_code != 200:
eva_error('control_go_to error', r)
elif wait_for_ready:
Expand Down

0 comments on commit 0c464eb

Please sign in to comment.