add getter for LocalCoord transformation matrices
parent
8ad1135e80
commit
29262db5d6
|
@ -20,11 +20,10 @@ ECEF geodetic2ecef(Geodetic g);
|
||||||
Geodetic ecef2geodetic(ECEF e);
|
Geodetic ecef2geodetic(ECEF e);
|
||||||
|
|
||||||
class LocalCoord {
|
class LocalCoord {
|
||||||
private:
|
public:
|
||||||
Eigen::Matrix3d ned2ecef_matrix;
|
Eigen::Matrix3d ned2ecef_matrix;
|
||||||
Eigen::Matrix3d ecef2ned_matrix;
|
Eigen::Matrix3d ecef2ned_matrix;
|
||||||
Eigen::Vector3d init_ecef;
|
Eigen::Vector3d init_ecef;
|
||||||
public:
|
|
||||||
LocalCoord(Geodetic g, ECEF e);
|
LocalCoord(Geodetic g, ECEF e);
|
||||||
LocalCoord(Geodetic g) : LocalCoord(g, ::geodetic2ecef(g)) {}
|
LocalCoord(Geodetic g) : LocalCoord(g, ::geodetic2ecef(g)) {}
|
||||||
LocalCoord(ECEF e) : LocalCoord(::ecef2geodetic(e), e) {}
|
LocalCoord(ECEF e) : LocalCoord(::ecef2geodetic(e), e) {}
|
||||||
|
|
|
@ -55,6 +55,9 @@ cdef extern from "coordinates.cc":
|
||||||
Geodetic ecef2geodetic(ECEF)
|
Geodetic ecef2geodetic(ECEF)
|
||||||
|
|
||||||
cdef cppclass LocalCoord_c "LocalCoord":
|
cdef cppclass LocalCoord_c "LocalCoord":
|
||||||
|
Matrix3 ned2ecef_matrix
|
||||||
|
Matrix3 ecef2ned_matrix
|
||||||
|
|
||||||
LocalCoord_c(Geodetic, ECEF)
|
LocalCoord_c(Geodetic, ECEF)
|
||||||
LocalCoord_c(Geodetic)
|
LocalCoord_c(Geodetic)
|
||||||
LocalCoord_c(ECEF)
|
LocalCoord_c(ECEF)
|
||||||
|
|
|
@ -120,6 +120,22 @@ cdef class LocalCoord:
|
||||||
elif ecef is not None:
|
elif ecef is not None:
|
||||||
self.lc = new LocalCoord_c(list2ecef(ecef))
|
self.lc = new LocalCoord_c(list2ecef(ecef))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ned2ecef_matrix(self):
|
||||||
|
return matrix2numpy(self.lc.ned2ecef_matrix)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ecef2ned_matrix(self):
|
||||||
|
return matrix2numpy(self.lc.ecef2ned_matrix)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ned_from_ecef_matrix(self):
|
||||||
|
return self.ecef2ned_matrix
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ecef_from_ned_matrix(self):
|
||||||
|
return self.ned2ecef_matrix
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_geodetic(cls, geodetic):
|
def from_geodetic(cls, geodetic):
|
||||||
return cls(geodetic=geodetic)
|
return cls(geodetic=geodetic)
|
||||||
|
|
Loading…
Reference in New Issue