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 *
29 ROBOT_ID = id; ROBOT_MODEL= model
32 print "shutdown time!" 33 print "shutdown time!" 34 print "shutdown time!" 36 pub_stop.publish(stop_mode=1)
43 item = Float64MultiArray()
50 if __name__ ==
"__main__":
53 my_robot_model =
"m1013" 56 rospy.init_node(
'pick_and_place_simple_py')
57 rospy.on_shutdown(shutdown)
60 pub_stop = rospy.Publisher(
'/'+ROBOT_ID +ROBOT_MODEL+
'/stop', RobotStop, queue_size=10)
61 srv_robotiq_2f_open = rospy.ServiceProxy(
'/' + ROBOT_ID + ROBOT_MODEL +
'/gripper/robotiq_2f_open', Robotiq2FOpen)
62 srv_robotiq_2f_move = rospy.ServiceProxy(
'/' + ROBOT_ID + ROBOT_MODEL +
'/gripper/robotiq_2f_move', Robotiq2FMove)
64 p0 = posj(0, 0, 0, 0, 0, 0)
65 p1 = posj(0, 0, 90, 0, 90, 0)
66 p2 = posj(180, 0, 90, 0, 90, 0)
68 x1 = posx(0, 0, -200, 0, 0, 0)
69 x2 = posx(0, 0, 200, 0, 0, 0)
73 while not rospy.is_shutdown():
76 movej(p1, vel=60, acc=30)
78 movel(x1, velx, accx, 2, 0, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE)
81 movel(x2, velx, accx, 2, 0, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE)
83 movej(p2, vel=60, acc=30)
85 movel(x1, velx, accx, 2, 0, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE)
88 movel(x2, velx, accx, 2, 0, MOVE_REFERENCE_BASE, MOVE_MODE_RELATIVE)
def movej(fTargetPos, fTargetVel, fTargetAcc, fTargetTime=0.0, fBlendingRadius=0.0, nMoveMode=MOVE_MODE_ABSOLUTE, nBlendingType=BLENDING_SPEED_TYPE_DUPLICATE, nSyncType=0)
def robotiq_2f_move(width)
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)
def _ros_listToFloat64MultiArray(list_src)