8000 teach for ERobot2 allows initial value to be passed · ctc-eng/robotics-toolbox-python@a947bc2 · GitHub
[go: up one dir, main page]

Skip to content

Commit a947bc2

Browse files
committed
teach for ERobot2 allows initial value to be passed
1 parent eb004ce commit a947bc2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

roboticstoolbox/robot/ERobot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,8 @@ def plot(
22242224

22252225
def teach(
22262226
self, q=None, block=True, limits=None,
2227-
vellipse=False, fellipse=False, eeframe=True, name=False, backend='pyplot2'):
2227+
vellipse=False, fellipse=False, eeframe=True, name=False,
2228+
unit='rad', backend='pyplot2'):
22282229
"""
22292230
2D Graphical teach pendant
22302231
@@ -2248,6 +2249,8 @@ def teach(
22482249
:type eeframe: bool
22492250
:param name: (Plot Option) Plot the name of the robot near its base
22502251
:type name: bool
2252+
:param unit: angular units: 'rad' [default], or 'deg'
2253+
:type unit: str
22512254
22522255
:return: A reference to the PyPlot object which controls the
22532256
matplotlib figure
@@ -2280,6 +2283,11 @@ def teach(
22802283

22812284
if q is None:
22822285
q = np.zeros((self.n,))
2286+
else:
2287+
q = getvector(q, self.n)
2288+
2289+
if unit == 'deg':
2290+
q = self.toradians(q)
22832291

22842292
# Make an empty 3D figure
22852293
env = self._get_graphical_backend(backend)

0 commit comments

Comments
 (0)
0