EasyManua.ls Logo

Dobot AiStarter - 6. AI-Starter Demo; 6.1 Line Tracking Demo; 6.1.1 Description; 6.1.2 Procedure

Dobot AiStarter
41 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AiStarter User Guide 6AI-Starter Demo
IssueV1.0.32018-09-01 AiStarter User Guide Copyright © Yuejiang Technology Co., Ltd
19
6. AI-Starter Demo
6.1 Line Tracking Demo
6.1.1 Description
This demo realizes that AI-Starter tracks line automatically on testing map.
6.1.2 Procedure
Step 1 Turn on AI-Starter.
Step 2 Press down the key start|stop, AI-Starter starts tracking line after buzzer beeps one
time.
Step 3 Press down the key start|stop once agian, AI-Starter stops tracking line after the
buzzer beeps one time.
6.1.3 Code Description
1) Get the current infrared sensor value.
Program 6.1 Get infrared sensor value
void getCurrentIRState(int *irstate)
{
*irstate = 0;
for (int i = 0; i < IR_NUM; i++) {
*irstate |= AIStarter_SmartBotGetIRModuleValue(i) << i;
}
}
2) Get AI-Starter pose.
Program 6.2 Get AI-Starter pose
float getCurrentPos(const int irstate)
{
const float coeff = 0.7;
const int irPos[] = {-30, -18, -6, 6, 18, 30};
static float lastPos;
float curPos;
float readPos;
int total = 0;
int irOffCnt = 0;

Table of Contents

Related product manuals