四足机器人课程设计_第1页
四足机器人课程设计_第2页
四足机器人课程设计_第3页
四足机器人课程设计_第4页
四足机器人课程设计_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、实验目的进一步了解“创意之星”标准版套件;初步学习足式机器人的不太规划; 深入学习AVR控制器的使用方法; 深入学习模拟量传感器的使用方法。 实验要求模仿四腿生物的行走方式,四条腿交替前进; 能感知光源,并能转向光源,朝光源前进。 实验过程1. 任务分析与规划了解腿式机器人步态规划任务规划2. 搭建机器人3. 让四足机器人走起来 四足机器人步态分析设计前进、后退步态设计转向步态编写步态让舵机跟踪光源建立工程添加变量程序逻辑设计 等待延迟最终的程序流程及对应源码让四足机器人跟踪光源12345678910111213141516171819202122232425262728ttinclude ,

2、Apps/SystemTask .hB,uint8 SERUO_MAPPING10 1,2,3,4,5.6,7,8,9,10; int nain()int DiFF = 0;int Left = 0;int Right - 0;MFInitO;MFInitSeruoMapping (&SERUO_MAPP ING 0 ,10);MFSetPortDirect( Ox OO00OFFC);MFSetSeruoMode(190);MFS?tSeruoMode(2»0);MFSetSeruoMode(3,0);MFSPtSeruoMode(4,0);MFSPtSeruoMode(5

3、f0);MFSetSeruoMode(6,0);MFSetSeruoMode(7v0);MFS&tSeruoMode(8,0);MFSetSeruoMode(9 f 0);HFSetSeruoHode(109 0);while (1)<Left = MFGetDigilnput(O>Right MFGetDigilnput(l);DifF = Left - Right;左侧的值大于右侧if (?DiFF>50)2930313233343536373839彳Q4142434445464748495051525354555657MFSetSeruoPos(1,570,51

4、2);MFSetServoPos(2,265f512);MFSetSeruoPos(3,825,512);MFSetSeruoPos(H,265,512);NFSetSeruoPos(5»512»5-12); NFSetSeruoPos(692659512); MFSetSeruoPos(7,465»512); MFSetSerUOPOSC8,265 f 512);HFSetServoPos(9,512,512); t1FSetServoPos(10,512,512);MFSeruoAction(>DelasiMS(OO); MFSetSeruoPos(1f

5、430,512);MFSetSpruoPos(2,265,512); MFSetS?ruoPos(3f7e3f512); MFSetSeruoPos(4,265,512); NFSetServoPosf? 9 376,512); MFSetSeruoPos(6,265,512);MFSetSeruoPos(7,622,512); MFSetSeruoPos(8,265,512); MFSetSpruoPos(9f512,512); MFSetSeruoPos(10f512,512); MFSeruoActionO;DelayMS(50a); MFSetSeruoPos(1,430,512);

6、MFSetSeruoPos(2,265,512); MFSetSeruoPos(3f7e3f512);MFSetSfrruoPo5(4,265,512);MFSetSeruoPos(5»110f512);585960£162636465666768697071727374757677787980818283348586MFSetServoPos(6,265,512); MFSetSeruoPos(7,622.512); MFSetSeruoPos(8,265,512); MFSetSeruoPos(9,512>512); MFSetServoPos(10w512f51

7、2); MFSeruoActionf);DelayMS(500); MFSPtSeruoPos(1,U30»512); MFSetServoPos(2w265f512); MFSetSeruoPos(3,703f512); MFSetSer 11005(4,265.512); MFSetSeruoPos(5,110,512); MFSetSeruoPos(6,265.512); MFSetSeruoPos(7,378,512); MFSetSeruoPos(8,265.512); MFSetServoPos(9f512f512);MFSetSeruoPosd 0,512.512);M

8、FSeruoActionf);Delayh1S(500); MFSetServoPos(1v430v512); MFSetSeruoPos(2,265,512); MFSetSeruoPos(3,703.512);MFSetSeruoPos(4r265f512); MFSetSeruoPos(5,371.512); MFSetSeruoPos(6,265,512); MFSetSeruoPos(7,570.512); MFSetServoPos(8f265f512); MF$Qt"ruoPo£;(0Q2/12” MFSetServoPos(10f512.512);87888

9、990919293949596979899100101102103104105106107108109110111112113114115MFSeruoAction();左侧的值小于右侧if (Diff<-50)<MFSetSeruoPosd ,570,512);MFSetSeruoPos(2,265,512);MFSetSeruoPos(3,825,512); MFSetSeruoPos(4,265f512);MFSetSeruoPos(5,512,512);MFSetSeKUoPos(6,265,512);MFSetSeruoPos(7,512,512);MFSetSeruoP

