10 #include <geometry_msgs/Twist.h> 15 #include "dsr_robot.h" 31 ros::Publisher pubMobile = node->advertise<geometry_msgs::Twist>(
"/"+
ROBOT_ID+
"/twist_marker_server/cmd_vel", 1000);
34 geometry_msgs::Twist msg;
42 msg.linear.x = x_odom;
43 msg.angular.z = z_angular;
44 pubMobile.publish(msg);
45 x_odom = x_odom + 0.1;
48 z_angular = z_angular + 0.005;
63 ROS_INFO(
"shutdown time! sig=%d",sig);
64 ROS_INFO(
"shutdown time! sig=%d",sig);
65 ROS_INFO(
"shutdown time! sig=%d",sig);
71 dsr_msgs::RobotStop msg;
73 msg.stop_mode = STOP_TYPE_QUICK;
74 pubRobotStop.publish(msg);
79 int main(
int argc,
char** argv)
82 const string my_robot_id =
"dsr01";
83 const string my_robot_model =
"m1013";
97 CDsrRobot robot(nh, my_robot_id, my_robot_model);
104 float p2[6]={0.0, 0.0, 90.0, 0.0, 90.0, 0.0};
106 float x1[6]={400, 500, 800.0, 0.0, 180.0, 0.0};
107 float x2[6]={400, 500, 500.0, 0.0, 180.0, 0.0};
108 float velx[2]={50, 50};
109 float accx[2]={100, 100};
112 float veljx[6] = {50, 50, 50, 50, 50, 50};
113 float accjx[6] = {100, 100, 100, 100, 100, 100};
114 float fCirclePos[2][6] = {{559,434.5,651.5,0,180,0}, {559,434.5,251.5,0,180,0}};
116 float amp[6] = {10,0,0,0,30,0};
117 float periodic[6] = {1,0,1.5,0,0,0};
119 float fSJPos[3][6] = {{10, -10, 20, -30, 10, 20}, {25, 0, 10, -50, 20, 40}, {50, 50, 50, 50, 50, 50}};
120 float fSXPos[3][6] = {{600, 600, 600, 0, 175, 0},{600, 750, 600, 0, 175, 0},{150, 600, 450, 0, 175, 0}};
122 float bx1[2][6] = {{370, 670, 650, 0, 180, 0}, {370, 670, 650, 0, 180, 0}};
123 float bx2[2][6] = {{370, 670, 400, 0, 180, 0},{370, 545, 400, 0, 180, 0}};
124 float bx3[2][6] = {{370, 595, 400, 0, 180, 0}, {370, 595, 400, 0, 180, 0}};
127 for(
int i=0; i<2; i++){
128 for(
int j=0; j<6; j++){
129 posb[0]._fTargetPos[i][j] = bx1[i][j];
132 for(
int i=0; i<2; i++){
133 for(
int j=0; j<6; j++){
134 posb[1]._fTargetPos[i][j] = bx2[i][j];
137 for(
int i=0; i<2; i++){
138 for(
int j=0; j<6; j++){
139 posb[2]._fTargetPos[i][j] = bx3[i][j];
142 posb[0]._iBlendType = 0;
143 posb[1]._iBlendType = 1;
144 posb[2]._iBlendType = 0;
145 posb[0]._fBlendRad = 20;
146 posb[1]._fBlendRad = 20;
147 posb[2]._fBlendRad = 20;
151 robot.movej(p1, 30, 30);
152 robot.movej(p2, 30, 30);
153 robot.movel(x1, velx, accx);
154 robot.movel(x2, velx, accx);
156 robot.movec(fCirclePos, velx, accx);
157 robot.move_periodic(amp, periodic, 0.5, 3, 0);
158 robot.move_spiral(9.5, 20.0, 50.0, velx, accx, 20.0, TASK_AXIS_Z);
159 robot.movesj(fSJPos,3, 30, 100);
160 robot.movesx(fSXPos, 3, velx, accx);
162 robot.moveb(posb, 3, velx, accx);
166 ROS_INFO(
"single_robot_mobile_circle_cpp finished !!!!!!!!!!!!!!!!!!!!!");
167 ROS_INFO(
"single_robot_mobile_circle_cpp finished !!!!!!!!!!!!!!!!!!!!!");
168 ROS_INFO(
"single_robot_mobile_circle_cpp finished !!!!!!!!!!!!!!!!!!!!!");
173 ROS_INFO(
"single_robot_mobile_cpp finished !!!!!!!!!!!!!!!!!!!!!");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void shutdown()
int main(int argc, char **argv)
void SET_ROBOT(string id, string model)
static void thread_mobile()