File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1859,6 +1859,36 @@ def exp2jac(v):
1859
1859
)
1860
1860
return E
1861
1861
1862
+ def tr2x (T , representation = "rpy/xyz" ):
1863
+ t = transl (T )
1864
+ R = base .t2r (T )
1865
+ if representation == "rpy/xyz" :
1866
+ r = tr2rpy (R , order = "xyz" )
1867
+ elif representation == "rpy/zyx" :
1868
+ r = tr2rpy (R , order = "zyx" )
1869
+ elif representation == "eul" :
1870
+ r = tr2eul (R )
1871
+ elif representation == "exp" :
1872
+ r = trlog (R , twist = True )
1873
+ else :
1874
+ raise ValueError (f"unknown representation: { representation } " )
1875
+ return np .r_ [t , r ]
1876
+
1877
+ def x2tr (x , representation = "rpy/xyz" ):
1878
+ t = x [:3 ]
1879
+ r = x [3 :]
1880
+ if representation == "rpy/xyz" :
1881
+ R = rpy2r (r , order = "xyz" )
1882
+ elif representation == "rpy/zyx" :
1883
+ R = rpy2r (r , order = "zyx" )
1884
+ elif representation == "eul" :
1885
+ R = eul2r (r )
1886
+ elif representation == "exp" :
1887
+ R = trexp (r )
1888
+ else :
1889
+ raise ValueError (f"unknown representation: { representation } " )
1890
+ return base .rt2tr (R , t )
1891
+
1862
1892
1863
1893
def rot2jac (R , representation = "rpy-xyz" ):
1864
1894
"""
You can’t perform that action at this time.
0 commit comments