11 #include <boost/thread/thread.hpp> 14 #include "dsr_robot.h" 15 #include "dsr_serial.h" 32 dsr_msgs::SerialSendData srv;
34 srv.request.data = send_data;
36 if(srvSerialSendData.call(srv))
39 return (srv.response.success);
43 ROS_ERROR(
"Failed to call service dr_control_service : serial_send_data\n");
69 ROS_INFO(
"shutdown time! sig=%d",sig);
70 ROS_INFO(
"shutdown time! sig=%d",sig);
71 ROS_INFO(
"shutdown time! sig=%d",sig);
77 dsr_msgs::RobotStop msg;
79 msg.stop_mode = STOP_TYPE_QUICK;
80 pubRobotStop.publish(msg);
85 int main(
int argc,
char** argv)
88 string my_robot_id =
"dsr01";
89 string my_robot_model =
"m1013";
91 ROS_INFO(
"default arguments: dsr01 m1013");
95 ROS_ERROR(
"invalid arguments: <ns> <model> (ex) dsr01 m1013");
98 for (
int i = 1; i < argc; i++){
99 printf(
"argv[%d] = %s\n", i, argv[i]);
101 my_robot_id = argv[1];
102 my_robot_model = argv[2];
117 CDsrRobot robot(nh, my_robot_id, my_robot_model);
124 float p0[6]={0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
125 float p1[6]={0.0, 0.0, 90.0, 0.0, 90.0 , 0.0};
126 float p2[6]={180.0, 0.0, 90, 0.0, 90.0, 0.0};
128 float x1[6]={0, 0, -200, 0, 0, 0};
129 float x2[6]={0, 0, 200, 0, 0, 0};
130 float velx[2]={50, 50};
131 float accx[2]={100, 100};
132 unsigned char init_data[15] = {0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x30};
133 unsigned char activation_data[15] = {0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x72, 0xE1};
134 unsigned char open_data[15] = {0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x09, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x72, 0x19};
135 unsigned char close_data[15] = {0x09, 0x10, 0x03, 0xE8, 0x00, 0x03, 0x06, 0x09, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x42, 0x29};
142 gripper_send_data(
"0x09\\0x10\\0x03\\0xE8\\0x00\\0x03\\0x06\\0x00\\0x00\\0x00\\0x00\\0x00\\0x00\\0x73\\0x30");
146 gripper_send_data(
"0x09\\0x10\\0x03\\0xE8\\0x00\\0x03\\0x06\\0x00\\0x00\\0x00\\0x00\\0x00\\0x00\\0x73\\0x30");
152 gripper_send_data(
"0x09\\0x10\\0x03\\0xE8\\0x00\\0x03\\0x06\\0x09\\0x00\\0x00\\0x00\\0xFF\\0xFF\\0x72\\0x19");
155 gripper_send_data(
"0x09\\0x10\\0x03\\0xE8\\0x00\\0x03\\0x06\\0x09\\0x00\\0x00\\0xFF\\0xFF\\0xFF\\0x42\\0x29");
161 ROS_INFO(
"real_pick_and_place finished !!!!!!!!!!!!!!!!!!!!!");
162 ROS_INFO(
"real_pick_and_place finished !!!!!!!!!!!!!!!!!!!!!");
163 ROS_INFO(
"real_pick_and_place finished !!!!!!!!!!!!!!!!!!!!!");
168 ROS_INFO(
"real_pick_and_place finished !!!!!!!!!!!!!!!!!!!!!");
void SET_ROBOT(string id, string model)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
int gripper_send_data(string send_data)
static void thread_subscriber()
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void shutdown()