首页 > 代码库 > 初始化结构体

初始化结构体

typedef struct { /* RTK control/result type */
sol_t sol; /* RTK solution */
double rb[6]; /* base position/velocity (ecef) (m|m/s) */
int nx, na; /* number of float states/fixed states */
double tt; /* time difference between current and previous (s) */
double *x, *P; /* float states and their covariance */
double *xa, *Pa; /* fixed states and their covariance */
int nfix; /* number of continuous fixes of ambiguity */
ambc_t ambc[MAXSAT]; /* ambibuity control */
ssat_t ssat[MAXSAT]; /* satellite status */
int neb; /* bytes in error message buffer */
char errbuf[MAXERRMSG]; /* error message buffer */
prcopt_t opt; /* processing options */
} rtk_t;

rtk_t *rtk;
rtk = (rtk_t *)malloc(sizeof(rtk_t));

sol_t sol0 = { { 0 } };
ambc_t ambc0 = { { { 0 } } };
ssat_t ssat0 = { 0 };

直接赋值0就行了,不用搞七搞八。

初始化结构体