Skip to content

Commit 6e19caa

Browse files
georgiablancornzenha-s
and
rnzenha-s
authored
Adding licenses (#54)
* Many code quality fixes Co-authored-by: georgiablanco <[email protected]> Co-authored-by: rnzenha-s <[email protected]>
1 parent 13a259a commit 6e19caa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+770
-380
lines changed

aws.yml

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2022 Shadow Robot Company Ltd.
2+
#
3+
# This program is free software: you can redistribute it and/or modify it
4+
# under the terms of the GNU General Public License as published by the Free
5+
# Software Foundation version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful, but WITHOUT
8+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
# more details.
11+
#
12+
# You should have received a copy of the GNU General Public License along
13+
# with this program. If not, see <http://www.gnu.org/licenses/>.
14+
115
settings:
216
machine_type: medium
317
ubuntu:

cyberglove/launch/cyberglove.launch

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!--
2+
Copyright 2022 Shadow Robot Company Ltd.
3+
This program is free software: you can redistribute it and/or modify it
4+
under the terms of the GNU General Public License as published by the Free
5+
Software Foundation version 2 of the License.
6+
This program is distributed in the hope that it will be useful, but WITHOUT
7+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9+
more details.
10+
You should have received a copy of the GNU General Public License along
11+
with this program. If not, see <http://www.gnu.org/licenses/>.
12+
-->
13+
114
<launch>
215
<arg name="serial_port" default="/dev/ttyUSB0"/>
316
<arg name="calibration" default="$(find sr_cyberglove_config)/calibrations/cyberglove.cal"/>

cyberglove/model/cyberglove.xml

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!--
2+
Copyright 2022 Shadow Robot Company Ltd.
3+
This program is free software: you can redistribute it and/or modify it
4+
under the terms of the GNU General Public License as published by the Free
5+
Software Foundation version 2 of the License.
6+
This program is distributed in the hope that it will be useful, but WITHOUT
7+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9+
more details.
10+
You should have received a copy of the GNU General Public License along
11+
with this program. If not, see <http://www.gnu.org/licenses/>.
12+
-->
13+
114
<robot name="cyberglove">
215
<link name="cyberglove_forearm">
316
<inertial>

cyberglove/package.xml

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<?xml version="1.0"?>
2+
<!--
3+
Copyright 2022 Shadow Robot Company Ltd.
4+
This program is free software: you can redistribute it and/or modify it
5+
under the terms of the GNU General Public License as published by the Free
6+
Software Foundation version 2 of the License.
7+
This program is distributed in the hope that it will be useful, but WITHOUT
8+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
more details.
11+
You should have received a copy of the GNU General Public License along
12+
with this program. If not, see <http://www.gnu.org/licenses/>.
13+
-->
214
<package>
315
<name>cyberglove</name>
416
<version>0.0.0</version>

cyberglove/python_lib/cyberglove_calibrer.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright 2011 Shadow Robot Company Ltd.
3+
# Copyright 2011, 2022 Shadow Robot Company Ltd.
44
#
55
# This program is free software: you can redistribute it and/or modify it
66
# under the terms of the GNU General Public License as published by the Free
@@ -14,6 +14,9 @@
1414
# You should have received a copy of the GNU General Public License along
1515
# with this program. If not, see <http://www.gnu.org/licenses/>.
1616
#
17+
18+
# pylint: disable-all
19+
1720
"""
1821
Calibration utility for the cyberglove.
1922
@@ -22,13 +25,15 @@
2225
"""
2326

2427
from __future__ import absolute_import
25-
from builtins import input
28+
2629
import os
27-
from cyberglove_library import Cyberglove
28-
from cyberglove.srv import Calibration as CalibrationSrv
30+
from builtins import input
2931

30-
import rospy
3132
import roslib
33+
import rospy
34+
from cyberglove.srv import Calibration as CalibrationSrv
35+
from cyberglove_library import Cyberglove
36+
3237
roslib.load_manifest('sr_control_gui')
3338

3439

@@ -86,16 +91,16 @@ def default_description(step_name, max=0):
8691
@param max: if 0=>we're reading the min values, if 1=> max values
8792
"""
8893
if max == 0:
89-
print("calibrating min values for: " + str(step_name))
94+
print(f"calibrating min values for: {step_name}")
9095
else:
91-
print("calibrating max values for: " + str(step_name))
96+
print(f"calibrating max values for: {step_name}")
9297

9398

94-
def do_nothing(step_name, max=0):
99+
def do_nothing():
95100
"""
96101
A function that does nothing. Used to have an empty description function.
97102
"""
98-
nothing = True
103+
return
99104

100105

101106
class CybergloveCalibrer:

cyberglove/python_lib/cyberglove_library.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright 2011 Shadow Robot Company Ltd.
3+
# Copyright 2011, 2022 Shadow Robot Company Ltd.
44
#
55
# This program is free software: you can redistribute it and/or modify it
66
# under the terms of the GNU General Public License as published by the Free
@@ -15,18 +15,18 @@
1515
# with this program. If not, see <http://www.gnu.org/licenses/>.
1616
#
1717

18-
from __future__ import absolute_import
19-
from __future__ import division
20-
import time
21-
import os
22-
import math
23-
import rospy
24-
import subprocess
18+
# pylint: disable-all
19+
20+
from __future__ import absolute_import, division
21+
2522
import threading
23+
import time
24+
2625
import rosgraph.masterapi
27-
from sr_robot_msgs.msg import sendupdate, joint, joints_data
28-
from sensor_msgs.msg import *
2926
import roslib
27+
import rospy
28+
from sensor_msgs.msg import JointState
29+
3030
roslib.load_manifest('cyberglove')
3131

3232

cyberglove/python_lib/cyberglove_mapper.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright 2011 Shadow Robot Company Ltd.
3+
# Copyright 2011, 2022 Shadow Robot Company Ltd.
44
#
55
# This program is free software: you can redistribute it and/or modify it
66
# under the terms of the GNU General Public License as published by the Free
@@ -14,6 +14,9 @@
1414
# You should have received a copy of the GNU General Public License along
1515
# with this program. If not, see <http://www.gnu.org/licenses/>.
1616
#
17+
18+
# pylint: disable-all
19+
1720
"""
1821
Minimizes the mapping matrix using a simplex algorithm
1922
@@ -22,11 +25,14 @@
2225
"""
2326

2427
from __future__ import absolute_import
28+
2529
from builtins import input
30+
31+
import roslib
2632
import rospy
27-
from scipy.optimize import fmin
2833
from cyberglove_library import Cyberglove
29-
import roslib
34+
from scipy.optimize import fmin
35+
3036
roslib.load_manifest('sr_control_gui')
3137

3238

cyberglove_trajectory/launch/cyberglove.launch

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!--
2+
Copyright 2022 Shadow Robot Company Ltd.
3+
This program is free software: you can redistribute it and/or modify it
4+
under the terms of the GNU General Public License as published by the Free
5+
Software Foundation version 2 of the License.
6+
This program is distributed in the hope that it will be useful, but WITHOUT
7+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9+
more details.
10+
You should have received a copy of the GNU General Public License along
11+
with this program. If not, see <http://www.gnu.org/licenses/>.
12+
-->
13+
114
<launch>
215
<arg name="serial_port" default="/dev/ttyUSB0"/>
316
<arg name="hand_prefix" default="rh"/>

cyberglove_trajectory/package.xml

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<?xml version="1.0"?>
2+
<!--
3+
Copyright 2022 Shadow Robot Company Ltd.
4+
This program is free software: you can redistribute it and/or modify it
5+
under the terms of the GNU General Public License as published by the Free
6+
Software Foundation version 2 of the License.
7+
This program is distributed in the hope that it will be useful, but WITHOUT
8+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
more details.
11+
You should have received a copy of the GNU General Public License along
12+
with this program. If not, see <http://www.gnu.org/licenses/>.
13+
-->
214
<package>
315
<name>cyberglove_trajectory</name>
416
<version>0.0.0</version>

cyberglove_trajectory/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
22
from __future__ import absolute_import
3+
34
from distutils.core import setup
5+
46
from catkin_pkg.python_setup import generate_distutils_setup
57

68
# fetch values from package.xml

cyberglove_trajectory/src/cyberglove_trajectory/cyberglove_mock.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright 2019 Shadow Robot Company Ltd.
3+
# Copyright 2019, 2022 Shadow Robot Company Ltd.
44
#
55
# This program is free software: you can redistribute it and/or modify it
66
# under the terms of the GNU General Public License as published by the Free
@@ -14,10 +14,13 @@
1414
# You should have received a copy of the GNU General Public License along
1515
# with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
# pylint: disable-all
1718
from __future__ import absolute_import
18-
import rospy
19+
1920
import actionlib
20-
from control_msgs.msg import FollowJointTrajectoryAction, FollowJointTrajectoryGoal
21+
import rospy
22+
from control_msgs.msg import (FollowJointTrajectoryAction,
23+
FollowJointTrajectoryGoal)
2124
from trajectory_msgs.msg import JointTrajectoryPoint
2225

2326

logitech_r400/config/config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2022 Shadow Robot Company Ltd.
2+
#
3+
# This program is free software: you can redistribute it and/or modify it
4+
# under the terms of the GNU General Public License as published by the Free
5+
# Software Foundation version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful, but WITHOUT
8+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
# more details.
11+
#
12+
# You should have received a copy of the GNU General Public License along
13+
# with this program. If not, see <http://www.gnu.org/licenses/>.
14+
115
- product: 0x0e00
216
vendor: 0x0111
317
mapping:

logitech_r400/package.xml

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<?xml version="1.0"?>
2+
<!--
3+
Copyright 2022 Shadow Robot Company Ltd.
4+
This program is free software: you can redistribute it and/or modify it
5+
under the terms of the GNU General Public License as published by the Free
6+
Software Foundation version 2 of the License.
7+
This program is distributed in the hope that it will be useful, but WITHOUT
8+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
more details.
11+
You should have received a copy of the GNU General Public License along
12+
with this program. If not, see <http://www.gnu.org/licenses/>.
13+
-->
214
<package>
315
<name>logitech_r400</name>
416
<version>0.0.0</version>

logitech_r400/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import absolute_import
2+
23
from distutils.core import setup
4+
35
from catkin_pkg.python_setup import generate_distutils_setup
46

57
# fetch values from package.xml

logitech_r400/src/logitech_r400/logitech_r400

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
# ####################################################################
4-
# Copyright (c) 2013 Shadow Robot Company Ltd.
4+
# Copyright (c) 2013, 2022 Shadow Robot Company Ltd.
55
# All rights reserved.
66
# This code is proprietary and may not be used, copied, distributed without
77
# prior authorisation and agreement from Shadow Robot Company Ltd. *
@@ -11,17 +11,18 @@
1111
see README.md
1212
"""
1313

14-
from logitech_r400.msg import LogitechR400
15-
import rospy
16-
import rospkg
1714
from sys import exit as sysexit
1815
from time import sleep
16+
17+
import rospkg
18+
import rospy
1919
import usb.core
2020
import usb.util
2121
import yaml
22+
from logitech_r400.msg import LogitechR400
2223

2324

24-
class LogitechR400Usb(object):
25+
class LogitechR400Usb:
2526
"""
2627
Usb driver for the Logitech R400.
2728
@@ -64,16 +65,16 @@ class LogitechR400Usb(object):
6465
def __enter__(self):
6566
return self
6667

67-
def __exit__(self, type, value, traceback):
68+
def __exit__(self, type_, value, traceback):
6869
for device in self._devices:
6970
self._release_device(device)
7071

7172
def _read_config(self):
72-
configs_file_path = rospkg.RosPack().get_path('logitech_r400') + '/config/config.yaml'
73-
with open(configs_file_path, 'r') as stream:
73+
configs_file_path = f"{rospkg.RosPack().get_path('logitech_r400')}/config/config.yaml"
74+
with open(configs_file_path, 'r', encoding="utf8") as stream:
7475
self._configs = yaml.load(stream)
7576

76-
def _is_R400(self, dev):
77+
def _is_r400(self, dev):
7778
for idx, config in enumerate(self._configs):
7879
if dev.idVendor == config['vendor'] and dev.idProduct == config['product']:
7980
self._used_config_idx = idx
@@ -85,7 +86,7 @@ class LogitechR400Usb(object):
8586
Finds the usb devices in the system.
8687
"""
8788

88-
devices = list(usb.core.find(find_all=True, custom_match=self._is_R400))
89+
devices = list(usb.core.find(find_all=True, custom_match=self._is_r400))
8990
return devices
9091

9192
def _grab_device(self, device):
@@ -99,7 +100,7 @@ class LogitechR400Usb(object):
99100
device.detach_kernel_driver(self.__interface)
100101
rospy.logdebug("kernel driver detached")
101102
except usb.core.USBError as usb_exc:
102-
sysexit("Could not detach kernel driver: %s" % str(usb_exc))
103+
sysexit(f"Could not detach kernel driver: {usb_exc}")
103104

104105
device.set_configuration()
105106
usb.util.claim_interface(device, self.__interface)

shuttle_xpress/package.xml

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<?xml version="1.0"?>
2+
<!--
3+
Copyright 2022 Shadow Robot Company Ltd.
4+
This program is free software: you can redistribute it and/or modify it
5+
under the terms of the GNU General Public License as published by the Free
6+
Software Foundation version 2 of the License.
7+
This program is distributed in the hope that it will be useful, but WITHOUT
8+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10+
more details.
11+
You should have received a copy of the GNU General Public License along
12+
with this program. If not, see <http://www.gnu.org/licenses/>.
13+
-->
214
<package>
315
<name>shuttle_xpress</name>
416
<version>0.0.0</version>

0 commit comments

Comments
 (0)