15 #include "dsr_robot.h" 31 float JReady[6] = {0, -20, 110, 0, 60, 0};
34 float J00[6] = {-180, 0, -145, 0, -35, 0};
35 float J01r[6] = {-180.0, 71.4, -145.0, 0.0, -9.7, 0.0};
36 float J02r[6] = {-180.0, 67.7, -144.0, 0.0, 76.3, 0.0};
37 float J03r[6] = {-180.0, 0.0, 0.0, 0.0, 0.0, 0.0};
38 float J04r[6] = {-90.0, 0.0, 0.0, 0.0, 0.0, 0.0};
39 float J04r1[6] = {-90.0, 30.0, -60.0, 0.0, 30.0, -0.0};
40 float J04r2[6] = {-90.0, -45.0, 90.0, 0.0, -45.0, -0.0};
41 float J04r3[6] = {-90.0, 60.0, -120.0, 0.0, 60.0, -0.0};
42 float J04r4[6] = {-90.0, 0.0, -0.0, 0.0, 0.0, -0.0};
43 float J05r[6] = {-144.0, -4.0, -84.8, -90.9, 54.0, -1.1};
45 float J07r[6] = {-152.4, 12.4, -78.6, 18.7, -68.3, -37.7};
46 float J08r[6] = {-90.0, 30.0, -120.0, -90.0, -90.0, 0.0};
47 float JEnd[6] = {0.0, -12.6, 101.1, 0.0, 91.5, -0.0};
48 float dREL1[6] = {0, 0, 350, 0, 0, 0};
49 float dREL2[6] = {0, 0, -350, 0, 0, 0};
54 float J1[6] = {81.2, 20.8, 127.8, 162.5, 56.1, -37.1};
55 float X0[6] = {-88.7, 799.0, 182.3, 95.7, 93.7, 133.9};
56 float X1[6] = {304.2, 871.8, 141.5, 99.5, 84.9, 133.4};
57 float X2[6] = {437.1, 876.9, 362.1, 99.6, 84.0, 132.1};
58 float X3[6] = {-57.9, 782.4, 478.4, 99.6, 84.0, 132.1};
59 float amp[6] = {0, 0, 0, 30, 30, 0};
60 float period[6] = {0, 0, 0, 3, 6, 0};
61 float x01[6] = {423.6, 334.5, 651.2, 84.7, -180.0, 84.7};
62 float x02[6] = {423.6, 34.5, 951.2, 68.2, -180.0, 68.2};
63 float x03[6] = {423.6, -265.5, 651.2, 76.1, -180.0, 76.1};
64 float x04[6] = {423.6, 34.5, 351.2, 81.3, -180.0, 81.3};
71 CDsrRobot r(nh,
"dsr01",
"m1013");
79 r.config_create_tcp(
"TCP_ZERO",
TCP_POS);
82 r.set_current_tcp(
"TCP_ZERO");
85 r.movej(
J1, 20, 20, 0);
90 for(
int i=0; i<2; i++){
92 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
95 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
101 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
104 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
107 r.movel(
X3,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
111 r.movej(
J00, 60, 60);
114 r.movej(
J01r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
117 r.movej(
J02r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
120 r.movej(
J03r, 30, 30, 0);
123 r.movej(
J04r, 30, 30, 0);
126 r.movej(
J04r1, 30, 30, 0, MOVE_MODE_ABSOLUTE);
129 r.movej(
J04r2, 30, 30, 0, MOVE_MODE_ABSOLUTE);
132 r.movej(
J04r3, 30, 30, 0, MOVE_MODE_ABSOLUTE);
135 r.movej(
J04r4, 30, 30, 0);
138 r.movej(
J05r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
141 r.movel(
dREL1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
144 r.movel(
dREL2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
147 r.movej(
J07r, 60, 60, 0, MOVE_MODE_ABSOLUTE);
150 r.movej(
J08r, 60, 60);
153 r.movej(
JEnd, 60, 60);
156 r.move_periodic(
amp,
period, 0, 2, MOVE_REFERENCE_TOOL);
159 r.move_spiral(3, 200, 100,
vel_spi,
acc_spi, 0, TASK_AXIS_X, MOVE_REFERENCE_TOOL);
165 r.movel(
x04,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
168 r.movel(
x03,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
171 r.movel(
x02,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
176 for(
int i=0; i<6; i++){
182 r.movec(
x0204c,
velx,
accx, 0 , MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
189 CDsrRobot r(nh,
"dsr02",
"m1013");
197 r.config_create_tcp(
"TCP_ZERO",
TCP_POS);
200 r.set_current_tcp(
"TCP_ZERO");
203 r.movej(
J1, 20, 20, 0);
208 for(
int i=0; i<2; i++){
210 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
213 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
219 r.movel(
X1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
222 r.movel(
X2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
225 r.movel(
X3,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
229 r.movej(
J00, 60, 60);
232 r.movej(
J01r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
235 r.movej(
J02r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
238 r.movej(
J03r, 30, 30, 0);
241 r.movej(
J04r, 30, 30, 0);
244 r.movej(
J04r1, 30, 30, 0, MOVE_MODE_ABSOLUTE);
247 r.movej(
J04r2, 30, 30, 0, MOVE_MODE_ABSOLUTE);
250 r.movej(
J04r3, 30, 30, 0, MOVE_MODE_ABSOLUTE);
253 r.movej(
J04r4, 30, 30, 0);
256 r.movej(
J05r, 30, 30, 0, MOVE_MODE_ABSOLUTE);
259 r.movel(
dREL1,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
262 r.movel(
dREL2,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_TOOL);
265 r.movej(
J07r, 60, 60, 0, MOVE_MODE_ABSOLUTE);
268 r.movej(
J08r, 60, 60);
271 r.movej(
JEnd, 60, 60);
274 r.move_periodic(
amp,
period, 0, 2, MOVE_REFERENCE_TOOL);
277 r.move_spiral(3, 200, 100,
vel_spi,
acc_spi, 0, TASK_AXIS_X, MOVE_REFERENCE_TOOL);
283 r.movel(
x04,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
286 r.movel(
x03,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
289 r.movel(
x02,
velx,
accx, 0, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
294 for(
int i=0; i<6; i++){
300 r.movec(
x0204c,
velx,
accx, 0 , MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
371 dsr_msgs::RobotStop msg;
373 msg.stop_mode = STOP_TYPE_QUICK;
375 pubRobotStop.publish(msg);
376 pubRobotStop2.publish(msg);
382 int main(
int argc,
char** argv)
403 double max_time = 0.0;
404 double cur_time = 0.0;
412 ROS_INFO(
"multi_robot_cpp finished !!!!!!!!!!!!!!!!!!!!!");
void thread_robot4(ros::NodeHandle nh)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
void thread_robot2(ros::NodeHandle nh)
void thread_robot5(ros::NodeHandle nh)
void thread_robot1(ros::NodeHandle nh)
void thread_robot3(ros::NodeHandle nh)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void thread_robot6(ros::NodeHandle nh)
CRobotSync RobotSync(NUM_ROBOT)
ROSCPP_DECL void shutdown()