11 sys.dont_write_bytecode =
True 12 sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__),
"../../../../common/imp")) )
18 DR_init.__dsr__id = ROBOT_ID
19 DR_init.__dsr__model = ROBOT_MODEL
20 from DSR_ROBOT
import *
30 ROBOT_ID = id; ROBOT_MODEL= model
33 print "shutdown time!" 34 print "shutdown time!" 35 print "shutdown time!" 37 pub_stop.publish(stop_mode=1)
44 item = Float64MultiArray()
51 if __name__ ==
"__main__":
54 my_robot_model =
"m1013" 57 rospy.init_node(
'pick_and_place_simple_py')
58 rospy.on_shutdown(shutdown)
61 pub_stop = rospy.Publisher(
'/'+ROBOT_ID +ROBOT_MODEL+
'/stop', RobotStop, queue_size=10)
66 srv_robotiq_2f_open = rospy.ServiceProxy(
'/' + ROBOT_ID + ROBOT_MODEL +
'/gripper/robotiq_2f_open', Robotiq2FOpen)
67 srv_robotiq_2f_close = rospy.ServiceProxy(
'/' + ROBOT_ID + ROBOT_MODEL +
'/gripper/robotiq_2f_close', Robotiq2FClose)
69 p0 = posj(0, 0, 0, 0, 0, 0)
70 p1 = posj(0, 0, 90, 0, 90, 0)
71 p2 = posj(180, 0, 90, 0, 90, 0)
73 x1 = posx(0, 0, -200, 0, 0, 0)
74 x2 = posx(0, 0, 200, 0, 0, 0)
78 while not rospy.is_shutdown():
81 movej(p1, vel=60, acc=30)
83 movel(x1, velx, accx, time=2, mod=DR_MV_MOD_REL)
86 movel(x2, velx, accx, time=2, mod=DR_MV_MOD_REL)
88 movej(p2, vel=60, acc=30)
90 movel(x1, velx, accx, time=2, mod=DR_MV_MOD_REL)
93 movel(x2, velx, accx, time=2, mod=DR_MV_MOD_REL)
def movej(fTargetPos, fTargetVel, fTargetAcc, fTargetTime=0.0, fBlendingRadius=0.0, nMoveMode=MOVE_MODE_ABSOLUTE, nBlendingType=BLENDING_SPEED_TYPE_DUPLICATE, nSyncType=0)
def _ros_listToFloat64MultiArray(list_src)
def movel(fTargetPos, fTargetVel, fTargetAcc, fTargetTime=0.0, fBlendingRadius=0.0, nMoveReference=MOVE_REFERENCE_BASE, nMoveMode=MOVE_MODE_ABSOLUTE, nBlendingType=BLENDING_SPEED_TYPE_DUPLICATE, nSyncType=0)