Skip to content

Commit 5df4691

Browse files
committed
LGTM issue fixes
1 parent ad3d9d3 commit 5df4691

File tree

17 files changed

+50
-51
lines changed

17 files changed

+50
-51
lines changed

roboticstoolbox/backends/PyPlot/EllipsePlot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
import numpy as np
7-
import scipy as sp
7+
# import scipy as sp
88
from spatialmath import base
99
import matplotlib.pyplot as plt
1010

@@ -22,7 +22,7 @@ def plot(self):
2222
ax = self.ax
2323

2424
if ax is None:
25-
fig = plt.figure()
25+
plt.figure()
2626
ax = plt.axes(projection="3d")
2727
self.ax = ax
2828

@@ -109,7 +109,7 @@ def plot(self, ax=None):
109109
ax = self.ax
110110

111111
if ax is None:
112-
fig = plt.figure()
112+
plt.figure()
113113
ax = plt.axes(projection="3d")
114114
self.ax = ax
115115

@@ -196,7 +196,7 @@ def make_ellipsoid2(self):
196196
centre = self.centre
197197

198198
# points on unit circle
199-
theta = np.linspace(0.0, 2.0 * np.pi, 50)
199+
# theta = np.linspace(0.0, 2.0 * np.pi, 50)
200200
# y = np.array([np.cos(theta), np.sin(theta)])
201201
# RVC2 p 602
202202
# x = sp.linalg.sqrtm(A) @ y

roboticstoolbox/examples/neo.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import spatialmath as sm
1010
import numpy as np
1111
import qpsolvers as qp
12-
import cProfile
1312

1413
# Launch the simulator Swift
1514
env = swift.Swift()

roboticstoolbox/examples/puma_swift.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import swift
77
import roboticstoolbox as rp
8-
import spatialmath as sm
98
import numpy as np
109

1110
env = swift.Swift()

roboticstoolbox/examples/tripleangledemo.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def set_three(x):
137137
lambda x: change_sequence("ZYZ"), desc="ZYZ (Euler angles)"
138138
)
139139

140-
button = swift.Button(lambda x: set("ZYX"), desc="Set to Zero")
140+
swift.Button(lambda x: set("ZYX"), desc="Set to Zero")
141141

142142
# button to reset joint angles
143143
def reset(e):
@@ -185,25 +185,25 @@ def angle(index, ring):
185185

186186
label = swift.Label(desc="Triple angle")
187187

188-
def chekked(e, el):
189-
nlabel = "s: "
188+
# def chekked(e, el):
189+
# nlabel = "s: "
190190

191-
if e[0]:
192-
nlabel += "a"
193-
r_one.value = 0
191+
# if e[0]:
192+
# nlabel += "a"
193+
# r_one.value = 0
194194

195-
if e[1]:
196-
nlabel += "b"
197-
r_two.value = 0
195+
# if e[1]:
196+
# nlabel += "b"
197+
# r_two.value = 0
198198

199-
if e[2]:
200-
nlabel += "c"
201-
r_three.value = 0
199+
# if e[2]:
200+
# nlabel += "c"
201+
# r_three.value = 0
202202

203-
if e[3]:
204-
el.value = 1
203+
# if e[3]:
204+
# el.value = 1
205205

206-
label.desc = nlabel
206+
# label.desc = nlabel
207207

208208
env.add(label)
209209
env.add(r_one)

roboticstoolbox/examples/vehicle1.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from roboticstoolbox import Bicycle, RandomPath, VehiclePolygon, VehicleIcon
2-
from spatialmath import * # lgtm [py/polluting-import]
1+
# from roboticstoolbox import Bicycle, RandomPath, VehiclePolygon
2+
from roboticstoolbox import VehicleIcon
3+
from spatialmath import * # lgtm [py/polluting-import]
34
from math import pi
45

56
dim = 10
67

78
# v = VehiclePolygon()
8-
anim = VehicleIcon('greycar', scale=2)
9+
anim = VehicleIcon("greycar", scale=2)
910

1011
# veh = Bicycle(
1112
# animation=anim,

roboticstoolbox/mobile/CurvaturePolyPlanner.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import scipy.integrate
33
import scipy.optimize
44
import numpy as np
5-
import matplotlib.pyplot as plt
5+
6+
# import matplotlib.pyplot as plt
67
from collections import namedtuple
78
from roboticstoolbox.mobile import *
89

roboticstoolbox/mobile/EKF.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def _extend_map(self, P, xv, xm, z, lm_id):
917917
# estimate position of landmark in the world based on
918918
# noisy sensor reading and current vehicle pose
919919

920-
M = None
920+
# M = None
921921

922922
# estimate its position based on observation and vehicle state
923923
xf = self.sensor.g(xv, z)

