#ifdef RTAPI #include "rtapi.h" #include "rtapi_app.h" #include "hal.h" int kinematicsForward(const double *joint, EmcPose *world, const KINEMATICS_FORWARD_FLAGS *fflags, KINEMATICS_INVERSE_FLAGS *iflags) {double AD2 = joints[0] * joints[0]; double BD2 = joints[1] * joints[1]; double x = (AD2 - BD2 + Bx * Bx) / (2 * Bx); double y2 = AD2 - x * x; if(y2 < 0) return -1; pos->tran.x = x; pos->tran.y = sqrt(y2); return 0;} int kinematicsInverse(const EmcPose * world, double *joints, const KINEMATICS_INVERSE_FLAGS *iflags, KINEMATICS_FORWARD_FLAGS *fflags) {double x2 = pos->tran.x * pos->tran.x; double y2 = pos->tran.y * pos->tran.y; joints[0] = sqrt(x2 + y2); joints[1] = sqrt((Bx - pos->tran.x)*(Bx - pos->tran.x) + y2); return 0;} KINEMATICS_TYPE kinematicsType(void) int kinematicsHome(EmcPose *world, double *joint, KINEMATICS_FORWARD_FLAGS *fflags, KINEMATICS_INVERSE_FLAGS *iflags)