示例#1
0
            motionset.run(speed)


#--------------------------------------------------------------MOTIONS--------------------------------------------------------------------------------
json = JSON(path)
balance = Motionset(json.parse(motion="152 Balance"),
                    speed=1,
                    offset=[darwin, hand])
w1 = Motionset(json.parse(motion="32 F_S_L"), speed=2.1, offset=[darwin])
w2 = Motionset(json.parse(motion="33 "), speed=2.1, offset=[darwin])
w3 = Motionset(json.parse(motion="38 F_M_R"), speed=2.7, offset=[darwin])
w4 = Motionset(json.parse(motion="39 "), speed=2.1, offset=[darwin])
w5 = Motionset(json.parse(motion="36 F_M_L"), speed=2.7, offset=[darwin])
w6 = Motionset(json.parse(motion="37 "), speed=2.1, offset=[darwin])

walk = Custom(json.setparse("22 F_S_L", offset=[darwin]))

w1b = Motionset(json.parse(motion="32 F_S_L"), speed=2.1, offset=[darwin])
w2b = Motionset(json.parse(motion="33 "), speed=2.1, offset=[darwin])
w3b = Motionset(json.parse(motion="13 B_R_M"), speed=1.0, offset=[darwin])
w4b = Motionset(json.parse(motion="14 B_L_S"), speed=1.0, offset=[darwin])
w5b = Motionset(json.parse(motion="15 B_R_M"), speed=1.0, offset=[darwin])
w6b = Motionset(json.parse(motion="16 B_L_M"), speed=1.0, offset=[darwin])

back_left = Motionset(json.parse(motion="17 B_R_E"), speed=1, offset=[darwin])
back_right = Motionset(json.parse(motion="18 B_L_E"), speed=1, offset=[darwin])

bl1 = Motionset(json.parse("52 B_E_L"), offset=[darwin])
bl2 = Motionset(json.parse("53 "), offset=[darwin])

br1 = Motionset(json.parse("54 B_E_R"), offset=[darwin])
示例#2
0
			if not(spd) :
				speed = motionset.speed
  
			motionset.run(speed)

#--------------------------------------------------------------MOTIONS--------------------------------------------------------------------------------
json = JSON(path)
balance = Motionset(json.parse(motion="152 Balance"),offset=[darwin,hand])
w1 = Motionset(json.parse(motion="32 F_S_L"),speed=2.1,offset=[darwin])
w2 = Motionset(json.parse(motion="33 "),speed=2.1,offset=[darwin])
w3 = Motionset(json.parse(motion="38 F_M_R"),speed=2.7,offset=[darwin])
w4 = Motionset(json.parse(motion="39 "),speed=2.1,offset=[darwin])
w5 = Motionset(json.parse(motion="36 F_M_L"),speed=2.7,offset=[darwin])
w6 = Motionset(json.parse(motion="37 "),speed=2.1,offset=[darwin])

walk = Custom(json.setparse("22 F_S_L",offset=[darwin]))

back_left = Motionset(json.parse(motion="17 B_R_E"),speed=1,offset=[darwin])
back_right = Motionset(json.parse(motion="18 B_L_E"),speed=1,offset=[darwin])
back_walk = Custom(json.setparse(motion="11 B_L_S",offset=[darwin]))
walk_init = Custom(motionset=[w1,w2])
walk_motion = Custom(motionset=[w3,w4,w5,w6])				
fast_left = Motionset(json.parse(motion="9 ff_r_l"),speed=1.5,offset=[darwin,abmath,darwin_boom])
fast_right = Motionset(json.parse(motion="10 ff_l_r"),speed=1.5,offset=[darwin,abmath,darwin_boom])
fast_walk = Custom(motionset=[fast_left,fast_right])
r_turn = Motionset(json.parse(motion="27 RT"),speed=1.2,offset=[darwin])
l_turn = Motionset(json.parse(motion="28 LT"),speed=1.2,offset=[darwin])

left_side_step = Custom(json.setparse("21 Fst_L",offset=[darwin, hand]))
right_side_step = Custom(json.setparse("20 Fst_R",offset=[darwin, hand]))
示例#3
0
w3b = Motionset(jsonb.parse(motion="38 F_M_R"),speed=2.7,offset=[darwin,darwin1])
w4b = Motionset(jsonb.parse(motion="39 "),speed=2.1,offset=[darwin,darwin1])
w5b = Motionset(jsonb.parse(motion="36 F_M_L"),speed=2.7,offset=[darwin,darwin1])
w6b = Motionset(jsonb.parse(motion="37 "),speed=2.1,offset=[darwin,darwin1])
back_left = Motionset(json.parse(motion="17 B_R_E"),speed=1,offset=[darwin])
back_right = Motionset(json.parse(motion="18 B_L_E"),speed=1,offset=[darwin])
back_walk = Custom(motionset=[w3b,w4b,w5b,w6b])
walk_init = Custom(motionset=[w1,w2])
walk_motion = Custom(motionset=[w3,w4,w5,w6])				
fast_left = Motionset(json.parse(motion="9 ff_r_l"),speed=1.5,offset=[darwin,abmath,darwin1])
fast_right = Motionset(json.parse(motion="10 ff_l_r"),speed=1.5,offset=[darwin,abmath,darwin1])
fast_walk = Custom(motionset=[fast_left,fast_right])
r_turn = Motionset(json.parse(motion="27 RT"),speed=1.2,offset=[darwin])
l_turn = Motionset(json.parse(motion="28 LT"),speed=1.2,offset=[darwin])

kick = Custom(json.setparse("26 F_PShoot_R",offset = [darwin, hand]))
#-----------------------------------------------------------------------------------------------------------------------------------------------------



def listener(data) :
        rospy.loginfo(rospy.get_caller_id() + 'I heard %s', data.data)
        print data.data
	if data.data == "forward":
		walk_motion.run()
	elif data.data == "backward" :
		balance.run()
		time.sleep(1)
		kick.run()
	elif data.data == "right" :
		r_turn.run()