|
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 | +""" |
31 | 7 |
|
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 $ |
41 | 8 |
|
42 |
| -# Copyright (C) 1993-2002, by Peter I. Corke |
43 | 9 |
|
44 | 10 | from numpy import *
|
45 | 11 | from jacob0 import *
|
|
48 | 14 | from numrows import *
|
49 | 15 |
|
50 | 16 | 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 |
52 | 50 | q = mat(q)
|
53 | 51 | w = array([])
|
54 |
| - if which == 'yoshikawa' or which == 'yoshi' or which == 'y': |
| 52 | + if 'yoshikawa'.startswith(which): |
55 | 53 | if numrows(q)==1:
|
56 | 54 | return yoshi(robot,q)
|
57 | 55 | for Q in q:
|
58 | 56 | w = concatenate((w,array([yoshi(robot,Q)])))
|
59 |
| - if which == 'asada' or which == 'a': |
| 57 | + elif 'asada'.startswith(which): |
60 | 58 | if numrows(q)==1:
|
61 | 59 | return asada(robot,q)
|
62 | 60 | for Q in q:
|
|
0 commit comments