roboticstoolbox/mobile/Vehicle.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"""
66
from abc import ABC, abstractmethod
77
import warnings
8-
from math import pi, sin, cos, tan, atan2
8+
from math import pi, sin, cos, tan
99
import numpy as np
10-
from scipy import integrate, linalg, interpolate
10+
from scipy import interpolate
1111

1212
import matplotlib.pyplot as plt
13-
from matplotlib import patches
14-
import matplotlib.transforms as mtransforms
13+
# from matplotlib import patches
14+
# import matplotlib.transforms as mtransforms
1515

1616
from spatialmath import SE2, base
1717
from roboticstoolbox.mobile.drivers import VehicleDriverBase

roboticstoolbox/models/DH/AL5D.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def __init__(self, symbolic=False):
4343
if symbolic:
4444
import spatialmath.base.symbolic as sym
4545

46-
zero = sym.zero()
46+
# zero = sym.zero()
4747
pi = sym.pi()
4848
else:
4949
from math import pi
5050

51-
zero = 0.0
51+
# zero = 0.0
5252

5353
# robot length values (metres)
5454
a = [0, 0.002, 0.14679, 0.17751]
@@ -58,7 +58,7 @@ def __init__(self, symbolic=False):
5858
offset = [pi / 2, pi, -0.0427, -0.0427 - pi / 2]
5959

6060
# mass data as measured
61-
mass = [0.187, 0.044, 0.207, 0.081]
61+
# mass = [0.187, 0.044, 0.207, 0.081]
6262

6363
# center of mass as calculated through CAD model
6464
center_of_mass = [

roboticstoolbox/models/URDF/Fetch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
from roboticstoolbox.robot.ERobot import ERobot
5-
from spatialmath import SE3
5+
# from spatialmath import SE3
66

77

88
class Fetch(ERobot):

roboticstoolbox/models/URDF/FetchCamera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
from roboticstoolbox.robot.ERobot import ERobot
5-
from spatialmath import SE3
5+
# from spatialmath import SE3
66

77

88
class FetchCamera(ERobot):

roboticstoolbox/robot/DHRobot.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
tr2eul,
2121
tr2rpy,
2222
t2r,
23-
eul2jac,
24-
rpy2jac,
2523
trlog,
2624
rotvelxform,
2725
)

roboticstoolbox/robot/ERobot.py

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
SpatialInertia,
4444
SpatialForce,
4545
)
46-
import fknm
4746
from functools import lru_cache
4847
from typing import Union, overload, Dict, List, Tuple, Optional
4948
from copy import deepcopy

roboticstoolbox/robot/ETS.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def eval(
858858

859859
try:
860860
return ETS_fkine(self._fknm, q, base, tool, include_base)
861-
except:
861+
except BaseException:
862862
pass
863863

864864
q = getmatrix(q, (None, None))

roboticstoolbox/robot/Link.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from copy import copy as ccopy, deepcopy
22
from abc import ABC
3-
from multiprocessing.sharedctypes import Value
3+
# from multiprocessing.sharedctypes import Value
44
import numpy as np
55
from functools import wraps
66
from spatialmath.base import getvector, isscalar, isvector, ismatrix
77
from spatialmath import SE3, SE2
88
from ansitable import ANSITable, Column
99
from spatialgeometry import Shape, SceneNode, SceneGroup
10-
from typing import List, Union, Type, Tuple, overload
10+
from typing import List, Union, Tuple, overload
1111
import roboticstoolbox as rtb
1212
from roboticstoolbox.robot.ETS import ETS, ETS2
1313
from roboticstoolbox.robot.ET import ET, ET2

roboticstoolbox/robot/Robot.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from copy import deepcopy
44
import numpy as np
55
import roboticstoolbox as rtb
6-
from spatialmath import SE3, SE2
6+
from spatialmath import SE3
77
from spatialmath.base.argcheck import (
88
isvector,
99
getvector,
@@ -18,17 +18,19 @@
1818
from roboticstoolbox.robot.Dynamics import DynamicsMixin
1919
from roboticstoolbox.robot.ETS import ETS
2020
from roboticstoolbox.robot.IK import IKMixin
21-
from typing import Optional, Union, overload, Dict, Tuple
21+
from typing import Union, Dict, Tuple
2222
from spatialgeometry import Shape
2323
from fknm import Robot_link_T
2424
from functools import lru_cache
2525
from spatialgeometry import SceneNode
2626
from roboticstoolbox.robot.Link import BaseLink, Link
27-
from numpy import all, eye, isin
27+
28+
# from numpy import all, eye, isin
2829
from roboticstoolbox.robot.Gripper import Gripper
2930
from numpy import ndarray
3031
from warnings import warn
31-
import scipy as sp
32+
33+
# import scipy as sp
3234

3335
try:
3436
from matplotlib import colors
@@ -980,7 +982,7 @@ def jacob0_dot(self, q=None, qd=None, J0=None, representation=None):
980982
981983
:seealso: :func:`jacob0`, :func:`hessian0`
982984
""" # noqa
983-
n = len(q)
985+
# n = len(q)
984986

985987
if representation is None:
986988

@@ -2199,10 +2201,12 @@ def get_link_scene_node():
21992201

22002202
if __name__ == "__main__":
22012203

2202-
import roboticstoolbox as rtb
2204+
pass
2205+
2206+
# import roboticstoolbox as rtb
22032207

2204-
puma = rtb.models.DH.Puma560()
2205-
a = puma.copy()
2208+
# puma = rtb.models.DH.Puma560()
2209+
# a = puma.copy()
22062210

22072211
# from roboticstoolbox import ET2 as ET
22082212

rtb-data/setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
import pkg_resources
43
import os
5-
import sys
64

75
here = os.path.abspath(os.path.dirname(__file__))
86

0 commit comments

Comments
 (0)