Skip to content

Commit e4d9d32

Browse files
committed
removed duplicate function
1 parent e4ea7c4 commit e4d9d32

File tree

2 files changed

+200
-125
lines changed

2 files changed

+200
-125
lines changed

environment.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: mobile
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- aiohttp=3.8.1=py38h294d835_0
7+
- aiosignal=1.2.0=pyhd8ed1ab_0
8+
- ansitable=0.9.6=pyhd8ed1ab_0
9+
- anyio=3.4.0=py38haa244fe_0
10+
- argon2-cffi=21.1.0=py38h294d835_2
11+
- async-timeout=4.0.2=pyhd8ed1ab_0
12+
- async_generator=1.10=py_0
13+
- attrs=21.2.0=pyhd8ed1ab_0
14+
- autobahn=21.11.1=pyhd8ed1ab_0
15+
- backcall=0.2.0=pyh9f0ad1d_0
16+
- backports=1.0=py_2
17+
- backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
18+
- bleach=4.1.0=pyhd8ed1ab_0
19+
- brotli=1.0.9=h8ffe710_6
20+
- brotli-bin=1.0.9=h8ffe710_6
21+
- bullet=3.17=h57928b3_1
22+
- bullet-cpp=3.17=h5d928e2_1
23+
- ca-certificates=2021.10.8=h5b45459_0
24+
- certifi=2021.10.8=py38haa244fe_1
25+
- cffi=1.15.0=py38hd8c33c5_0
26+
- charset-normalizer=2.0.9=pyhd8ed1ab_0
27+
- colorama=0.4.4=pyh9f0ad1d_0
28+
- colored=1.4.2=py_0
29+
- cryptography=36.0.1=py38hb7941b4_0
30+
- cvxopt=1.2.7=py38he924ae6_1
31+
- cycler=0.11.0=pyhd8ed1ab_0
32+
- cython=0.29.26=py38h885f38d_0
33+
- debugpy=1.5.1=py38h885f38d_0
34+
- decorator=5.1.0=pyhd8ed1ab_0
35+
- defusedxml=0.7.1=pyhd8ed1ab_0
36+
- dsdp=5.8=h6e01ec9_1203
37+
- ecos=2.0.8=py38h6f4d8f0_2
38+
- entrypoints=0.3=pyhd8ed1ab_1003
39+
- ffmpeg=4.3.1=ha925a31_0
40+
- fftw=3.3.10=nompi_h77347bd_102
41+
- fonttools=4.28.5=py38h294d835_0
42+
- freeglut=3.2.1=h0e60522_2
43+
- freetype=2.10.4=h546665d_1
44+
- frozenlist=1.2.0=py38h294d835_1
45+
- glpk=4.65=h8ffe710_1004
46+
- gsl=2.7=hdfb1a43_0
47+
- hyperlink=21.0.0=pyhd3deb0d_0
48+
- icu=68.2=h0e60522_0
49+
- idna=3.1=pyhd3deb0d_0
50+
- imageio=2.13.4=pyh239f2a4_0
51+
- imageio-ffmpeg=0.4.5=pyhd8ed1ab_0
52+
- importlib-metadata=4.10.0=py38haa244fe_0
53+
- importlib_resources=5.4.0=pyhd8ed1ab_0
54+
- intel-openmp=2021.4.0=h57928b3_3556
55+
- ipykernel=6.5.1=py38h595d716_0
56+
- ipython=7.30.1=py38haa244fe_0
57+
- ipython_genutils=0.2.0=py_1
58+
- ipywidgets=7.6.5=pyhd8ed1ab_0
59+
- jasper=2.0.33=h77af90b_0
60+
- jbig=2.1=h8d14728_2003
61+
- jedi=0.18.1=py38haa244fe_0
62+
- jinja2=3.0.3=pyhd8ed1ab_0
63+
- jpeg=9d=h8ffe710_0
64+
- jsonschema=4.3.2=pyhd8ed1ab_0
65+
- jupyter=1.0.0=py38haa244fe_7
66+
- jupyter-server-proxy=3.2.0=pyhd8ed1ab_0
67+
- jupyter_client=6.1.12=pyhd8ed1ab_0
68+
- jupyter_console=6.4.0=pyhd8ed1ab_1
69+
- jupyter_core=4.9.1=py38haa244fe_1
70+
- jupyter_server=1.13.1=pyhd8ed1ab_0
71+
- jupyterlab_pygments=0.1.2=pyh9f0ad1d_0
72+
- jupyterlab_widgets=1.0.2=pyhd8ed1ab_0
73+
- kiwisolver=1.3.2=py38hbd9d945_1
74+
- lcms2=2.12=h2a16943_0
75+
- lerc=3.0=h0e60522_0
76+
- libblas=3.9.0=12_win64_mkl
77+
- libbrotlicommon=1.0.9=h8ffe710_6
78+
- libbrotlidec=1.0.9=h8ffe710_6
79+
- libbrotlienc=1.0.9=h8ffe710_6
80+
- libcblas=3.9.0=12_win64_mkl
81+
- libclang=11.1.0=default_h5c34c98_1
82+
- libdeflate=1.8=h8ffe710_0
83+
- liblapack=3.9.0=12_win64_mkl
84+
- liblapacke=3.9.0=12_win64_mkl
85+
- libopencv=4.5.5=py38hd5548a8_0
86+
- libpng=1.6.37=h1d00b33_2
87+
- libprotobuf=3.19.3=h7755175_0
88+
- libsodium=1.0.18=h8d14728_1
89+
- libtiff=4.3.0=hd413186_2
90+
- libwebp-base=1.2.1=h8ffe710_0
91+
- libzlib=1.2.11=h8ffe710_1013
92+
- lz4-c=1.9.3=h8ffe710_1
93+
- m2w64-gcc-libgfortran=5.3.0=6
94+
- m2w64-gcc-libs=5.3.0=7
95+
- m2w64-gcc-libs-core=5.3.0=7
96+
- m2w64-gmp=6.1.0=2
97+
- m2w64-libwinpthread-git=5.0.0.4634.697f757=2
98+
- markupsafe=2.0.1=py38h294d835_1
99+
- matplotlib-base=3.5.1=py38h1f000d6_0
100+
- matplotlib-inline=0.1.3=pyhd8ed1ab_0
101+
- mistune=0.8.4=py38h294d835_1005
102+
- mkl=2021.4.0=h0e2418a_729
103+
- mpmath=1.2.1=pyhd8ed1ab_0
104+
- msys2-conda-epoch=20160418=1
105+
- multidict=5.2.0=py38h294d835_1
106+
- munkres=1.1.4=pyh9f0ad1d_0
107+
- nbclient=0.5.9=pyhd8ed1ab_0
108+
- nbconvert=6.3.0=py38haa244fe_1
109+
- nbformat=5.1.3=pyhd8ed1ab_0
110+
- nest-asyncio=1.5.4=pyhd8ed1ab_0
111+
- notebook=6.4.6=pyha770c72_0
112+
- numpy=1.21.5=py38hcf66579_0
113+
- numpy-stl=2.16.3=py38h6f4d8f0_1
114+
- olefile=0.46=pyh9f0ad1d_1
115+
- opencv=4.5.5=py38haa244fe_0
116+
- openjpeg=2.4.0=hb211442_1
117+
- openssl=1.1.1l=h8ffe710_0
118+
- osqp=0.6.2.post0=py38h5d928e2_3
119+
- packaging=21.3=pyhd8ed1ab_0
120+
- pandoc=2.16.2=h8ffe710_0
121+
- pandocfilters=1.5.0=pyhd8ed1ab_0
122+
- parso=0.8.3=pyhd8ed1ab_0
123+
- pgraph-python=0.6.1=pyhd8ed1ab_0
124+
- pickleshare=0.7.5=py_1003
125+
- pillow=8.4.0=py38h794f750_0
126+
- pip=21.3.1=pyhd8ed1ab_0
127+
- progress=1.6=pyhd8ed1ab_0
128+
- prometheus_client=0.12.0=pyhd8ed1ab_0
129+
- prompt-toolkit=3.0.24=pyha770c72_0
130+
- prompt_toolkit=3.0.24=hd8ed1ab_0
131+
- py-opencv=4.5.5=py38h595d716_0
132+
- pybullet=3.17=py38h5d928e2_1
133+
- pycparser=2.21=pyhd8ed1ab_0
134+
- pygments=2.10.0=pyhd8ed1ab_0
135+
- pyparsing=3.0.6=pyhd8ed1ab_0
136+
- pyqt=5.12.3=py38haa244fe_8
137+
- pyqt-impl=5.12.3=py38h885f38d_8
138+
- pyqt5-sip=4.19.18=py38h885f38d_8
139+
- pyqtchart=5.12=py38h885f38d_8
140+
- pyqtwebengine=5.12.1=py38h885f38d_8
141+
- pyrsistent=0.18.0=py38h294d835_0
142+
- python=3.8.12=h7840368_2_cpython
143+
- python-dateutil=2.8.2=pyhd8ed1ab_0
144+
- python-utils=2.6.3=pyhd8ed1ab_0
145+
- python_abi=3.8=2_cp38
146+
- pywin32=302=py38h294d835_2
147+
- pywinpty=1.1.6=py38hd3f51b4_0
148+
- pyyaml=6.0=py38h294d835_3
149+
- pyzmq=22.3.0=py38h09162b1_1
150+
- qdldl-python=0.1.5=py38h5d928e2_2
151+
- qpsolvers=1.7.2=pyhd8ed1ab_0
152+
- qt=5.12.9=h5909a2a_4
153+
- qtconsole=5.2.2=pyhd8ed1ab_0
154+
- qtpy=2.0.0=pyhd8ed1ab_0
155+
- quadprog=0.1.11=py38hbd9d945_0
156+
- roboticstoolbox-python=0.11.0=py38h6f4d8f0_0
157+
- rtb-data=0.10.0=pyhd8ed1ab_0
158+
- scipy=1.7.3=py38ha1292f7_0
159+
- send2trash=1.8.0=pyhd8ed1ab_0
160+
- setuptools=60.0.4=py38haa244fe_0
161+
- simpervisor=0.4=pyhd8ed1ab_0
162+
- six=1.16.0=pyh6c4a22f_0
163+
- sniffio=1.2.0=py38haa244fe_2
164+
- spatialgeometry=0.2.0=pyhd8ed1ab_0
165+
- spatialmath-python=0.11=pyhd8ed1ab_0
166+
- sphinxcontrib-jsmath=1.0.1=py_0
167+
- sqlite=3.37.0=h8ffe710_0
168+
- swift-sim=0.10.0=py38h6f4d8f0_1
169+
- sympy=1.9=py38haa244fe_1
170+
- tbb=2021.4.0=h2d74725_1
171+
- terminado=0.12.1=py38haa244fe_1
172+
- testpath=0.5.0=pyhd8ed1ab_0
173+
- tk=8.6.11=h8ffe710_1
174+
- tornado=6.1=py38h294d835_2
175+
- traitlets=5.1.1=pyhd8ed1ab_0
176+
- txaio=21.2.1=pyhd8ed1ab_0
177+
- typing-extensions=4.0.1=hd8ed1ab_0
178+
- typing_extensions=4.0.1=pyha770c72_0
179+
- ucrt=10.0.20348.0=h57928b3_0
180+
- unicodedata2=14.0.0=py38h294d835_0
181+
- vc=14.2=hb210afc_5
182+
- vpython=7.6.2=py38h294d835_0
183+
- vs2015_runtime=14.29.30037=h902a5da_5
184+
- wcwidth=0.2.5=pyh9f0ad1d_2
185+
- webencodings=0.5.1=py_1
186+
- websocket-client=1.2.3=pyhd8ed1ab_0
187+
- websockets=10.1=py38h294d835_0
188+
- wheel=0.37.1=pyhd8ed1ab_0
189+
- widgetsnbextension=3.5.2=py38haa244fe_1
190+
- winpty=0.4.3=4
191+
- xz=5.2.5=h62dcd97_1
192+
- yaml=0.2.5=he774522_0
193+
- yarl=1.7.2=py38h294d835_1
194+
- zeromq=4.3.4=h0e60522_1
195+
- zipp=3.6.0=pyhd8ed1ab_0
196+
- zlib=1.2.11=h8ffe710_1013
197+
- zstd=1.5.0=h6255e5f_0
198+
prefix: D:\conda\envs\mobile

