22 #define deg2rad(x) (x*M_PI/180) 27 double t[2] = {0.3,-0.2};
28 printf(
"x_true = %f %f %f deg\n", t[0], t[1], theta*180/
M_PI);
30 double p[5][2] = {{1,0},{0,1},{-1,0},{2,1},{4,2}};
39 c[k].
q[0] = t[0] + p[k][0]*cos(theta) - p[k][1]*sin(theta);
40 c[k].
q[1] = t[1] + p[k][0]*sin(theta) + p[k][1]*cos(theta);
41 c[k].
C[0][0] = cos(alpha[k])*cos(alpha[k]);
42 c[k].
C[0][1] = c[k].
C[1][0] = cos(alpha[k])*sin(alpha[k]);
43 c[k].
C[1][1] = sin(alpha[k])*sin(alpha[k]);
49 printf(
"estimated x = %f %f %f deg\n", x[0], x[1],x[2]*180/
M_PI);
int gpc_solve(int K, const struct gpc_corr *c, const double *x0, const double *cov_x0, double *x_out)