机器人认识实验实验报告
一、实验目的:
认识能力风暴机器人的基本结构。学会能力风暴机器人的连接、检测和程序下载等操作。
二、实验要求:
1、可以明确能力风暴机器人的各个组成部分。
2、指出主要组成部分的结构和功能。
3、学会程序的调试和下载。
三、实验内容、步骤:
1、记录自检程序运行的结果,回答每一步用到的传感器和执行器。
2、记录表演程序运行的结果,回答每一步用到的传感器和执行器。
3、完成机器人输出”Hello Robot”的编程。
4.、完成机器人走正方形编程。
四、实验代码:
程序1:
#include "AS_UIII_LIB.h"
void main()
{
printf(“Hello Robot!”);
}
程序2:
#include "AS_UIII_LIB.h"
void goon(int s,float f)
{
drive(s,0);
wait(f);
stop();
}
void tr()
{
int rot2;
rot2=rotation(2);
drive(0,10);
while(rotation(2)-rot2<19)
{}
stop();
}
void tl()
{
int rot1;
rot1=rotation(1);
drive(0,-10);
while(rotation(1)-rot1<16)
{}
stop();
}
void main()
{
int i;
for(i=4;i>0;i--)
{
goon(75,1);
wait(0.5);
tl();
}
}
五、实验结果:
1、对于程序1,机器人的LCD液晶屏幕显示Hello Robot!
2、对于程序2,机器人大致上走了一个正方形。
六、实验小结:
通过这个实验我学会了用VJC编写机器人程序的过程,为进一步学习打下基础。
第二篇:机器人你叫我应实验实验报告
机器人你叫我应实验实验报告
一、实验目的:
学会应用各种传感器。
二、实验要求:
要求机器人实现应答的功能、要求机器人可以根据指令作运动。
三、实验内容、步骤:
1、在较安静的情况下,机器人静止不动,当有人发出声音时,有节奏的回应。
2、在较安静的情况下,机器人静止不动,当有人发出声音时,机器人开始前进(躲避路途中的障碍)
四、实验代码:
#include "AS_UIII_LIB.h"
void tr()
{
int rot2;
rot2=rotation(2);
drive(0,30);
while(rotation(2)-rot2<16);
stop();
}
void tl()
{
int rot1;
rot1=rotation(1);
drive(0,-30);
while(rotation(1)-rot1<16);
stop();
}
void goon()
{
int rot1;
rot1=rotation(1);
drive(40,0);
while(rotation(1)-rot1<100);
stop();
}
void main()
{
int i,ir;
while(1)
{
if(microphone()>150)
{
if(microphone()>150) {
drive(40,0);
for(i=0;i<50;i++) {
i++;
wait(0.01);
ir=ir_detector(); if(ir!=0) {
i++;
wait(0.01);
ir=ir_detector(); if(ir!=0) {
Beep(); tr(); goon(); tl(); goon(); tl(); goon(); tr();
drive(40,0); }
}
wait(0.01); }
}
stop();
}
}
}
五、实验结果:
按下运行按钮后,在机器人听到比较大的声响是向前移动,如果遇到障碍则绕障,当声音停止时机器人不动。
六、实验小结:
通过这次实验我学会了声音传感器的使用方法,为进一步学习打下基础。