15 #include "dsr_robot.h" 33 float JReady[6] = {0, -20, 110, 0, 60, 0};
36 float J00[6] = {-180, 0, -145, 0, -35, 0};
37 float J01r[6] = {-180.0, 71.4, -145.0, 0.0, -9.7, 0.0};
38 float J02r[6] = {-180.0, 67.7, -144.0, 0.0, 76.3, 0.0};
39 float J03r[6] = {-180.0, 0.0, 0.0, 0.0, 0.0, 0.0};
40 float J04r[6] = {-90.0, 0.0, 0.0, 0.0, 0.0, 0.0};
41 float J04r1[6] = {-90.0, 30.0, -60.0, 0.0, 30.0, -0.0};
42 float J04r2[6] = {-90.0, -45.0, 90.0, 0.0, -45.0, -0.0};
43 float J04r3[6] = {-90.0, 60.0, -120.0, 0.0, 60.0, -0.0};
44 float J04r4[6] = {-90.0, 0.0, -0.0, 0.0, 0.0, -0.0};
45 float J05r[6] = {-144.0, -4.0, -84.8, -90.9, 54.0, -1.1};
47 float J07r[6] = {-152.4, 12.4, -78.6, 18.7, -68.3, -37.7};
48 float J08r[6] = {-90.0, 30.0, -120.0, -90.0, -90.0, 0.0};
49 float JEnd[6] = {0.0, -12.6, 101.1, 0.0, 91.5, -0.0};
50 float dREL1[6] = {0, 0, 350, 0, 0, 0};
51 float dREL2[6] = {0, 0, -350, 0, 0, 0};
56 float J1[6] = {81.2, 20.8, 127.8, 162.5, 56.1, -37.1};
57 float X0[6] = {-88.7, 799.0, 182.3, 95.7, 93.7, 133.9};
58 float X1[6] = {304.2, 871.8, 141.5, 99.5, 84.9, 133.4};
59 float X2[6] = {437.1, 876.9, 362.1, 99.6, 84.0, 132.1};
60 float X3[6] = {-57.9, 782.4, 478.4, 99.6, 84.0, 132.1};
61 float amp[6] = {0, 0, 0, 30, 30, 0};
62 float period[6] = {0, 0, 0, 3, 6, 0};
63 float x01[6] = {423.6, 334.5, 651.2, 84.7, -180.0, 84.7};
64 float x02[6] = {423.6, 34.5, 951.2, 68.2, -180.0, 68.2};
65 float x03[6] = {423.6, -265.5, 651.2, 76.1, -180.0, 76.1};
66 float x04[6] = {423.6, 34.5, 351.2, 81.3, -180.0, 81.3};
73 CDsrRobot r(nh,
"dsr01",
"m1013");
81 r.config_create_tcp(
"TCP_ZERO",
TCP_POS);
84 r.set_current_tcp(
"TCP_ZERO");
87 r.movej(
J1, 20, 20, 0);
92 for(
int i=0; i<2; i++){
94 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
97 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
103 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
106 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
109 r.movel(
X3,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
113 r.movej(
J00, 60, 60);
116 r.movej(
J01r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
119 r.movej(
J02r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
122 r.movej(
J03r, 30, 30, 0);
125 r.movej(
J04r, 30, 30, 0);
128 r.movej(
J04r1, 30, 30, 0, MOVE_MODE_ABSOLUTE);
131 r.movej(
J04r2, 30, 30, 0, MOVE_MODE_ABSOLUTE);
134 r.movej(
J04r3, 30, 30, 0, MOVE_MODE_ABSOLUTE);
137 r.movej(
J04r4, 30, 30, 0);
140 r.movej(
J05r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
143 r.movel(
dREL1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
146 r.movel(
dREL2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
149 r.movej(
J07r, 60, 60, 0, MOVE_MODE_ABSOLUTE);
152 r.movej(
J08r, 60, 60);
155 r.movej(
JEnd, 60, 60);
158 r.move_periodic(
amp,
period, 0, 2, MOVE_REFERENCE_TOOL);
161 r.move_spiral(3, 200, 100,
vel_spi,
acc_spi, 0, TASK_AXIS_X, MOVE_REFERENCE_TOOL);
167 r.movel(
x04,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
170 r.movel(
x03,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
173 r.movel(
x02,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
178 for(
int i=0; i<6; i++){
184 r.movec(
x0204c,
velx,
accx, 0 , MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
191 CDsrRobot r(nh,
"dsr02",
"m1013");
199 r.config_create_tcp(
"TCP_ZERO",
TCP_POS);
202 r.set_current_tcp(
"TCP_ZERO");
205 r.movej(
J1, 20, 20, 0);
210 for(
int i=0; i<2; i++){
212 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
215 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
221 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
224 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
227 r.movel(
X3,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
231 r.movej(
J00, 60, 60);
234 r.movej(
J01r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
237 r.movej(
J02r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
240 r.movej(
J03r, 30, 30, 0);
243 r.movej(
J04r, 30, 30, 0);
246 r.movej(
J04r1, 30, 30, 0, MOVE_MODE_ABSOLUTE);
249 r.movej(
J04r2, 30, 30, 0, MOVE_MODE_ABSOLUTE);
252 r.movej(
J04r3, 30, 30, 0, MOVE_MODE_ABSOLUTE);
255 r.movej(
J04r4, 30, 30, 0);
258 r.movej(
J05r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
261 r.movel(
dREL1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
264 r.movel(
dREL2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
267 r.movej(
J07r, 60, 60, 0, MOVE_MODE_ABSOLUTE);
270 r.movej(
J08r, 60, 60);
273 r.movej(
JEnd, 60, 60);
276 r.move_periodic(
amp,
period, 0, 2, MOVE_REFERENCE_TOOL);
279 r.move_spiral(3, 200, 100,
vel_spi,
acc_spi, 0, TASK_AXIS_X, MOVE_REFERENCE_TOOL);
285 r.movel(
x04,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
288 r.movel(
x03,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
291 r.movel(
x02,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
296 for(
int i=0; i<6; i++){
302 r.movec(
x0204c,
velx,
accx, 0 , MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
373 dsr_msgs::RobotStop msg;
375 msg.stop_mode = STOP_TYPE_QUICK;
377 pubRobotStop.publish(msg);
378 pubRobotStop2.publish(msg);
384 int main(
int argc,
char** argv)
405 double max_time = 0.0;
406 double cur_time = 0.0;
414 ROS_INFO(
"m1013x2_sync2_cpp finished !!!!!!!!!!!!!!!!!!!!!");
void thread_robot1(ros::NodeHandle nh)
void thread_robot5(ros::NodeHandle nh)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void thread_robot6(ros::NodeHandle nh)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void thread_robot3(ros::NodeHandle nh)
void thread_robot4(ros::NodeHandle nh)
ROSCPP_DECL void shutdown()
void thread_robot2(ros::NodeHandle nh)
int main(int argc, char **argv)
CRobotSync RobotSync(NUM_ROBOT)