etrobocon2019 feat.KatLab
ece30a9a007fff7d3ad48592c0d09a74643377bb
src
module
LineTracer.h
[詳解]
1
6
#ifndef LINE_TRACER_H
7
#define LINE_TRACER_H
8
9
#include "
Controller.h
"
10
#include "
Distance.h
"
11
#include "
SpeedControl.h
"
12
#include "
TurnControl.h
"
13
#include "
Pid.h
"
14
15
struct
NormalCourseProperty
{
16
// 目標距離
17
int
targetDistance
;
18
// 目標スピード
19
int
targetSpeed
;
20
// speedPid
21
PidGain
speedPid
;
22
// turnPid
23
PidGain
turnPid
;
24
};
25
26
class
LineTracer
{
27
public
:
33
LineTracer
(
Controller
& controller_,
int
targetBrightness_,
bool
isLeftCourse_);
34
40
void
run(
NormalCourseProperty
& settings);
41
46
void
setTargetBrightness(
int
targetBrightness_);
47
48
private
:
49
Controller
& controller;
50
int
targetBrightness;
51
bool
isLeftCourse;
52
Distance
distance;
53
54
SpeedControl
speedControl;
55
TurnControl
turnControl;
56
};
57
58
#endif
NormalCourseProperty
Definition:
LineTracer.h:15
Distance.h
走行距離を計算するクラス
TurnControl.h
旋回値制御クラス
Controller.h
NormalCourseProperty::targetSpeed
int targetSpeed
Definition:
LineTracer.h:19
NormalCourseProperty::speedPid
PidGain speedPid
Definition:
LineTracer.h:21
Pid.h
PID制御クラス
SpeedControl
Definition:
SpeedControl.h:13
Controller
Definition:
Controller.h:36
TurnControl
Definition:
TurnControl.h:12
Distance
Definition:
Distance.h:13
NormalCourseProperty::targetDistance
int targetDistance
Definition:
LineTracer.h:17
NormalCourseProperty::turnPid
PidGain turnPid
Definition:
LineTracer.h:23
SpeedControl.h
前進値制御クラス
PidGain
Definition:
Pid.h:10
LineTracer
Definition:
LineTracer.h:26
構築:
1.8.13