-
Notifications
You must be signed in to change notification settings - Fork 3
/
mission_motion_final.utf8.bas
7134 lines (5665 loc) · 150 KB
/
mission_motion_final.utf8.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'*******************************************
'******** 메탈파이터 프로그램 **************
'******** MF2-AI2-19관절********************
'*******************************************
DIM I AS BYTE
DIM J AS BYTE
DIM CNT AS BYTE '몇걸음 앞으로?
DIM RCNT AS BYTE '몇걸음 오른쪽으로?
DIM LCNT AS BYTE '몇걸음 왼쪽으로?
DIM TCNT AS BYTE
DIM TMP AS BYTE ' 임시변수
DIM 자세 AS BYTE
DIM Action_mode AS BYTE
DIM A AS BYTE
iDIM A_old AS BYTE
DIM B AS BYTE
DIM C AS BYTE
DIM 보행속도 AS BYTE
DIM 좌우속도 AS BYTE
DIM 좌우속도2 AS BYTE
DIM 보행순서 AS BYTE
DIM 현재전압 AS BYTE
DIM 반전체크 AS BYTE
DIM 모터ONOFF AS BYTE
DIM 자이로ONOFF AS BYTE
DIM 기울기앞뒤 AS INTEGER
DIM 기울기좌우 AS INTEGER
DIM DELAY_TIME AS BYTE
DIM DELAY_TIME2 AS BYTE
DIM TEMP AS BYTE
DIM 물건집은상태 AS BYTE
DIM 기울기확인횟수 AS BYTE
DIM 넘어진확인 AS BYTE
DIM 보행횟수 AS BYTE
DIM 보행COUNT AS BYTE
DIM S6 AS BYTE
DIM S7 AS BYTE
DIM S8 AS BYTE
DIM S12 AS BYTE
DIM S13 AS BYTE
DIM S14 AS BYTE
DIM S4 AS BYTE
DIM S22 AS BYTE
DIM 리모콘동작모드 AS BYTE
'**** 기울기센서포트 설정
CONST 앞뒤기울기AD포트 = 2
CONST 좌우기울기AD포트 = 3
CONST 기울기확인시간 = 10 'ms
CONST min = 95 '뒤로넘어졌을때
CONST max = 160 '앞으로넘어졌을때
CONST COUNT_MAX = 30
CONST 하한전압 = 106 '154 '약6V전압
PTP SETON '단위그룹별 점대점동작 설정
PTP ALLON '전체모터 점대점 동작 설정
'***** 19 MOTOR *********
DIR G6A,1,0,0,1,1,1 '모터0~5번
DIR G6D,0,1,1,0,0,0 '모터18~23번
DIR G6B,1,0,0,1,1,1 '모터6~11번
DIR G6C,0,1,1,0,0,0 '모터12~17번
'***** 초기선언 *********************************
모터ONOFF = 0
보행순서 = 0
반전체크 = 0
기울기확인횟수 = 0
물건집은상태 = 0
리모콘동작모드 = 0 ' 임베디드전용=33 리모콘전용 = 0,
'****초기위치 피드백*****************************
GOSUB MOTOR_ON
GOSUB 자이로INIT
GOSUB 자이로MID
'DELAY 2000
'GOSUB MOTOR_ON
SPEED 5
GOSUB 전원초기자세
GOSUB 기본자세
GOSUB 자이로ON
'GOSUB All_motor_mode2
GOTO MAIN
'************************************************
시작음:
TEMPO 220
MUSIC "O23EAB7EA>3#C"
RETURN
'************************************************
종료음:
TEMPO 220
MUSIC "O38GD<BGD<BG"
RETURN
'************************************************
엔터테이먼트음:
TEMPO 220
MUSIC "O28B>4D8C4E<8B>4D<8B>4G<8E>4C"
RETURN
'************************************************
게임음:
TEMPO 210
MUSIC "O23C5G3#F5G3A5G"
RETURN
'************************************************
파이트음:
TEMPO 210
MUSIC "O15A>C<A>3D"
RETURN
'************************************************
경고음:
TEMPO 180
MUSIC "O13A"
DELAY 300
RETURN
'************************************************
싸이렌음:
TEMPO 180
MUSIC "O22FC"
DELAY 10
RETURN
'************************************************
모드1:
TEMPO 200
MUSIC "O18A>#CE#G#F#D#FB"
RETURN
축구게임음:
TEMPO 180
MUSIC "O28A#GABA"
RETURN
태권도음:
TEMPO 190
MUSIC "O28#C#D#F#G#A#G#F"
RETURN
모드4:
TEMPO 220
MUSIC "O33C6D3C<6$B3A"
RETURN
장애물게임음:
TEMPO 200
MUSIC "O37C<C#BCA"
RETURN
'************************************************
MOTOR_FAST_ON:
MOTOR G6B
MOTOR G6C
MOTOR G6A
MOTOR G6D
모터ONOFF = 0
RETURN
'************************************************
'************************************************
MOTOR_ON:
GOSUB MOTOR_GET
MOTOR G6B
DELAY 50
MOTOR G6C
DELAY 50
MOTOR G6A
DELAY 50
MOTOR G6D
모터ONOFF = 0
GOSUB 시작음
RETURN
'************************************************
'전포트서보모터사용설정
MOTOR_OFF:
MOTOROFF G6B
MOTOROFF G6C
MOTOROFF G6A
MOTOROFF G6D
모터ONOFF = 1
GOSUB MOTOR_GET
GOSUB 종료음
RETURN
'************************************************
'위치값피드백
MOTOR_GET:
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,1
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0
RETURN
'************************************************
All_motor_Reset:
MOTORMODE G6A,1,1,1,1,1,1
MOTORMODE G6D,1,1,1,1,1,1
MOTORMODE G6B,1,1,1, , ,1
MOTORMODE G6C,1,1,1
RETURN
'************************************************
All_motor_mode2:
MOTORMODE G6A,2,2,2,2,2,2
MOTORMODE G6D,2,2,2,2,2,1
MOTORMODE G6B,2,2,2, , ,2
MOTORMODE G6C,2,2,2
RETURN
'************************************************
All_motor_mode3:
MOTORMODE G6A,3,3,3,3,3,3
MOTORMODE G6D,3,3,3,3,3,3
MOTORMODE G6B,3,3,3, , ,3
MOTORMODE G6C,3,3,3
RETURN
'************************************************
Leg_motor_mode1:
MOTORMODE G6A,1,1,1,1,1,1
MOTORMODE G6D,1,1,1,1,1,1
RETURN
'************************************************
Leg_motor_mode2:
MOTORMODE G6A,2,2,2,2,2,2
MOTORMODE G6D,2,2,2,2,2,2
RETURN
'************************************************
Leg_motor_mode3:
MOTORMODE G6A,3,3,3,3,3,3
MOTORMODE G6D,3,3,3,3,3,3
RETURN
'************************************************
Leg_motor_mode4:
MOTORMODE G6A,3,2,2,1,3,1
MOTORMODE G6D,3,2,2,1,3,1
RETURN
'************************************************
Leg_motor_mode5:
MOTORMODE G6A,2,2,2,1,1,2
MOTORMODE G6D,2,2,2,1,1,2
RETURN
'************************************************
'************************************************
HEAD_motor_mode3:
MOTORMODE G6B,,,, ,,3
RETURN
HEAD_motor_mode1:
MOTORMODE G6B,,,, ,,1
RETURN
'************************************************
'************************************************
Arm_motor_mode1:
MOTORMODE G6B,1,1,1, , ,1
MOTORMODE G6C,1,1,1
RETURN
'************************************************
Arm_motor_mode2:
MOTORMODE G6B,2,2,2, , ,2
MOTORMODE G6C,2,2,2
RETURN
'************************************************
Arm_motor_mode3:
MOTORMODE G6B,3,3,3, , ,3
MOTORMODE G6C,3,3,3
RETURN
'************************************************
전원초기자세:
MOVE G6A,95, 76, 145, 93, 105, 100
MOVE G6D,95, 76, 145, 93, 105, 100
MOVE G6B,45, 60, 110, 100, 100, 100
MOVE G6C,45, 60, 110, 100, 100, 100
WAIT
자세 = 0
RETURN
'************************************************
안정화자세:
SPEED 5
MOVE G6A,98, 76, 145, 93, 101, 100
MOVE G6D,98, 76, 145, 93, 101, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
자세 = 0
RETURN
'******************************************
초기100자세:
MOVE G6A,100, 100, 100, 100, 100, 100
MOVE G6D,100, 100, 100, 100, 100, 100
MOVE G6B,100, 100, 100, 100, 100, 100
MOVE G6C,100, 100, 100, 100, 100, 100
WAIT
자세 = 0
RETURN
'************************************************
기본자세:
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
자세 = 0
물건집은상태 = 0
RETURN
'******************************************
차렷자세:
MOVE G6A,100, 56, 182, 76, 100, 100
MOVE G6D,100, 56, 182, 76, 100, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
자세 = 2
RETURN
'******************************************
앉은자세:
MOVE G6A,100, 143, 28, 145, 100, 100
MOVE G6D,100, 143, 28, 145, 100, 100
MOVE G6B,45, 55, 110
MOVE G6C,45, 55, 110
WAIT
자세 = 1
RETURN
'******************************************
집고안정화자세:
SPEED 5
MOVE G6A,98, 76, 145, 85, 101, 100
MOVE G6D,98, 76, 145, 85, 101, 100
WAIT
자세 = 0
RETURN
'************************************************
내려다보기:
GOSUB 자이로OFF
SPEED 3
MOVE G6A,98, 30, 185, 133, 101, 100
MOVE G6D,98, 30, 185, 133, 101, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
자세 = 3
RETURN
'**********************************************
정면보기:
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
자세 = 0
물건집은상태 = 0
GOSUB 자이로ON
RETURN
'**********************************************
집고내려다보기:
SPEED 3
MOVE G6A,98, 30, 185, 133, 101, 100
MOVE G6D,98, 30, 185, 133, 101, 100
WAIT
자세 = 0
RETURN
'**********************************************
파노라마자세:
MOVE G6A,100, 76, 140, 88, 100, 100
MOVE G6D,100, 76, 140, 88, 100, 100
MOVE G6B,45, 52, 110, 100, 100, 100
MOVE G6C,45, 52, 110, 100, 100, 100
WAIT
RETURN
'***********************************************
'**** 자이로감도 설정 ****
'***********************************************
자이로INIT:
GYRODIR G6A, 0, 0, 0, 0,1
GYRODIR G6D, 1, 0, 0, 0,0
RETURN
'***********************************************
자이로MAX:
GYROSENSE G6A,255 , 255,255,255
GYROSENSE G6D,255 , 255,255,255
RETURN
'***********************************************
자이로MID:
GYROSENSE G6A, 255, 100,100,100
GYROSENSE G6D, 255, 100,100,100
RETURN
'***********************************************
자이로MID3:
GYROSENSE G6A, 255, 200,200,200
GYROSENSE G6D, 255, 200,200,200
RETURN
'***********************************************
자이로MID2:
GYROSENSE G6A, 255, 150,150,150
GYROSENSE G6D, 255, 150,150,150
RETURN
'***********************************************
'***********************************************
자이로MIN:
GYROSENSE G6A, 50, 50,50,50
GYROSENSE G6D, 50, 50,50,50
RETURN
'***********************************************
자이로ST:
GYROSENSE G6A,200,70,70,70,
GYROSENSE G6D,200,70,70,70,
RETURN
'***********************************************
자이로ON:
GYROSET G6A, 2, 1, 1, 1,
GYROSET G6D, 2, 1, 1, 1,
자이로ONOFF = 1
RETURN
'***********************************************
자이로OFF:
GYROSET G6A, 0, 0, 0, 0, 0
GYROSET G6D, 0, 0, 0, 0, 0
자이로ONOFF = 0
RETURN
'************************************************
RX_EXIT:
IF 리모콘동작모드 = 0 THEN
ERX 4800, A, RX_EXIT_2
GOTO RX_EXIT
ENDIF
RX_EXIT_2:
ETX 4800, 1
GOTO MAIN
'**********************************************
GOSUB_RX_EXIT:
IF 리모콘동작모드 = 0 THEN
ERX 4800, A, GOSUB_RX_EXIT2
GOTO GOSUB_RX_EXIT
ENDIF
GOSUB_RX_EXIT2:
RETURN
'**********************************************
GOSUB_RX_EXIT_REMOCON:
ERX 4800, A, GOSUB_RX_EXIT_REMOCON2
GOTO GOSUB_RX_EXIT_REMOCON
GOSUB_RX_EXIT_REMOCON2:
RETURN
'**********************************************
전진보행50:
ERX 4800,CNT,전진보행50
J = 0
넘어진확인 = 0
보행속도 = 11'5
좌우속도 = 4'8'3
'GOSUB Leg_motor_mode3
MOTORMODE G6A,3,3,3,3,2,3
MOTORMODE G6D,3,3,3,3,2,3
MOTORMODE G6B,3,3,3, , ,3
MOTORMODE G6C,3,3,3
IF 보행순서 = 0 THEN
보행순서 = 1
SPEED 3
'오른쪽기울기
MOVE G6A, 90, 71, 152, 91, 105
MOVE G6D,106, 76, 146, 93, 96
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 10'보행속도
'왼발들기
MOVE G6A, 80, 95, 115, 105, 114
MOVE G6D,114, 76, 146, 93, 96
MOVE G6B,35
MOVE G6C,55
WAIT
GOTO 전진보행50_1
ELSE
보행순서 = 0
SPEED 3
'왼쪽기울기
MOVE G6D, 90, 71, 152, 91, 105
MOVE G6A, 106, 76, 146, 93, 96
MOVE G6C, 45,55
MOVE G6B, 45,55
WAIT
SPEED 10'보행속도
'오른발들기
MOVE G6D, 80, 95, 115, 105, 114
MOVE G6A,114, 76, 146, 93, 96
MOVE G6C,35
MOVE G6B,55
WAIT
GOTO 전진보행50_3
ENDIF
'*******************************
전진보행50_1:
SPEED 보행속도
'왼발뻣어착지
MOVE G6A, 85, 44, 163, 110, 112
MOVE G6D,110, 78, 146, 90, 94
WAIT
SPEED 좌우속도
GOSUB Leg_motor_mode2
'왼발중심이동
MOVE G6A,110, 76, 146, 98, 94
MOVE G6D,90, 93, 155, 69, 112
WAIT
SPEED 보행속도
GOSUB Leg_motor_mode2
J = J + 1
' ETX 4800,J
GOSUB 앞뒤기울기측정
IF 넘어진확인 = 1 THEN
넘어진확인 = 0
GOTO MAIN
ENDIF
ERX 4800,TMP, 전진보행50_2
IF TMP <> 26 THEN
GOTO 전진보행50_2
ENDIF
MUSIC "D" '디버깅 코드
전진보행50_1_정지:
GOSUB Leg_motor_mode3
'오른발들기10
SPEED 10
MOVE G6A,113, 76, 147, 93, 96,100
MOVE G6D,85, 100, 100, 115, 114,100
MOVE G6B,55
MOVE G6C,35
WAIT
'왼쪽기울기2
SPEED 6
MOVE G6A, 104, 76, 146, 93, 98,100
MOVE G6D, 85, 71, 152, 91, 105,100
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 3
MOVE G6A,95, 76, 145, 93, 100, 100
MOVE G6D,95, 76, 145, 93, 100, 100
WAIT
SPEED 2
GOSUB 기본자세
ETX 4800, 1 ' 완료 사인
'GOSUB Leg_motor_mode1
GOTO RX_EXIT
전진보행50_2:
IF J < CNT THEN
ELSE
GOTO 전진보행50_1_정지
ENDIF
'오른발들기10
MOVE G6A,112, 77, 146, 93, 94,100
MOVE G6D,90, 100, 105, 110, 114,100
MOVE G6B,55
MOVE G6C,35
WAIT
'**********
전진보행50_3:
SPEED 보행속도
'오른발뻣어착지
MOVE G6D,85, 44, 163, 110, 112
MOVE G6A,110, 78, 146, 90, 94
WAIT
SPEED 좌우속도
GOSUB Leg_motor_mode2
'오른발중심이동
MOVE G6D,110, 76, 146, 98, 94
MOVE G6A, 90, 93, 155, 69, 112
WAIT
SPEED 보행속도
GOSUB Leg_motor_mode2
J = J + 1
' ETX 4800,J
GOSUB 앞뒤기울기측정
IF 넘어진확인 = 1 THEN
넘어진확인 = 0
GOTO MAIN
ENDIF
ERX 4800,TMP, 전진보행50_4
IF TMP <> 26 THEN
GOTO 전진보행50_4
ENDIF
MUSIC "D" '디버깅 코드
전진보행50_3_정지:
GOSUB Leg_motor_mode3
'왼발들기
SPEED 10
MOVE G6D,113, 76, 147, 93, 96,100
MOVE G6A, 85, 100, 100, 115, 114,100
MOVE G6B,35
MOVE G6C,55
WAIT
'오른쪽기울기2
SPEED 6
MOVE G6D, 104, 76, 146, 93, 98,100
MOVE G6A, 85, 71, 152, 91, 105,100
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 3
MOVE G6A,95, 76, 145, 93, 100, 100
MOVE G6D,95, 76, 145, 93, 100, 100
WAIT
SPEED 2
GOSUB 기본자세
ETX 4800, 1 ' 완료 사인
'GOSUB Leg_motor_mode1
GOTO RX_EXIT
전진보행50_4:
IF J < CNT THEN
ELSE
GOTO 전진보행50_3_정지
ENDIF
'왼발들기10
MOVE G6A, 90, 100, 105, 110, 114,100
MOVE G6D,112, 77, 146, 93, 94,100
MOVE G6B, 35
MOVE G6C,55
WAIT
GOTO 전진보행50_1
'************************************************
한발자국전진:
J = 0
넘어진확인 = 0
보행속도 = 11'5
좌우속도 = 4'8'3
'GOSUB Leg_motor_mode3
MOTORMODE G6A,3,3,3,3,2,3
MOTORMODE G6D,3,3,3,3,2,3
MOTORMODE G6B,3,3,3, , ,3
MOTORMODE G6C,3,3,3
보행순서 = 1
SPEED 3
'오른쪽기울기
MOVE G6A, 90, 71, 152, 91, 105
MOVE G6D,106, 76, 146, 93, 96
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 10'보행속도
'왼발들기
MOVE G6A, 80, 95, 115, 105, 114
MOVE G6D,114, 76, 146, 93, 96
MOVE G6B,35
MOVE G6C,55
WAIT
SPEED 보행속도
'왼발뻣어착지
MOVE G6A, 85, 44, 163, 110, 112
MOVE G6D,110, 78, 146, 90, 94
WAIT
SPEED 좌우속도
GOSUB Leg_motor_mode2
'왼발중심이동
MOVE G6A,110, 76, 146, 98, 94
MOVE G6D,90, 93, 155, 69, 112
WAIT
SPEED 보행속도
GOSUB Leg_motor_mode2
GOSUB 앞뒤기울기측정
IF 넘어진확인 = 1 THEN
넘어진확인 = 0
GOTO MAIN
ENDIF
GOSUB Leg_motor_mode3
'오른발들기10
SPEED 10
MOVE G6A,113, 76, 147, 93, 96,100
MOVE G6D,85, 100, 100, 115, 114,100
MOVE G6B,55
MOVE G6C,35
WAIT
'왼쪽기울기2
SPEED 6
MOVE G6A, 104, 76, 146, 93, 98,100
MOVE G6D, 85, 71, 152, 91, 105,100
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 3
MOVE G6A,95, 76, 145, 93, 100, 100
MOVE G6D,95, 76, 145, 93, 100, 100
WAIT
SPEED 2
GOSUB 기본자세
RETURN
'************************************************
오른쪽전진보행50:
넘어진확인 = 0
J = 0
보행속도 = 12
좌우속도 = 4
GOSUB Leg_motor_mode3
IF 보행순서 = 0 THEN
보행순서 = 1
SPEED 4
'오른쪽기울기
MOVE G6A, 88, 74, 144, 95, 110
MOVE G6D,108, 76, 145, 93, 96
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 12'보행속도
'왼발들기
MOVE G6A, 80, 100, 100, 115, 112,95
MOVE G6D,111, 76, 146, 93, 96,100
MOVE G6B,35
MOVE G6C,55
WAIT
GOTO 오른쪽전진보행50_1
ELSE
보행순서 = 0
SPEED 4
'왼쪽기울기
MOVE G6D, 88, 74, 144, 95, 110
MOVE G6A, 108, 76, 145, 93, 96
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 12
'오른발들기
MOVE G6D, 80, 100, 100, 115, 112,110
MOVE G6A,113, 76, 146, 93, 96,105
MOVE G6C,35
MOVE G6B,55
WAIT
GOTO 오른쪽전진보행50_3
ENDIF
'*******************************
오른쪽전진보행50_1:
SPEED 보행속도
'왼발뻣어착지
MOVE G6A, 86, 58, 145, 120, 112
MOVE G6D,110, 77, 147, 93, 96
WAIT
SPEED 좌우속도
GOSUB Leg_motor_mode3
'왼발중심이동
MOVE G6A,110, 77, 146, 93, 96
MOVE G6D,80, 100, 145, 69, 112
WAIT
SPEED 보행속도
GOSUB Leg_motor_mode2
J = J + 1
ETX 4800,J
GOSUB 앞뒤기울기측정
IF 넘어진확인 = 1 THEN
넘어진확인 = 0
GOTO MAIN
ENDIF
ERX 4800,A, 오른쪽전진보행50_2
IF A = 11 THEN '▲
GOTO 전진보행50_2
ELSEIF A = 13 THEN '▶
GOTO 오른쪽전진보행50_2
ELSEIF A = 14 THEN '◀
GOTO 왼쪽전진보행50_2
ELSE
GOSUB Leg_motor_mode3
'오른발들기10
SPEED 10
MOVE G6A,112, 76, 147, 93, 96,100
MOVE G6D,90, 100, 100, 115, 112,100
MOVE G6B,55
MOVE G6C,35
WAIT
'왼쪽기울기2
SPEED 6
MOVE G6A, 106, 76, 146, 93, 96,100
MOVE G6D, 88, 71, 152, 91, 106,100
MOVE G6B,45,55
MOVE G6C,45,55
WAIT
SPEED 3
MOVE G6A,95, 76, 145, 93, 100, 100
MOVE G6D,95, 76, 145, 93, 100, 100
WAIT
GOSUB 기본자세
GOSUB Leg_motor_mode1
GOTO RX_EXIT
ENDIF
오른쪽전진보행50_2:
SPEED 10
'오른발들기10
MOVE G6A,112, 77, 146, 93, 94,105
MOVE G6D,80, 95, 115, 105, 112,110
MOVE G6B,55
MOVE G6C,35
WAIT
'**********
오른쪽전진보행50_3:
SPEED 보행속도
'오른발뻣어착지
MOVE G6D, 86, 50, 155, 110, 112
MOVE G6A,110, 77, 146, 93, 96
WAIT
SPEED 좌우속도
GOSUB Leg_motor_mode3
'오른발중심이동
MOVE G6D,112, 77, 148, 93, 96
MOVE G6A,80, 90, 155, 69, 112
WAIT
SPEED 보행속도
GOSUB Leg_motor_mode2
J = J + 1
ETX 4800,J
GOSUB 앞뒤기울기측정
IF 넘어진확인 = 1 THEN
넘어진확인 = 0
GOTO MAIN
ENDIF
ERX 4800,A, 오른쪽전진보행50_4
IF A = 11 THEN '▲
GOTO 전진보행50_4
ELSEIF A = 13 THEN '▶
GOTO 오른쪽전진보행50_4
ELSEIF A = 14 THEN '◀