# -----------------------------------------------------------------------------# This file was autogenerated by symforce from template:# ops/CLASS/lie_group_ops.py.jinja# Do NOT modify by hand.# -----------------------------------------------------------------------------# ruff: noqa: PLR0915, F401, PLW0211, PLR0914importmathimporttypingasTimportnumpyimportsym
[docs]classLieGroupOps(object):""" Python LieGroupOps implementation for :py:class:`symforce.geo.pose2.Pose2`. """
[docs]@staticmethoddeffrom_tangent(vec,epsilon):# type: (numpy.ndarray, float) -> sym.Pose2# Total ops: 2# Input arraysifvec.shape==(3,):vec=vec.reshape((3,1))elifvec.shape!=(3,1):raiseIndexError("vec is expected to have shape (3, 1) or (3,); instead had shape {}".format(vec.shape))# Intermediate terms (0)# Output terms_res=[0.0]*4_res[0]=math.cos(vec[0,0])_res[1]=math.sin(vec[0,0])_res[2]=vec[1,0]_res[3]=vec[2,0]returnsym.Pose2.from_storage(_res)
[docs]@staticmethoddefretract(a,vec,epsilon):# type: (sym.Pose2, numpy.ndarray, float) -> sym.Pose2# Total ops: 10# Input arrays_a=a.dataifvec.shape==(3,):vec=vec.reshape((3,1))elifvec.shape!=(3,1):raiseIndexError("vec is expected to have shape (3, 1) or (3,); instead had shape {}".format(vec.shape))# Intermediate terms (2)_tmp0=math.sin(vec[0,0])_tmp1=math.cos(vec[0,0])# Output terms_res=[0.0]*4_res[0]=_a[0]*_tmp1-_a[1]*_tmp0_res[1]=_a[0]*_tmp0+_a[1]*_tmp1_res[2]=_a[2]+vec[1,0]_res[3]=_a[3]+vec[2,0]returnsym.Pose2.from_storage(_res)