fix signs in rotary delta solution
authorJim Morris <morris@wolfman.com>
Tue, 2 Feb 2016 06:41:26 +0000 (22:41 -0800)
committerJim Morris <morris@wolfman.com>
Tue, 2 Feb 2016 06:41:26 +0000 (22:41 -0800)
src/modules/robot/arm_solutions/RotaryDeltaSolution.cpp

index 26a411e..fe9aeed 100644 (file)
@@ -123,7 +123,7 @@ int RotaryDeltaSolution::delta_calcForward(float theta1, float theta2, float the
     x0 = (a1 * z0 + b1) / dnm;
     y0 = (a2 * z0 + b2) / dnm;
 
-    z0 += z_calc_offset; //nj
+    z0 -= z_calc_offset;
     return 0;
 }
 
@@ -144,8 +144,8 @@ void RotaryDeltaSolution::cartesian_to_actuator(const float cartesian_mm[], Actu
 
     //Code from Trossen Robotics tutorial, note we put the X axis at the back and not the front of the robot.
 
-    float x0 = cartesian_mm[X_AXIS];
-    float y0 = cartesian_mm[Y_AXIS];
+    float x0 = -cartesian_mm[X_AXIS];
+    float y0 = -cartesian_mm[Y_AXIS];
     float z_with_offset = cartesian_mm[Z_AXIS] + z_calc_offset; //The delta calculation below places zero at the top.  Subtract the Z offset to make zero at the bottom.
 
     int status =              delta_calcAngleYZ(x0,                    y0,                  z_with_offset, alpha_theta);