13 #include "dsr_robot.h" 40 dsr_msgs::RobotStop msg;
42 msg.stop_mode = STOP_TYPE_QUICK;
43 pubRobotStop.publish(msg);
48 int main(
int argc,
char** argv)
60 const string my_robot_id =
"dsr01";
61 const string my_robot_model =
"m1013";
63 CDsrRobot robot(nh, my_robot_id, my_robot_model);
67 float JReady[6] = {0, -20, 110, 0, 60, 0};
69 float TCP_POS[6] = {0, 0, 0,0 ,0, 0};
70 float J00[6] = {-180, 0, -145, 0, -35, 0};
72 float J01r[6] = {-180.0, 71.4, -145.0, 0.0, -9.7, 0.0};
73 float J02r[6] = {-180.0, 67.7, -144.0, 0.0, 76.3, 0.0};
74 float J03r[6] = {-180.0, 0.0, 0.0, 0.0, 0.0, 0.0};
76 float J04r[6] = {-90.0, 0.0, 0.0, 0.0, 0.0, 0.0};
77 float J04r1[6] = {-90.0, 30.0, -60.0, 0.0, 30.0, -0.0};
78 float J04r2[6] = {-90.0, -45.0, 90.0, 0.0, -45.0, -0.0};
79 float J04r3[6] = {-90.0, 60.0, -120.0, 0.0, 60.0, -0.0};
80 float J04r4[6] = {-90.0, 0.0, -0.0, 0.0, 0.0, -0.0};
82 float J05r[6] = {-144.0, -4.0, -84.8, -90.9, 54.0, -1.1};
84 float J07r[6] = {-152.4, 12.4, -78.6, 18.7, -68.3, -37.7};
85 float J08r[6] = {-90.0, 30.0, -120.0, -90.0, -90.0, 0.0};
87 float JEnd[6] = {0.0, -12.6, 101.1, 0.0, 91.5, -0.0};
89 float dREL1[6] = {0, 0, 350, 0, 0, 0};
90 float dREL2[6] = {0, 0, -350, 0, 0, 0};
92 float velx[2] = {0,0};
93 float accx[2] = {0, 0};
98 float J1[6] = {81.2, 20.8, 127.8, 162.5, 56.1, -37.1};
99 float X0[6] = {-88.7, 799.0, 182.3, 95.7, 93.7, 133.9};
100 float X1[6] = {304.2, 871.8, 141.5, 99.5, 84.9, 133.4};
101 float X2[6] = {437.1, 876.9, 362.1, 99.6, 84.0, 132.1};
102 float X3[6] = {-57.9, 782.4, 478.4, 99.6, 84.0, 132.1};
104 float amp[6] = {0, 0, 0, 30, 30, 0};
105 float period[6] = {0, 0, 0, 3, 6, 0};
107 float x01[6] = {423.6, 334.5, 651.2, 84.7, -180.0, 84.7};
108 float x02[6] = {423.6, 34.5, 951.2, 68.2, -180.0, 68.2};
109 float x03[6] = {423.6, -265.5, 651.2, 76.1, -180.0, 76.1};
110 float x04[6] = {423.6, 34.5, 351.2, 81.3, -180.0, 81.3};
117 robot.movej(JReady, 20, 20);
118 robot.config_create_tcp(
"TCP_ZERO", TCP_POS);
119 robot.set_current_tcp(
"TCP_ZERO");
121 robot.movej(J1, 0, 0, 3);
122 robot.movel(X3, velx, accx, 2.5);
124 for(
int i=0; i<2; i++){
125 robot.movel(X2, velx, accx, 2.5, 50, MOVE_REFERENCE_BASE, MOVE_MODE_ABSOLUTE);
126 robot.movel(X1, velx, accx, 1.5, 50, MOVE_REFERENCE_BASE, MOVE_MODE_ABSOLUTE);
127 robot.movel(X0, velx, accx, 2.5);
128 robot.movel(X1, velx, accx, 2.5, 50, MOVE_REFERENCE_BASE, MOVE_MODE_ABSOLUTE);
129 robot.movel(X2, velx, accx, 1.5, 50, MOVE_REFERENCE_BASE, MOVE_MODE_ABSOLUTE);
130 robot.movel(X3, velx, accx, 2.5, 50, MOVE_REFERENCE_BASE, MOVE_MODE_ABSOLUTE);
133 robot.movej(J00, 60, 60, 6);
135 robot.movej(J01r, 0, 0, 2, 100);
136 robot.movej(J02r, 0, 0, 2, 50);
137 robot.movej(J03r, 0, 0, 2);
139 robot.movej(J04r, 0, 0, 1.5);
140 robot.movej(J04r1, 0, 0, 2, 50);
141 robot.movej(J04r2, 0, 0, 4, 50);
142 robot.movej(J04r3, 0, 0, 4, 50);
143 robot.movej(J04r4, 0, 0, 2);
145 robot.movej(J05r, 0, 0, 2.5, 100);
146 robot.movel(dREL1, velx, accx, 1, 50, MOVE_REFERENCE_TOOL, MOVE_MODE_ABSOLUTE);
147 robot.movel(dREL2, velx, accx, 1.5, 100, MOVE_REFERENCE_TOOL, MOVE_MODE_ABSOLUTE);
149 robot.movej(J07r, 60, 60, 1.5, 100);
150 robot.movej(J08r, 60, 60, 2);
152 robot.movej(JEnd, 60, 60, 4);
154 robot.move_periodic(amp, period, 0, 1, MOVE_REFERENCE_TOOL);
155 robot.move_spiral(3, 200, 100, vel_spi, acc_spi, 0, TASK_AXIS_X, MOVE_REFERENCE_TOOL);
157 robot.movel(x01, velx, accx, 2);
158 robot.movel(x04, velx, accx, 2, 100, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
159 robot.movel(x03, velx, accx, 2, 100, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
160 robot.movel(x02, velx, accx, 2, 100, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
161 robot.movel(x01, velx, accx, 2);
162 for(
int i=0; i<6; i++){
163 x0204c[0][i] = x02[i];
164 x0204c[1][i] = x04[i];
166 robot.movec(x0204c, velx, accx, 4, 360, MOVE_MODE_ABSOLUTE, MOVE_REFERENCE_BASE);
170 ROS_INFO(
"dance_m1013 finished !!!!!!!!!!!!!!!!!!!!!");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void SET_ROBOT(string id, string model)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)
ROSCPP_DECL void shutdown()