diff --git a/automata/Eva.py b/automata/Eva.py index d831a7e..a17a1e3 100644 --- a/automata/Eva.py +++ b/automata/Eva.py @@ -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): diff --git a/automata/eva_http_client.py b/automata/eva_http_client.py index 98ed07d..14a5587 100644 --- a/automata/eva_http_client.py +++ b/automata/eva_http_client.py @@ -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: