@@ -102,13 +102,6 @@ class uArmClass
102102 // void writeAngle(byte servo_rot_angle, byte servo_left_angle, byte servo_right_angle);
103103 double readAngle (byte servo_num, byte trigger);
104104
105- // const byte kAddrOffset = 90;
106- // const byte kAddrServo = 60;
107- // const byte kServoRotReadPin = 2;
108- // const byte kServoLeftReadPin = 0;
109- // const byte kServoRightReadPin = 1;
110- // const byte kServoHandRotReadPin = 3;
111-
112105// Action control start
113106 void moveToOpts (double x, double y, double z, double hand_angle, byte relative_flags, double time, byte path_type, byte ease_type);
114107 void moveTo (double x, double y,double z) {moveToOpts (x, y, z, 0 , F_HAND_RELATIVE , 2.0 , PATH_LINEAR , INTERP_EASE_INOUT_CUBIC ); }
@@ -117,70 +110,47 @@ class uArmClass
117110 void moveTo (double x, double y, double z, int relative, double time, int servo_4_relative, double servo_4_angle) { moveToOpts (x, y, z, servo_4_angle, (relative ? F_POSN_RELATIVE : 0 ) | (servo_4_relative ? F_HAND_RELATIVE : 0 ), time, PATH_LINEAR , INTERP_EASE_INOUT_CUBIC ); }
118111 void moveToAtOnce (double x, double y, double z, int relative, double servo_4_angle) { moveToOpts (x, y, z, servo_4_angle, relative ? F_POSN_RELATIVE : 0 , 0.0 , PATH_LINEAR , INTERP_LINEAR ); }
119112
120- void drawCur (double length_1,double length_2,int angle, double time_spend);
121- void drawRec (double length_1,double length_2,double time_spend_per_length);
113+ void drawCur (double length_1,double length_2,int angle, double time_spend);
114+ void drawRec (double length_1,double length_2,double time_spend_per_length);
122115
123- double getTheta1 () const {return g_theta_1;}
124- double getTheta2 () const {return g_theta_2;}
125- double getTheta3 () const {return g_theta_3;}
116+ double getTheta1 () const {return g_theta_1;}
117+ double getTheta2 () const {return g_theta_2;}
118+ double getTheta3 () const {return g_theta_3;}
126119
127- double getCalX () {calXYZ (); return g_cal_x;}
128- double getCalY () {calXYZ (); return g_cal_y;}
129- double getCalZ () {calXYZ (); return g_cal_z;}
130- void getCalXYZ (double & x, double & y, double &z) {calXYZ (); x = g_cal_x; y = g_cal_y; z = g_cal_z;}
131- void getCalXYZ (double theta_1, double theta_2, double theta_3, double & x, double & y, double &z) {calXYZ (theta_1, theta_2, theta_3); x = g_cal_x; y = g_cal_y; z = g_cal_z;}
120+ double getCalX () {return g_cal_x;}
121+ double getCalY () {return g_cal_y;}
122+ double getCalZ () {return g_cal_z;}
123+ void getCalXYZ (double & x, double & y, double &z) {calXYZ (); x = g_cal_x; y = g_cal_y; z = g_cal_z;}
124+ void getCalXYZ (double theta_1, double theta_2, double theta_3, double & x, double & y, double &z) {calXYZ (theta_1, theta_2, theta_3); x = g_cal_x; y = g_cal_y; z = g_cal_z;}
132125
133- void calAngles (double x, double y, double z);
134- void getCalAngles (double x, double y, double z, double & theta_1, double & theta_2, double & theta_3) {calAngles (x, y, z); theta_1 = g_theta_1; theta_2 = g_theta_2; theta_3 = g_theta_3;}
126+ void calAngles (double x, double y, double z);
127+ void getCalAngles (double x, double y, double z, double & theta_1, double & theta_2, double & theta_3) {calAngles (x, y, z); theta_1 = g_theta_1; theta_2 = g_theta_2; theta_3 = g_theta_3;}
135128
136- void calXYZ (double theta_1, double theta_2, double theta_3);
137- void calXYZ ();
129+ void calXYZ (double theta_1, double theta_2, double theta_3);
130+ void calXYZ ();
138131
139- void gripperCatch ();
140- void gripperRelease ();
141- void interpolation (double init_val, double final_val, double (&interpol_val_array)[INTERP_INTVLS]);
142- void interpolate (double start_val, double end_val, double (&interp_vals)[INTERP_INTVLS], byte ease_type);
143- void pumpOn ();
144- void pumpOff ();
132+ void gripperCatch ();
133+ void gripperRelease ();
134+ void interpolate (double start_val, double end_val, double (&interp_vals)[INTERP_INTVLS], byte ease_type);
135+ void pumpOn ();
136+ void pumpOff ();
145137protected:
146- double cur_rot;
147- double cur_left;
148- double cur_right;
149- double cur_hand;
150- // double getInterPolValueArray(int num) const {return g_interpol_val_arr[10];}
151- double calYonly (double theta_1, double theta_2, double theta_3);
152-
153- // double g_x_in;
154- // double g_y_in;
155- // double g_z_in;
156- // double g_right_all;
157- // double g_sqrt_z_y;
158- double g_theta_1;
159- double g_theta_2;
160- double g_theta_3;
161- // double g_phi;
162- // double g_right_all_2;
163- // double g_sqrt_z_x;
164- double g_cal_x;
165- double g_cal_y;
166- double g_cal_z;
167-
168- // double g_l3_1_2;
169- // double g_l4_1_2;
170- // double g_l5_2;
171-
172- // double g_current_x;
173- // double g_current_y;
174- // double g_current_z;
175-
176-
177-
178- // double g_l3_1;
179- // double g_l4_1;
180- // double g_l5;
181-
138+ double cur_rot;
139+ double cur_left;
140+ double cur_right;
141+ double cur_hand;
142+ // double getInterPolValueArray(int num) const {return g_interpol_val_arr[10];}
143+ double calYonly (double theta_1, double theta_2, double theta_3);
144+
145+ double g_theta_1;
146+ double g_theta_2;
147+ double g_theta_3;
148+
149+ double g_cal_x;
150+ double g_cal_y;
151+ double g_cal_z;
182152
183- boolean g_gripper_reset;
153+ boolean g_gripper_reset;
184154// action control end
185155private:
186156 /* **************** Define variables *****************/
0 commit comments