feat!: update turret axis geometric model
This commit is contained in:
parent
3e745059a2
commit
547d51dfc7
|
|
@ -20,14 +20,14 @@ void cartesianToPolar(long &stepX, long &stepY, double zeroX, double zeroY,
|
||||||
double offsetY = 21.0; // laser to stand
|
double offsetY = 21.0; // laser to stand
|
||||||
double offsetX = 0.0; // unused
|
double offsetX = 0.0; // unused
|
||||||
|
|
||||||
x = -x; // natural axis direction
|
// x = -x; // natural axis direction
|
||||||
|
y = -y; // natural axis direction
|
||||||
double dX = x + offsetX;
|
double dX = x + offsetX;
|
||||||
double dY = y + offsetY;
|
double dY = y + offsetY;
|
||||||
double dZ = z + distance;
|
double dZ = z + distance;
|
||||||
|
|
||||||
double rho = sqrt(pow(dX, 2.0) + pow(dY, 2.0) + pow(dZ, 2.0));
|
double angleY = atan2(dZ, dY) - M_PI / 2;
|
||||||
double angleY = M_PI / 2.0 - acos(dY / rho);
|
double angleX = atan2(dZ, dX) - M_PI / 2;
|
||||||
double angleX = atan2(dX, dZ);
|
|
||||||
|
|
||||||
angleToStep(stepX, stepY, angleX, angleY);
|
angleToStep(stepX, stepY, angleX, angleY);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue