11 #include <boost/thread/thread.hpp> 14 #include "dsr_robot.h" 34 dsr_msgs::Robotiq2FOpen srvOpen;
36 if(srvRobotiq2FOpen.
call(srvOpen))
39 return (srvOpen.response.success);
43 ROS_ERROR(
"Failed to call service dr_control_service : gripper_move\n");
50 dsr_msgs::Robotiq2FClose srvClose;
52 if(srvRobotiq2FClose.
call(srvClose))
55 return (srvClose.response.success);
59 ROS_ERROR(
"Failed to call service dr_control_service : robotiq_2f_close\n");
86 ROS_INFO(
"shutdown time! sig=%d",sig);
87 ROS_INFO(
"shutdown time! sig=%d",sig);
88 ROS_INFO(
"shutdown time! sig=%d",sig);
94 dsr_msgs::RobotStop msg;
96 msg.stop_mode = STOP_TYPE_QUICK;
97 pubRobotStop.publish(msg);
102 int main(
int argc,
char** argv)
105 string my_robot_id =
"dsr01";
106 string my_robot_model =
"m1013";
109 ROS_INFO(
"default arguments: dsr01 m1013");
113 ROS_ERROR(
"invalid arguments: <ns> <model> (ex) dsr01 m1013");
116 for (
int i = 1; i < argc; i++){
117 printf(
"argv[%d] = %s\n", i, argv[i]);
119 my_robot_id = argv[1];
120 my_robot_model = argv[2];
136 CDsrRobot robot(nh, my_robot_id, my_robot_model);
142 float p0[6]={0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
143 float p1[6]={0.0, 0.0, 90.0, 0.0, 90.0 , 0.0};
144 float p2[6]={180.0, 0.0, 90, 0.0, 90.0, 0.0};
146 float x1[6]={0, 0, -200, 0, 0, 0};
147 float x2[6]={0, 0, 200, 0, 0, 0};
148 float velx[2]={50, 50};
149 float accx[2]={100, 100};
153 robot.movej(p0, 60, 30);
154 robot.movej(p1, 60, 30);
156 robot.movel(x1, velx, accx, 2, 0.
f, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE);
159 robot.movel(x2, velx, accx, 2, 0.
f, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE);
161 robot.movej(p2, 60, 30, 3);
162 robot.movel(x1, velx, accx, 2, 0.
f, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE);
165 robot.movel(x2, velx, accx, 2, 0.
f, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE);
168 ROS_INFO(
"pick_and_place_simple_cpp finished !!!!!!!!!!!!!!!!!!!!!");
169 ROS_INFO(
"pick_and_place_simple_cpp finished !!!!!!!!!!!!!!!!!!!!!");
170 ROS_INFO(
"pick_and_place_simple_cpp finished !!!!!!!!!!!!!!!!!!!!!");
175 ROS_INFO(
"pick_and_place_simple_cpp finished !!!!!!!!!!!!!!!!!!!!!");
int gripper_move(bool flag)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
static void thread_subscriber()
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void shutdown()
void SET_ROBOT(string id, string model)
int main(int argc, char **argv)