Skip to content

Commit eafff14

Browse files
committed
brought linkdamper up
1 parent 07097b4 commit eafff14

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

roboticstoolbox/robot/ERobot.py

-40
Original file line numberDiff line numberDiff line change
@@ -1779,46 +1779,6 @@ def jacob0v(
17791779

17801780
return Jv
17811781

1782-
def joint_velocity_damper(self, ps=0.05, pi=0.1, n=None, gain=1.0):
1783-
'''
1784-
Formulates an inequality contraint which, when optimised for will
1785-
make it impossible for the robot to run into joint limits. Requires
1786-
the joint limits of the robot to be specified. See examples/mmc.py
1787-
for use case
1788-
1789-
:param ps: The minimum angle (in radians) in which the joint is
1790-
allowed to approach to its limit
1791-
:type ps: float
1792-
:param pi: The influence angle (in radians) in which the velocity
1793-
damper becomes active
1794-
:type pi: float
1795-
:param n: The number of joints to consider. Defaults to all joints
1796-
:type n: int
1797-
:param gain: The gain for the velocity damper
1798-
:type gain: float
1799-
1800-
:returns: Ain, Bin as the inequality contraints for an optisator
1801-
:rtype: ndarray(6), ndarray(6)
1802-
'''
1803-
1804-
if n is None:
1805-
n = self.n
1806-
1807-
Ain = np.zeros((n, n))
1808-
Bin = np.zeros(n)
1809-
1810-
for i in range(n):
1811-
if self.q[i] - self.qlim[0, i] <= pi:
1812-
Bin[i] = -gain * (
1813-
((self.qlim[0, i] - self.q[i]) + ps) / (pi - ps))
1814-
Ain[i, i] = -1
1815-
if self.qlim[1, i] - self.q[i] <= pi:
1816-
Bin[i] = gain * (
1817-
(self.qlim[1, i] - self.q[i]) - ps) / (pi - ps)
1818-
Ain[i, i] = 1
1819-
1820-
return Ain, Bin
1821-
18221782
def link_collision_damper(
18231783
self, shape, q=None, di=0.3, ds=0.05, xi=1.0,
18241784
endlink=None, startlink=None):

roboticstoolbox/robot/Robot.py

+40
Original file line numberDiff line numberDiff line change
@@ -1481,3 +1481,43 @@ def collided(self, shape):
14811481
return True
14821482

14831483
return False
1484+
1485+
def joint_velocity_damper(self, ps=0.05, pi=0.1, n=None, gain=1.0):
1486+
'''
1487+
Formulates an inequality contraint which, when optimised for will
1488+
make it impossible for the robot to run into joint limits. Requires
1489+
the joint limits of the robot to be specified. See examples/mmc.py
1490+
for use case
1491+
1492+
:param ps: The minimum angle (in radians) in which the joint is
1493+
allowed to approach to its limit
1494+
:type ps: float
1495+
:param pi: The influence angle (in radians) in which the velocity
1496+
damper becomes active
1497+
:type pi: float
1498+
:param n: The number of joints to consider. Defaults to all joints
1499+
:type n: int
1500+
:param gain: The gain for the velocity damper
1501+
:type gain: float
1502+
1503+
:returns: Ain, Bin as the inequality contraints for an optisator
1504+
:rtype: ndarray(6), ndarray(6)
1505+
'''
1506+
1507+
if n is None:
1508+
n = self.n
1509+
1510+
Ain = np.zeros((n, n))
1511+
Bin = np.zeros(n)
1512+
1513+
for i in range(n):
1514+
if self.q[i] - self.qlim[0, i] <= pi:
1515+
Bin[i] = -gain * (
1516+
((self.qlim[0, i] - self.q[i]) + ps) / (pi - ps))
1517+
Ain[i, i] = -1
1518+
if self.qlim[1, i] - self.q[i] <= pi:
1519+
Bin[i] = gain * (
1520+
(self.qlim[1, i] - self.q[i]) - ps) / (pi - ps)
1521+
Ain[i, i] = 1
1522+
1523+
return Ain, Bin

0 commit comments

Comments
 (0)