Classes | Functions | Variables
python.hrpsys_config Namespace Reference

Classes

class  HrpsysConfigurator
 

Functions

def euler_from_matrix (matrix, axes='sxyz')
 
def euler_matrix (ai, aj, ak, axes='sxyz')
 

Variables

dictionary _AXES2TUPLE
 
float _EPS = numpy.finfo(float).eps*4.0
 
list _NEXT_AXIS = [1, 2, 0, 1]
 
 hcf = HrpsysConfigurator()
 

Function Documentation

def python.hrpsys_config.euler_from_matrix (   matrix,
  axes = 'sxyz' 
)
Return Euler angles from rotation matrix for specified axis sequence.

axes : One of 24 axis sequences as string or encoded tuple

Note that many Euler angle triplets can describe one matrix.

>>> R0 = euler_matrix(1, 2, 3, 'syxz')
>>> al, be, ga = euler_from_matrix(R0, 'syxz')
>>> R1 = euler_matrix(al, be, ga, 'syxz')
>>> numpy.allclose(R0, R1)
True
>>> angles = (4.0*math.pi) * (numpy.random.random(3) - 0.5)
>>> for axes in _AXES2TUPLE.keys():
...    R0 = euler_matrix(axes=axes, *angles)
...    R1 = euler_matrix(axes=axes, *euler_from_matrix(R0, axes))
...    if not numpy.allclose(R0, R1): print axes, "failed"

Definition at line 101 of file hrpsys_config.py.

def python.hrpsys_config.euler_matrix (   ai,
  aj,
  ak,
  axes = 'sxyz' 
)
Return homogeneous rotation matrix from Euler angles and axis sequence.

ai, aj, ak : Euler's roll, pitch and yaw angles
axes : One of 24 axis sequences as string or encoded tuple

>>> R = euler_matrix(1, 2, 3, 'syxz')
>>> numpy.allclose(numpy.sum(R[0]), -1.34786452)
True
>>> R = euler_matrix(1, 2, 3, (0, 1, 0, 1))
>>> numpy.allclose(numpy.sum(R[0]), -0.383436184)
True
>>> ai, aj, ak = (4.0*math.pi) * (numpy.random.random(3) - 0.5)
>>> for axes in _AXES2TUPLE.keys():
...    R = euler_matrix(ai, aj, ak, axes)
>>> for axes in _TUPLE2AXES.keys():
...    R = euler_matrix(ai, aj, ak, axes)

Definition at line 38 of file hrpsys_config.py.

Variable Documentation

dictionary python.hrpsys_config._AXES2TUPLE
private
Initial value:
1 = {
2  'sxyz': (0, 0, 0, 0), 'sxyx': (0, 0, 1, 0), 'sxzy': (0, 1, 0, 0),
3  'sxzx': (0, 1, 1, 0), 'syzx': (1, 0, 0, 0), 'syzy': (1, 0, 1, 0),
4  'syxz': (1, 1, 0, 0), 'syxy': (1, 1, 1, 0), 'szxy': (2, 0, 0, 0),
5  'szxz': (2, 0, 1, 0), 'szyx': (2, 1, 0, 0), 'szyz': (2, 1, 1, 0),
6  'rzyx': (0, 0, 0, 1), 'rxyx': (0, 0, 1, 1), 'ryzx': (0, 1, 0, 1),
7  'rxzx': (0, 1, 1, 1), 'rxzy': (1, 0, 0, 1), 'ryzy': (1, 0, 1, 1),
8  'rzxy': (1, 1, 0, 1), 'ryxy': (1, 1, 1, 1), 'ryxz': (2, 0, 0, 1),
9  'rzxz': (2, 0, 1, 1), 'rxyz': (2, 1, 0, 1), 'rzyz': (2, 1, 1, 1)}

Definition at line 21 of file hrpsys_config.py.

float python.hrpsys_config._EPS = numpy.finfo(float).eps*4.0
private

Definition at line 35 of file hrpsys_config.py.

list python.hrpsys_config._NEXT_AXIS = [1, 2, 0, 1]
private

Definition at line 32 of file hrpsys_config.py.

python.hrpsys_config.hcf = HrpsysConfigurator()

Definition at line 2313 of file hrpsys_config.py.



hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:53