Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 5 deletions.
  1. +12 −5 test.py
View
17 test.py
@@ -4,7 +4,8 @@
import time
import random
-naoip = "192.168.1.54"
+#naoip = "192.168.1.54"
+naoip = "172.20.10.5"
naopt = 9559
proxies = {
@@ -15,7 +16,7 @@
'ALRobotPose' : ALProxy("ALRobotPose", naoip, naopt)
}
-command_dict = {
+command_dict = {
'say': "Say from Memory",
'hump': "The Hump"
}
@@ -26,18 +27,23 @@ def flex():
proxies['ALMotion'].closeHand(hand)
proxies['ALMotion'].openHand(hand)
proxies['ALMotion'].closeHand(hand)
- proxies['ALMotion'].openHand(hand)
- proxies['ALMotion'].closeHand(hand)
pose_and_time = proxies['ALRobotPose'].getActualPoseAndTime()
if pose_and_time[1] > 180:
proxies['ALBehaviorManager'].runBehavior('Toggle Stand')
+def shuffle():
+ pose_and_time = proxies['ALRobotPose'].getActualPoseAndTime()
+ if pose_and_time[0] == "Stand":
+ if random.randint(0,1) > 0:
+ proxies["ALBehaviorManager"].runBehavior("Shrug")
+ else:
+ proxies["ALBehaviorManager"].runBehavior("Stand Straight")
therapist = NaoTherapist()
while True:
command = therapist.get_next_command()
- if command:
+ if command and command.command in command_dict:
print command.command
c = 0
@@ -55,5 +61,6 @@ def flex():
proxies['ALMemory'].removeData(paramid)
else:
flex()
+ shuffle()
time.sleep(25)

No commit comments for this range

Something went wrong with that request. Please try again.