roboticstoolbox/robot/ERobot.py

Lines changed: 2 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,123 +2130,6 @@ def indiv_calculation(link, link_col, q):
21302130
return Ain, bin
21312131

21322132
def vision_collision_damper(
2133-
self,
2134-
shape,
2135-
q=None,
2136-
di=0.3,
2137-
ds=0.05,
2138-
xi=1.0,
2139-
end=None,
2140-
start=None,
2141-
collision_list=None,
2142-
camera=None
2143-
):
2144-
"""
2145-
Formulates an inequality contraint which, when optimised for will
2146-
make it impossible for the robot to run into a collision. Requires
2147-
See examples/neo.py for use case
2148-
:param ds: The minimum distance in which a joint is allowed to
2149-
approach the collision object shape
2150-
:type ds: float
2151-
:param di: The influence distance in which the velocity
2152-
damper becomes active
2153-
:type di: float
2154-
:param xi: The gain for the velocity damper
2155-
:type xi: float
2156-
:param from_link: The first link to consider, defaults to the base
2157-
link
2158-
:type from_link: ELink
2159-
:param to_link: The last link to consider, will consider all links
2160-
between from_link and to_link in the robot, defaults to the
2161-
end-effector link
2162-
:type to_link: ELink
2163-
:returns: Ain, Bin as the inequality contraints for an omptimisor
2164-
:rtype: ndarray(6), ndarray(6)
2165-
"""
2166-
2167-
if start is None:
2168-
start = self.base_link
2169-
2170-
if end is None:
2171-
end = self.ee_link
2172-
2173-
links, n, _ = self.get_path(start=start, end=end)
2174-
2175-
# if q is None:
2176-
# q = np.copy(self.q)
2177-
# else:
2178-
# q = getvector(q, n)
2179-
2180-
j = 0
2181-
Ain = None
2182-
bin = None
2183-
din = None
2184-
2185-
def indiv_calculation(link, link_col, q):
2186-
d, wTlp, wTcp = link_col.closest_point(shape, di)
2187-
2188-
if d is not None:
2189-
lpTcp = -wTlp + wTcp
2190-
2191-
norm = lpTcp / d
2192-
norm_h = np.expand_dims(np.r_[norm, 0, 0, 0], axis=0)
2193-
2194-
tool = SE3((np.linalg.inv(self.fkine(q, end=link, fast=True)) @ SE3(wTlp).A)[:3, 3])
2195-
2196-
Je = self.jacob0(
2197-
q, end=link, tool=tool.A, fast=True
2198-
)
2199-
Je[:3, :] = self._base.A[:3, :3] @ Je[:3, :]
2200-
2201-
wTc = camera.fkine(camera.q, fast=True)
2202-
Jv = camera.jacob0(
2203-
camera.q, tool=SE3(np.linalg.inv(wTc[:3, :3]) @ (wTcp - wTc[:3, -1])).A, fast=True
2204-
)
2205-
Jv[:3, :] = self._base.A[:3, :3] @ Jv[:3, :]
2206-
2207-
n_dim = Je.shape[1]
2208-
dp = norm_h @ Jv
2209-
l_Ain = np.zeros((1, self.n + 2 + 10))
2210-
l_Ain[0, :n_dim] = norm_h @ Je
2211-
l_Ain -= np.r_[dp[0, :3], np.zeros(7), dp[0, 3:], np.zeros(9), 1]
2212-
l_bin = (xi * (d - ds) / (di - ds))
2213-
else:
2214-
l_Ain = None
2215-
l_bin = None
2216-
2217-
return l_Ain, l_bin, d, wTcp
2218-
2219-
for link in links:
2220-
if link.isjoint:
2221-
j += 1
2222-
2223-
if collision_list is None:
2224-
col_list = link.collision
2225-
else:
2226-
col_list = collision_list[j - 1]
2227-
2228-
for link_col in col_list:
2229-
l_Ain, l_bin, d, wTcp = indiv_calculation(link, link_col, q)
2230-
2231-
if l_Ain is not None and l_bin is not None:
2232-
if Ain is None:
2233-
Ain = l_Ain
2234-
else:
2235-
Ain = np.r_[Ain, l_Ain]
2236-
2237-
if bin is None:
2238-
bin = np.array(l_bin)
2239-
else:
2240-
bin = np.r_[bin, l_bin]
2241-
2242-
if din is None:
2243-
din = d
2244-
else:
2245-
din = np.r_[din, d]
2246-
2247-
return Ain, bin, din
2248-
2249-
def new_vision_collision_damper(
22502133
self,
22512134
shape,
22522135
q=None,
@@ -2261,8 +2144,8 @@ def new_vision_collision_damper(
22612144
):
22622145
"""
22632146
Formulates an inequality contraint which, when optimised for will
2264-
make it impossible for the robot to run into a collision. Requires
2265-
See examples/neo.py for use case
2147+
make it impossible for the robot to self-occlude
2148+
:param shape: The line of sight object.
22662149
:param ds: The minimum distance in which a joint is allowed to
22672150
approach the collision object shape
22682151
:type ds: float
@@ -2290,11 +2173,6 @@ def new_vision_collision_damper(
22902173

22912174
links, n, _ = self.get_path(start=start, end=end)
22922175

2293-
# if q is None:
2294-
# q = np.copy(self.q)
2295-
# else:
2296-
# q = getvector(q, n)
2297-
22982176
j = 0
22992177
Ain = None
23002178
bin = None
@@ -2371,7 +2249,6 @@ def indiv_calculation(link, link_col, q):
23712249

23722250
return Ain, bin, din
23732251

2374-
23752252
# inverse dynamics (recursive Newton-Euler) using spatial vector notation
23762253
def rne(robot, q, qd, qdd, symbolic=False, gravity=None):
23772254

0 commit comments

Comments
 (0)