10、os(8,265,512);MFSetSeruoPos(9,512,512);MFSetServoPos(10,512,512);MFSeruofiction();DelayMS(SOO);MFSetSeruoPosd,413,512);MFSetSeruoPos(2,265,512);MFSetSeruoPos(3F731F512);MFSetSeruoPos(4,265,512);MFSetSeruoPos(5,285,512);MFSetSeruoPos(6,265,512);MFSetSeruoPos(7,628,512);MFSetSeruoPos(8,265,512);MFSetS

11、ervoPos(9,512,512);MFSetSeruoPos(10,512,512);MFServoAction();DelapMS(SOO);116117118119120121122123124125126127128129130131132133134135136137138139140141H2143XAAHFSfrtSruoPos(1,413,512); MFSetSeruoPos(2,265,512); MFSetSe-ruoPo5(3F731F512); HFS?tS?ruoPos(U,265,512); MFSetSeruoPos(5,105,512); t1FS?tS?r

12、uoPos(6,265,512);HFSetServoPos(7,570,512);MFSptSpruoPoc(8,265,512);HFSetServoPos(9,512,512);MFSPtSpruoPos(10,512,512);MFServoActionO;DeiayMS(SOO);MFSetSeruoPosd ,413,512):MFSetSeruoPos(2F26&p512);MFSetSeruoPos(3w731,512);MFSetSeruoPos(4r265r512); MFS?tS?ruoPos(5p105F512); MFSetSeruoPos(6,265,512

13、); MF S?tS?ruoPos(7,355,512); HFSetServoPos(8,265,512); t1FSPtSpruoFos(9,512JI512);HFSetServoPosd 0,512,512);MFSeruoftctionC);DelayMS(SOO);MFSPtSeruoPos(1,413,512); MFSetSeruoPos(2,265,512); MFSetSfrPU0P05(3,731,512); MFSetSeruoPos(4,265,512); MFSetSeruoPos(5F105F512);1451471481491501511521531541551

14、56157158159160161162*163164165166167168169170171172173MFSetServoPos(6w265f512);MFSPtSpruoPos(7,i4l3»512);HFSetServoPos(8 P265,512):MFSPtSeruoPos(9,512.512);MFSetSeruo 卩 os(10.512.512); MFSpruoftction();左右两侧的值相等iF (DiFF>50)&&(D1FF<=50)MFSetSeruoPosd ,551 »512);MFSetSeruoPos(2,

15、26b>bJl2);MFS?tSeruoPos(3,750.512);HFSetSeruoPos(4,265.512);MFSPtSeruoPos(5w38U>512);HFSetServoPos(6,265.512);MFSetSeruoPos(7 9628 9512);HFSetServoPos(8,265.512);MFSPtSpruoPos(9,512>512);MFSetSeruoPos(10f512.512);MFSpruoActionO;DelayMS(500);MFS&tSeruoPos(1,349,512);MFSetSeruoP0S(Z.26551

16、2);MFS&tSeruoPos(3F651,512);MFS?tSeruoPos(4,265.512);MFSetSeruoPos(5,302,512);t1FS?tSeruoPos(6,265.512);MFSetSeruoPos(7,525>512);175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217174MFSetSeruoPos(8,265,512);MFSetSe

17、ruoPos(9,512,512); MFSetSeruoPos(10,512,512);MFSeruofictionO;DelayMS(SQO);MFSetSeruoPosd ,458,512);MFSetSeruoPos(2J265,5-l2);MFSetSeruoPos(3 »767,512); MFSetSeruoPos(ii,265 ,512); MFSetSeruoPos(5,151,512);HFSetSeruoPos(6,26S,512);MFSetSeruoPos(7,320,512);MFSetSeruoPos(8,265,512);MFSetSeruoPos(9

18、,512,512);MFSetSeruoPo5(10,512,512);MFSeruofiction();DelayMSC50O);MFSetSeruoPos(1,663,512);MFSetSeruoPos(2,265,512);HFSetSeruoPos(3,872f512);MFSetSeruoPos(H,265,512);MFSetSeruoPos(5f81,512);MFSetSeruoPos(6,265,5-l2);MFSetSeruoPos(7»471,512);MFSetSeruoPos(85265,512);MFSetSeruoPos(9,512,512);MFSetSeruoPos(10,512,512);MFSeruoficti; l>elayMS(50O);MFSetSeruoPosd ,570,512);MFSetSeruoPos(2,265,512);MFSetSeruoPos<3,744,512);MFSetSeruoPos(H,265»512);HFSetServoPos<5,221,512);MFSetSeruoPos(6,265,512

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论