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

Dev 8.2.x #70

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyicub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
__authors__ = 'Davide De Tommaso, Adam Lukomski, Nicola Russi'
__emails__ = 'davide.detommaso@iit.it, adam.lukomski@iit.it, nicola.russi@iit.it'
__license__ = 'BSD-2'
__version__ = '8.2.0'
__version__ = '8.2.1'
__description__ = 'Developing iCub applications using Python'
8 changes: 2 additions & 6 deletions pyicub/controllers/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,8 @@ def __move__(self, target_joints, joints_list, req_time, joints_speed):
if disp[i] < 0.0:
disp[i] =- disp[i]
if abs(disp[i]) > 0.001:
if req_time > 0.0:
speeds[i] = disp[i]/req_time
else:
speeds[i] = joints_speed[i]
times[i] = disp[i]/speeds[i]
speeds[i] = joints_speed[i]
times[i] = disp[i]/speeds[i]
self.__IPositionControl__.setRefSpeed(j, speeds[i])
self.__IPositionControl__.positionMove(j, tmp[i])
i+=1
Expand Down Expand Up @@ -248,7 +245,6 @@ def move(self, pose: JointPose, req_time: float=0.0, timeout: float=DEFAULT_TIME
str(joints_speed)
))
else:
self.stop()
self.__logger__.warning("""Motion TIMEOUT!
elapsed_time: %s,
tag: %s,
Expand Down
3 changes: 3 additions & 0 deletions pyicub/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ def moveSteps(self, steps, checkpoints, prefix):

def playAction(self, action_id: str, wait_for_completed=True):
action = self.actions_manager.getAction(action_id)
return self.runAction(action)

def runAction(self, action: iCubFullbodyAction, wait_for_completed=True):
t0 = round(time.perf_counter(), 4)
self._logger_.debug('Playing action <%s>' % action.name)
if action.offset_ms:
Expand Down
8 changes: 5 additions & 3 deletions pyicub/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ def wrapper_target(self, robot_name, app_name, target_name):
if request.method == 'GET':
return self._app_services_[robot_name][app_name][target_name]
elif request.method == 'POST':
if not type(self._services_[target_rule].target) is str:
return self.process_target(self._services_[target_rule])
return self.process_target_remote(self._services_[target_rule])
if target_rule in self._services_.keys():
if not type(self._services_[target_rule].target) is str:
return self.process_target(self._services_[target_rule])
elif self._app_services_[robot_name][app_name][target_name]['url'] in self._services_.keys():
return self.process_target_remote(self._services_[self._app_services_[robot_name][app_name][target_name]['url']])

def process_target_remote(self, service):
url = service.url
Expand Down