Skip to content

Commit

Permalink
Merge pull request #10 from shadow-robot/SP-207_fix_linter_errors
Browse files Browse the repository at this point in the history
Sp 207 fix linter errors
  • Loading branch information
Fotios Papadopoulos authored May 10, 2022
2 parents 2652302 + 3636493 commit e91c34c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Style|[<img src="https://codebuild.eu-west-2.amazonaws.com/badges?uuid=eyJlbmNye
Code Coverage|[<img src="https://codebuild.eu-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiMm0vcWt4Vms2N080eW0vVmpDNVVrR21PeFdpM01JdlJOOWlCRUFyTnQxZityT1I5VytzTkcxNTZUZmlnTGROY2ZWOEk0ZXo3Wjl3ZkVKdFRWcGdTY1NnPSIsIml2UGFyYW1ldGVyU3BlYyI6ImQ2dGx2NzA2ZXJQdGlPZ3UiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=noetic-devel"/>](https://eu-west-2.console.aws.amazon.com/codesuite/codebuild/projects/auto_sr_tests_noetic-devel_code_coverage/)

# sr_tests
Repository containing tests of the Shadow Robot Hand
Repository containing tests of the Shadow Robot Hand.

2 changes: 1 addition & 1 deletion aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ settings:
tag: focal-noetic
template_project_name: template_unit_tests_and_code_coverage
toolset:
branch: master
branch: lint
modules:
- check_cache
- code_coverage
Expand Down
16 changes: 6 additions & 10 deletions sr_pose_tests/scripts/test_hand_poses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright 2020 Shadow Robot Company Ltd.
# Copyright 2020, 2022 Shadow Robot Company Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
Expand All @@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import
from builtins import input
import rospy
import rospkg
from sr_run_trajectories.run_trajectories import SrRunTrajectories
Expand All @@ -25,22 +23,20 @@
rospy.init_node('run_hand_poses')
hand_type = rospy.get_param('~hand_type', 'hand_e')
biotac = rospy.get_param('~biotac', False)

# TODO: Extend with more hand types if necessary
if 'hand_e' == hand_type:
if hand_type == 'hand_e':
poses_yaml_file_name = 'hand_poses_to_test_hand_e'
if biotac:
poses_yaml_file_name += '_biotac'
else:
raise ValueError("Unknown hand type!")

trajectories_file_path = rospkg.RosPack().get_path('sr_pose_tests') + '/config/{}.yaml'.format(poses_yaml_file_name)
trajectories_file_path = rospkg.RosPack().get_path('sr_pose_tests') + f'/config/{poses_yaml_file_name}.yaml'
srt = SrRunTrajectories(trajectories_file_path, arm=False)

for pose in srt._hand_trajectories:
if 'open' == pose:
for pose in srt.get_hand_trajectories():
if pose == 'open':
continue
input("About to go to pose {}. Press [RETURN] to execute...".format(pose))
input(f"About to go to pose {pose}. Press [RETURN] to execute...")
srt.run_trajectory('hand', pose)
input("Press [RETURN] to go back to open pose")
srt.run_trajectory('hand', 'open')
Expand Down

0 comments on commit e91c34c

Please sign in to comment.