8000 Updated comments and mode selection logic. · ljthink/robotics-toolbox-python@56cb53b · GitHub
[go: up one dir, main page]

Skip to content

Commit 56cb53b

Browse files
committed
Updated comments and mode selection logic.
1 parent c7a655b commit 56cb53b

File tree

1 file changed

+41
-43
lines changed

1 file changed

+41
-43
lines changed

robotics-toolbox-python/robot/maniplty.py

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,11 @@
1-
#MANIPLTY Manipulability measure
2-
#
3-
# M = MANIPLTY(ROBOT, Q)
4-
# M = MANIPLTY(ROBOT, Q, WHICH)
5-
#
6-
# Computes the manipulability index for the manipulator at the given pose.
7-
#
8-
# For an n-axis manipulator Q may be an n-element vector, or an m x n
9-
# joint space trajectory.
10-
#
11-
# If Q is a vector MANIPLTY returns a scalar manipulability index.
12-
# If Q is a matrix MANIPLTY returns a column vector of manipulability
13-
# indices for each pose specified by Q.
14-
#
15-
# The argument WHICH can be either 'yoshikawa' (default) or 'asada' and
16-
# selects one of two manipulability measures.
17-
# Yoshikawa's manipulability measure gives an indication of how far
18-
# the manipulator is from singularities and thus able to move and
19-
# exert forces uniformly in all directions.
20-
#
21-
# Asada's manipulability measure is based on the manipulator's
22-
# Cartesian inertia matrix. An n-dimensional inertia ellipsoid
23-
# X' M(q) X = 1
24-
# gives an indication of how well the manipulator can accelerate
25-
# in each of the Cartesian directions. The scalar measure computed
26-
# here is the ratio of the smallest/largest ellipsoid axis. Ideally
27-
# the ellipsoid would be spherical, giving a ratio of 1, but in
28-
# practice will be less than 1.
29-
#
30-
# See also: INERTIA, JACOB0.
1+
"""
2+
Robot manipulability operations.
3+
4+
@author: Peter Corke
5+
@copyright: Peter Corke
6+
"""
317

32-
# MOD HISTORY
33-
# 4/99 object support, matlab local functions
34-
# 6/99 change switch to allow abbreviations of measure type
35-
# $Log: maniplty.m,v $
36-
# Revision 1.2 2002/04/01 11:47:14 pic
37-
# General cleanup of code: help comments, see also, copyright, remnant dh/dyn
38-
# references, clarification of functions.
39-
#
40-
# $Revision: 1.2 $
418

42-
# Copyright (C) 1993-2002, by Peter I. Corke
439

4410
from numpy import *
4511
from jacob0 import *
@@ -48,15 +14,47 @@
4814
from numrows import *
4915

5016
def maniplty(robot, q, which = 'yoshikawa'):
51-
n = robot.n
17+
'''
18+
MANIPLTY Manipulability measure
19+
20+
- M = MANIPLTY(ROBOT, Q)
21+
- M = MANIPLTY(ROBOT, Q, WHICH)
22+
23+
Computes the manipulability index for the manipulator at the given pose.
24+
25+
For an n-axis manipulator Q may be an n-element vector, or an m x n
26+
joint space trajectory.
27+
28+
If Q is a vector MANIPLTY returns a scalar manipulability index.
29+
If Q is a matrix MANIPLTY returns a column vector of manipulability
30+
indices for each pose specified by Q.
31+
32+
The argument WHICH can be either 'yoshikawa' (default) or 'asada' and
33+
selects one of two manipulability measures.
34+
Yoshikawa's manipulability measure gives an indication of how far
35+
the manipulator is from singularities and thus able to move and
36+
exert forces uniformly in all directions.
37+
38+
Asada's manipulability measure is based on the manipulator's
39+
Cartesian inertia matrix. An n-dimensional inertia ellipsoid
40+
X' M(q) X = 1
41+
gives an indication of how well the manipulator can accelerate
42+
in each of the Cartesian directions. The scalar measure computed
43+
here is the ratio of the smallest/largest ellipsoid axis. Ideally
44+
the ellipsoid would be spherical, giving a ratio of 1, but in
45+
practice will be less than 1.
46+
47+
@see: inertia, jacob0
48+
'''
49+
n = robot.n
5250
q = mat(q)
5351
w = array([])
54-
if which == 'yoshikawa' or which == 'yoshi' or which == 'y':
52+
if 'yoshikawa'.startswith(which):
5553
if numrows(q)==1:
5654
return yoshi(robot,q)
5755
for Q in q:
5856
w = concatenate((w,array([yoshi(robot,Q)])))
59-
if which == 'asada' or which == 'a':
57+
elif 'asada'.startswith(which):
6058
if numrows(q)==1:
6159
return asada(robot,q)
6260
for Q in q:

0 commit comments

Comments
 (0)
0