Basic RT components and utilities
..
|
Classes | |
class | HrpsysConfigurator |
Functions | |
def | euler_matrix |
def | euler_from_matrix |
Variables | |
dictionary | _AXES2TUPLE |
list | _NEXT_AXIS = [1, 2, 0, 1] |
tuple | _EPS = numpy.finfo(float) |
tuple | hcf = HrpsysConfigurator() |
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"
Referenced by python.hrpsys_config.HrpsysConfigurator.getCurrentRPY(), python.hrpsys_config.HrpsysConfigurator.getReferenceRPY(), and python.hrpsys_config.HrpsysConfigurator.setTargetPoseRelative().
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)
dictionary python.hrpsys_config._AXES2TUPLE |
tuple python.hrpsys_config._EPS = numpy.finfo(float) |
list python.hrpsys_config._NEXT_AXIS = [1, 2, 0, 1] |
tuple python.hrpsys_config.hcf = HrpsysConfigurator() |