@@ -24,17 +24,14 @@ class TestOption:
2424 TestOption (name = "move lateral" , id = 4 ),
2525 TestOption (name = "move rotate" , id = 5 ),
2626 TestOption (name = "stop_move" , id = 6 ),
27- TestOption (name = "switch_gait" , id = 7 ),
28- TestOption (name = "switch_gait" , id = 8 ),
27+ TestOption (name = "hand stand" , id = 7 ),
2928 TestOption (name = "balanced stand" , id = 9 ),
30- TestOption (name = "recovery" , id = 10 ),
3129 TestOption (name = "recovery" , id = 10 ),
3230 TestOption (name = "left flip" , id = 11 ),
3331 TestOption (name = "back flip" , id = 12 ),
3432 TestOption (name = "free walk" , id = 13 ),
3533 TestOption (name = "free bound" , id = 14 ),
3634 TestOption (name = "free avoid" , id = 15 ),
37- TestOption (name = "walk stair" , id = 16 ),
3835 TestOption (name = "walk upright" , id = 17 ),
3936 TestOption (name = "cross step" , id = 18 ),
4037 TestOption (name = "free jump" , id = 19 )
@@ -71,14 +68,13 @@ def terminal_handle(self):
7168
7269if __name__ == "__main__" :
7370
74- if len (sys .argv ) < 2 :
75- print (f"Usage: python3 { sys .argv [0 ]} networkInterface" )
76- sys .exit (- 1 )
7771
7872 print ("WARNING: Please ensure there are no obstacles around the robot while running this example." )
7973 input ("Press Enter to continue..." )
80-
81- ChannelFactoryInitialize (0 , sys .argv [1 ])
74+ if len (sys .argv )> 1 :
75+ ChannelFactoryInitialize (0 , sys .argv [1 ])
76+ else :
77+ ChannelFactoryInitialize (0 )
8278
8379 test_option = TestOption (name = None , id = None )
8480 user_interface = UserInterface ()
@@ -100,17 +96,18 @@ def terminal_handle(self):
10096 elif test_option .id == 2 :
10197 sport_client .StandDown ()
10298 elif test_option .id == 3 :
103- sport_client .Move (0.3 ,0 ,0 )
99+ ret = sport_client .Move (0.3 ,0 ,0 )
100+ print ("ret: " ,ret )
104101 elif test_option .id == 4 :
105102 sport_client .Move (0 ,0.3 ,0 )
106103 elif test_option .id == 5 :
107104 sport_client .Move (0 ,0 ,0.5 )
108105 elif test_option .id == 6 :
109106 sport_client .StopMove ()
110107 elif test_option .id == 7 :
111- sport_client .SwitchGait ( 0 )
112- elif test_option . id == 8 :
113- sport_client .SwitchGait ( 1 )
108+ sport_client .HandStand ( True )
109+ time . sleep ( 4 )
110+ sport_client .HandStand ( False )
114111 elif test_option .id == 9 :
115112 sport_client .BalanceStand ()
116113 elif test_option .id == 10 :
@@ -122,13 +119,7 @@ def terminal_handle(self):
122119 ret = sport_client .BackFlip ()
123120 print ("ret: " ,ret )
124121 elif test_option .id == 13 :
125- ret = sport_client .FreeWalk (True )
126- print ("ret: " ,ret )
127- elif test_option .id == 14 :
128- ret = sport_client .FreeBound (True )
129- print ("ret: " ,ret )
130- time .sleep (2 )
131- ret = sport_client .FreeBound (False )
122+ ret = sport_client .FreeWalk ()
132123 print ("ret: " ,ret )
133124 elif test_option .id == 14 :
134125 ret = sport_client .FreeBound (True )
@@ -142,12 +133,6 @@ def terminal_handle(self):
142133 time .sleep (2 )
143134 ret = sport_client .FreeAvoid (False )
144135 print ("ret: " ,ret )
145- elif test_option .id == 16 :
146- ret = sport_client .WalkStair (True )
147- print ("ret: " ,ret )
148- time .sleep (10 )
149- ret = sport_client .WalkStair (False )
150- print ("ret: " ,ret )
151136 elif test_option .id == 17 :
152137 ret = sport_client .WalkUpright (True )
153138 print ("ret: " ,ret )
0 commit comments