Structs card
카드 코딩과 관련된 정의 및 구조체들을 소개합니다.

Definitions

Card::CardNameColor::Type

카드 분류(색상).
1
namespace CardNameColor
2
{
3
enum Type
4
{
5
None = 0x00,
6
7
WhiteWhite = 0x11,
8
WhiteRed = 0x12,
9
WhiteYellow = 0x13,
10
WhiteGreen = 0x14,
11
WhiteCyan = 0x15,
12
WhiteBlue = 0x16,
13
WhiteMagenta = 0x17,
14
WhiteBlack = 0x18,
15
16
RedWhite = 0x21,
17
RedRed = 0x22,
18
RedYellow = 0x23,
19
RedGreen = 0x24,
20
RedCyan = 0x25,
21
RedBlue = 0x26,
22
RedMagenta = 0x27,
23
RedBlack = 0x28,
24
25
YellowWhite = 0x31,
26
YellowRed = 0x32,
27
YellowYellow = 0x33,
28
YellowGreen = 0x34,
29
YellowCyan = 0x35,
30
YellowBlue = 0x36,
31
YellowMagenta = 0x37,
32
YellowBlack = 0x38,
33
34
GreenWhite = 0x41,
35
GreenRed = 0x42,
36
GreenYellow = 0x43,
37
GreenGreen = 0x44,
38
GreenCyan = 0x45,
39
GreenBlue = 0x46,
40
GreenMagenta = 0x47,
41
GreenBlack = 0x48,
42
43
CyanWhite = 0x51,
44
CyanRed = 0x52,
45
CyanYellow = 0x53,
46
CyanGreen = 0x54,
47
CyanCyan = 0x55,
48
CyanBlue = 0x56,
49
CyanMagenta = 0x57,
50
CyanBlack = 0x58,
51
52
BlueWhite = 0x61,
53
BlueRed = 0x62,
54
BlueYellow = 0x63,
55
BlueGreen = 0x64,
56
BlueCyan = 0x65,
57
BlueBlue = 0x66,
58
BlueMagenta = 0x67,
59
BlueBlack = 0x68,
60
61
MagentaWhite = 0x71,
62
MagentaRed = 0x72,
63
MagentaYellow = 0x73,
64
MagentaGreen = 0x74,
65
MagentaCyan = 0x75,
66
MagentaBlue = 0x76,
67
MagentaMagenta = 0x77,
68
MagentaBlack = 0x78,
69
70
BlackWhite = 0x81,
71
BlackRed = 0x82,
72
BlackYellow = 0x83,
73
BlackGreen = 0x84,
74
BlackCyan = 0x85,
75
BlackBlue = 0x86,
76
BlackMagenta = 0x87,
77
BlackBlack = 0x88,
78
79
EndOfType
80
};
81
}
Copied!

Card::CardNameCardCoding::Type

카드 코딩 모드.
1
namespace CardNameCardCoding
2
{
3
enum Type
4
{
5
None = CardNameColor::None,
6
7
// White - Mode
8
CalibrationWhite = CardNameColor::WhiteWhite,
9
Card = CardNameColor::WhiteRed, // 카드 코딩
10
Motion = CardNameColor::WhiteYellow, // 모션 코딩
11
//Reserved_01 = CardNameColor::WhiteGreen, //
12
//Reserved_02 = CardNameColor::WhiteCyan, //
13
//Reserved_03 = CardNameColor::WhiteBlue, //
14
//Reserved_04 = CardNameColor::WhiteMagenta, //
15
Piano = CardNameColor::WhiteBlack, // 피아노 모드
16
17
// Red - Function
18
CodingStart = CardNameColor::RedWhite, // 카드 입력 시작 - 카드 입력 중 White Dimming
19
CodingEnd = CardNameColor::RedRed, // 카드 입력 종료 - 카드 입력 완료 시 White Hold
20
FunctionStart = CardNameColor::RedYellow, // 함수 입력 시작 - 입력 중 Cyan Dimming
21
FunctionEnd = CardNameColor::RedGreen, // 함수 입력 종료 - 카드 입력 완료 시 Cyan Hold
22
FunctionCall = CardNameColor::RedCyan, // 함수 호출
23
PlayMelody = CardNameColor::RedBlue, // 멜로디 호출
24
Speed = CardNameColor::RedMagenta, // 도리도리
25
Wait1Sec = CardNameColor::RedBlack, // 1초 기다림
26
27
// Yellow - LightBody
28
LightBodyWhite = CardNameColor::YellowWhite,
29
LightBodyRed = CardNameColor::YellowRed,
30
LightBodyYellow = CardNameColor::YellowYellow,
31
LightBodyGreen = CardNameColor::YellowGreen,
32
LightBodyCyan = CardNameColor::YellowCyan,
33
LightBodyBlue = CardNameColor::YellowBlue,
34
LightBodyMagenta = CardNameColor::YellowMagenta,
35
LightBodyBlack = CardNameColor::YellowBlack,
36
37
// Green - 이착륙 및 이동 거리, 회전 각도 설정
38
Takeoff = CardNameColor::GreenWhite, // 이륙
39
Landing = CardNameColor::GreenRed, // 착륙
40
Distance300 = CardNameColor::GreenYellow, // 10cm
41
Distance500 = CardNameColor::GreenGreen, // 50cm
42
Distance1000 = CardNameColor::GreenCyan, // 1m
43
Degree30 = CardNameColor::GreenBlue, // 10
44
Degree45 = CardNameColor::GreenMagenta, // 45
45
Degree90 = CardNameColor::GreenBlack, // 90
46
47
// Cyan - Move - Basic
48
MoveForward = CardNameColor::CyanWhite, // Front Obstacle
49
MoveBackward = CardNameColor::CyanRed, // 착륙 시 사용, Ground Color Red
50
MoveLeft = CardNameColor::CyanYellow, // 착륙 시 사용, Ground Color Yellow
51
MoveRight = CardNameColor::CyanGreen, // 착륙 시 사용, Ground Color Green
52
MoveUp = CardNameColor::CyanCyan, // 착륙 시 사용, Ground Color Cyan
53
MoveDown = CardNameColor::CyanBlue, // 착륙 시 사용, Ground Color Blue
54
TurnLeft = CardNameColor::CyanMagenta,
55
TurnRight = CardNameColor::CyanBlack,
56
57
// Blue - If
58
IfFindFrontObstacle = CardNameColor::BlueWhite,
59
IfFindGroundRed = CardNameColor::BlueRed,
60
IfFindGroundYellow = CardNameColor::BlueYellow,
61
IfFindGroundGreen = CardNameColor::BlueGreen,
62
IfFindGroundCyan = CardNameColor::BlueCyan,
63
IfFindGroundBlue = CardNameColor::BlueBlue,
64
IfElse = CardNameColor::BlueMagenta,
65
IfEnd = CardNameColor::BlueBlack,
66
67
// Magenta - Loop
68
LoopStartInfinite = CardNameColor::MagentaWhite, // 중앙, 왼쪽 30, 오른쪽 60, 왼쪽 30
69
LoopStart2 = CardNameColor::MagentaRed,
70
LoopStart3 = CardNameColor::MagentaYellow,
71
LoopStart4 = CardNameColor::MagentaGreen,
72
LoopStart5 = CardNameColor::MagentaCyan,
73
LoopStart10 = CardNameColor::MagentaBlue,
74
LoopBreak = CardNameColor::MagentaMagenta,
75
LoopEnd = CardNameColor::MagentaBlack, // 1초 기다림
76
77
// Black - Melody
78
C5 = CardNameColor::BlackWhite,
79
D5 = CardNameColor::BlackRed,
80
E5 = CardNameColor::BlackYellow,
81
F5 = CardNameColor::BlackGreen,
82
G5 = CardNameColor::BlackCyan,
83
A5 = CardNameColor::BlackBlue,
84
B5 = CardNameColor::BlackMagenta,
85
C6 = CardNameColor::BlackBlack,
86
87
EndOfType
88
};
89
}
Copied!

Card::CardNamePiano::Type

피아노 모드.
1
namespace CardNamePiano
2
{
3
enum Type
4
{
5
None = CardNameColor::None,
6
7
// Red - Function
8
RecordingStart = CardNameColor::RedWhite, // 사용자 정의 멜로디 입력 시작
9
RecordingEnd = CardNameColor::RedRed, // 사용자 정의 멜로디 입력 종료
10
Melody1 = CardNameColor::RedYellow, // 멜로디 1
11
Melody2 = CardNameColor::RedGreen, // 멜로디 2
12
Melody3 = CardNameColor::RedCyan, // 멜로디 3
13
Play = CardNameColor::RedBlue, // 저장한 멜로디 플레이
14
MuteShort = CardNameColor::RedMagenta, // 쉼표 0.5
15
Mute = CardNameColor::RedBlack, // 쉼표 1
16
17
// Yellow - 3 Octave Sharp
18
CS3 = CardNameColor::YellowWhite,
19
DS3 = CardNameColor::YellowRed,
20
//ES3 = CardNameColor::YellowYellow,
21
FS3 = CardNameColor::YellowGreen,
22
GS3 = CardNameColor::YellowCyan,
23
AS3 = CardNameColor::YellowBlue,
24
//BS3 = CardNameColor::YellowMagenta,
25
//CS4 = CardNameColor::YellowBlack,
26
27
// Green - 3 Octave
28
C3 = CardNameColor::GreenWhite,
29
D3 = CardNameColor::GreenRed,
30
E3 = CardNameColor::GreenYellow,
31
F3 = CardNameColor::GreenGreen,
32
G3 = CardNameColor::GreenCyan,
33
A3 = CardNameColor::GreenBlue,
34
B3 = CardNameColor::GreenMagenta,
35
//C4 = CardNameColor::GreenBlack,
36
37
// Cyan - 4 Octave Sharp
38
CS4 = CardNameColor::CyanWhite,
39
DS4 = CardNameColor::CyanRed,
40
//ES4 = CardNameColor::CyanYellow,
41
FS4 = CardNameColor::CyanGreen,
42
GS4 = CardNameColor::CyanCyan,
43
AS4 = CardNameColor::CyanBlue,
44
//BS4 = CardNameColor::CyanMagenta,
45
//CS5 = CardNameColor::CyanBlack,
46
47
// Blue - 4 Octave
48
C4 = CardNameColor::BlueWhite,
49
D4 = CardNameColor::BlueRed,
50
E4 = CardNameColor::BlueYellow,
51
F4 = CardNameColor::BlueGreen,
52
G4 = CardNameColor::BlueCyan,
53
A4 = CardNameColor::BlueBlue,
54
B4 = CardNameColor::BlueMagenta,
55
//C5 = CardNameColor::BlueBlack,
56
57
// Magenta - 5 Octave Sharp
58
CS5 = CardNameColor::MagentaWhite,
59
DS5 = CardNameColor::MagentaRed,
60
//ES5 = CardNameColor::MagentaYellow,
61
FS5 = CardNameColor::MagentaGreen,
62
GS5 = CardNameColor::MagentaCyan,
63
AS5 = CardNameColor::MagentaBlue,
64
//BS5 = CardNameColor::MagentaMagenta,
65
//CS6 = CardNameColor::MagentaBlack,
66
67
// Black - 5 Octave
68
C5 = CardNameColor::BlackWhite,
69
D5 = CardNameColor::BlackRed,
70
E5 = CardNameColor::BlackYellow,
71
F5 = CardNameColor::BlackGreen,
72
G5 = CardNameColor::BlackCyan,
73
A5 = CardNameColor::BlackBlue,
74
B5 = CardNameColor::BlackMagenta,
75
//C6 = CardNameColor::BlackBlack,
76
77
EndOfType
78
};
79
}
80
Copied!

Card::CardColor::Type

카드 색 분류.
1
namespace CardColor
2
{
3
enum Type
4
{
5
Unknown = 0x00,
6
White = 0x01,
7
Red = 0x02,
8
Yellow = 0x03,
9
Green = 0x04,
10
Cyan = 0x05,
11
Blue = 0x06,
12
Magenta = 0x07,
13
Black = 0x08,
14
Grey = 0x09,
15
16
EndOfType
17
};
18
}
Copied!

Structs

Protocol::Card::Classify

카드 색상 분.
Protocol::Card::Classify 클래스를 배열로 사용(순서대로 front, rear)
1
namespace Protocol
2
{
3
namespace Card
4
{
5
class Classify
6
{
7
public:
8
s8 cc[6][3][2]; // [r, y, g, c, b, m][h, s, l][min, max] - h는 +-60 범위 사용. s, l은 x100을 적용하여 0~100 범위 사용
9
s8 l[2]; // [min, max] / min 이하는 black, white 이상은 white
10
};
11
}
12
}
Copied!
변수 이름.
형식.
크기.
범위.
설명.
cc[0][0][0]
s8
1 Byte
-60 ~ 60
Red, Hue, Min
cc[0][0][1]
s8
1 Byte
-60 ~ 60
Red, Hue, Max
cc[0][1][0]
s8
1 Byte
0 ~ 100
Red, Saturaton, Min
cc[0][1][1]
s8
1 Byte
0 ~ 100
Red, Saturaton, Max
cc[0][2][0]
s8
1 Byte
0 ~ 100
Red, Lightness, Min
cc[0][2][1]
s8
1 Byte
0 ~ 100
Red, Lightness, Max
cc[1][0][0]
s8
1 Byte
-60 ~ 60
Yellow, Hue, Min
cc[1][0][1]
s8
1 Byte
-60 ~ 60
Yellow, Hue, Max
cc[1][1][0]
s8
1 Byte
0 ~ 100
Yellow, Saturaton, Min
cc[1][1][1]
s8
1 Byte
0 ~ 100
Yellow, Saturaton, Max
cc[1][2][0]
s8
1 Byte
0 ~ 100
Yellow, Lightness, Min
cc[1][2][1]
s8
1 Byte
0 ~ 100
Yellow, Lightness, Max
cc[2][0][0]
s8
1 Byte
-60 ~ 60
Green, Hue, Min
cc[2][0][1]
s8
1 Byte
-60 ~ 60
Green, Hue, Max
cc[2][1][0]
s8
1 Byte
0 ~ 100
Green, Saturaton, Min
cc[2][1][1]
s8
1 Byte
0 ~ 100
Green, Saturaton, Max
cc[2][2][0]
s8
1 Byte
0 ~ 100
Green, Lightness, Min
cc[2][2][1]
s8
1 Byte
0 ~ 100
Green, Lightness, Max
cc[3][0][0]
s8
1 Byte
-60 ~ 60
Cyan, Hue, Min
cc[3][0][1]
s8
1 Byte
-60 ~ 60
Cyan, Hue, Max
cc[3][1][0]
s8
1 Byte
0 ~ 100
Cyan, Saturaton, Min
cc[3][1][1]
s8
1 Byte
0 ~ 100
Cyan, Saturaton, Max
cc[3][2][0]
s8
1 Byte
0 ~ 100
Cyan, Lightness, Min
cc[3][2][1]
s8
1 Byte
0 ~ 100
Cyan, Lightness, Max
cc[4][0][0]
s8
1 Byte
-60 ~ 60
Blue, Hue, Min
cc[4][0][1]
s8
1 Byte
-60 ~ 60
Blue, Hue, Max
cc[4][1][0]
s8
1 Byte
0 ~ 100
Blue, Saturaton, Min
cc[4][1][1]
s8
1 Byte
0 ~ 100
Blue, Saturaton, Max
cc[4][2][0]
s8
1 Byte
0 ~ 100
Blue, Lightness, Min
cc[4][2][1]
s8
1 Byte
0 ~ 100
Blue, Lightness, Max
cc[5][0][0]
s8
1 Byte
-60 ~ 60
Magenta, Hue, Min
cc[5][0][1]
s8
1 Byte
-60 ~ 60
Magenta, Hue, Max
cc[5][1][0]
s8
1 Byte
0 ~ 100
Magenta, Saturaton, Min
cc[5][1][1]
s8
1 Byte
0 ~ 100
Magenta, Saturaton, Max
cc[5][2][0]
s8
1 Byte
0 ~ 100
Magenta, Lightness, Min
cc[5][2][1]
s8
1 Byte
0 ~ 100
Magenta, Lightness, Max
l[0]
s8
1 Byte
0 ~ 100
Lightness Min(Black)
l[1]
s8
1 Byte
0 ~ 100
Lightness Max(White)

Protocol::Card::Range

RGB Raw 데이터의 출력 범위(캘리브레이션 시 검정색과 흰 색을 읽혔을 때의 출력값을 기준으로 사용)
1
namespace Protocol
2
{
3
namespace Card
4
{
5
class Range
6
{
7
public:
8
s16 range[2][3][2]; // [Front/Rear][R/G/B][Min/Max] 24 byte
9
};
10
}
11
}
Copied!
변수 이름.
형식.
크기.
범위.
설명.
range[0][0][1]
int16_t
24 Byte
0 ~ 4095
Front, Red, Min
range[0][0][2]
int16_t
24 Byte
0 ~ 4095
Front, Red, Max
range[0][1][1]
int16_t
24 Byte
0 ~ 4095
Front, Green, Min
range[0][1][2]
int16_t
24 Byte
0 ~ 4095
Front, Green, Max
range[0][2][1]
int16_t
24 Byte
0 ~ 4095
Front, Blue, Min
range[0][2][2]
int16_t
24 Byte
0 ~ 4095
Front, Blue, Max
range[1][0][1]
int16_t
24 Byte
0 ~ 4095
Rear, Red, Min
range[1][0][2]
int16_t
24 Byte
0 ~ 4095
Rear, Red, Max
range[1][1][1]
int16_t
24 Byte
0 ~ 4095
Rear, Green, Min
range[1][1][2]
int16_t
24 Byte
0 ~ 4095
Rear, Green, Max
range[1][2][1]
int16_t
24 Byte
0 ~ 4095
Rear, Blue, Min
range[1][2][2]
int16_t
24 Byte
0 ~ 4095
Rear, Blue, Max

Protocol::Card::Raw

카드 Raw 데이터.
rgbRaw : ADC에서 읽은 RGB의 RAW 데이터. rgb : rgbRaw를 range를 기준으로 0 ~ 255 사이의 값으로 변환한 값. hsvl : rgb를 hsv, hsl로 변환한 값. color : hsvl 값을 Color Classify에 설정된 기준으로 판별한 색. card : 카드(front 상위 4비트, rear 하위 4비트).
1
namespace Protocol
2
{
3
namespace Card
4
{
5
class Raw
6
{
7
public:
8
s16 rgbRaw[2][3]; // [Front/Rear][R/G/B] 12 byte
9
u8 rgb[2][3]; // [Front/Rear][R/G/B] 6 byte
10
s16 hsvl[2][4]; // [Front/Rear][R/G/B] 12 byte
11
u8 color[2]; // [Front/Rear] 2 byte
12
u8 card; // 1 byte
13
};
14
}
15
}
Copied!
변수 이름.
형식.
크기.
범위.
설명.
rgbRaw[0][0]
int16_t
2 Byte
0 ~ 4095
Raw, Front, Red
rgbRaw[0][1]
int16_t
2 Byte
0 ~ 4095
Raw, Front, Green
rgbRaw[0][2]
int16_t
2 Byte
0 ~ 4095
Raw, Front, Blue
rgbRaw[1][0]
int16_t
2 Byte
0 ~ 4095
Raw, Rear, Red
rgbRaw[1][1]
int16_t
2 Byte
0 ~ 4095
Raw, Rear, Green
rgbRaw[1][2]
int16_t
2 Byte
0 ~ 4095
Raw, Rear, Blue
rgb[0][0]
int16_t
1 Byte
0 ~ 255
Front, Red
rgb[0][1]
int16_t
1 Byte
0 ~ 255
Front, Green
rgb[0][2]
int16_t
1 Byte
0 ~ 255
Front, Blue
rgb[1][0]
int16_t
1 Byte
0 ~ 255
Rear, Red
rgb[1][1]
int16_t
1 Byte
0 ~ 255
Rear, Green
rgb[1][2]
int16_t
1 Byte
0 ~ 255
Rear, Blue
hsvl[0][0]
int16_t
2 Byte
0 ~ 360
Front, Hue
hsvl[0][1]
int16_t
2 Byte
0 ~ 100
Front, Saturation
hsvl[0][2]
int16_t
2 Byte
0 ~ 100
Front, Value
hsvl[0][3]
int16_t
2 Byte
0 ~ 100
Front, Lightness
hsvl[1][0]
int16_t
2 Byte
0 ~ 360
Rear, Hue
hsvl[1][1]
int16_t
2 Byte
0 ~ 100
Rear, Saturation
hsvl[1][2]
int16_t
2 Byte
0 ~ 100
Rear, Value
hsvl[1][3]
int16_t
2 Byte
0 ~ 100
Rear, Lightness
color[0]
Card::CardColor::Type
1 Byte
-
Front Color
color[1]
Card::CardColor::Type
1 Byte
-
Rear Color
card
Card::CardNameColor::Type, Card::CardNameCardCoding::Type, Card::CardNamePiano::Type
1 Byte
-
카드.

Protocol::Card::Color

카드 데이터(무선 통신에 사용하려고 Raw에서 크기를 줄임).
hsvl : rgb를 hsv, hsl로 변환한 값. color : hsvl 값을 Color Classify에 설정된 기준으로 판별한 색. card : 카드(front 상위 4비트, rear 하위 4비트).
1
namespace Protocol
2
{
3
namespace Card
4
{
5
class Color
6
{
7
public:
8
s16 hsvl[2][4]; // [Front/Rear][R/G/B] 12 byte
9
u8 color[2]; // [Front/Rear] 2 byte
10
u8 card; // 1 byte
11
};
12
}
13
}
Copied!
변수 이름.
형식.
크기.
범위.
설명.
hsvl[0][0]
int16_t
2 Byte
0 ~ 360
Front, Hue
hsvl[0][1]
int16_t
2 Byte
0 ~ 100
Front, Saturation
hsvl[0][2]
int16_t
2 Byte
0 ~ 100
Front, Value
hsvl[0][3]
int16_t
2 Byte
0 ~ 100
Front, Lightness
hsvl[1][0]
int16_t
2 Byte
0 ~ 360
Rear, Hue
hsvl[1][1]
int16_t
2 Byte
0 ~ 100
Rear, Saturation
hsvl[1][2]
int16_t
2 Byte
0 ~ 100
Rear, Value
hsvl[1][3]
int16_t
2 Byte
0 ~ 100
Rear, Lightness
color[0]
Card::CardColor::Type
1 Byte
-
Front Color
color[1]
Card::CardColor::Type
1 Byte
-
Rear Color
card
Card::CardNameColor::Type, Card::CardNameCardCoding::Type, Card::CardNamePiano::Type
1 Byte
-
카드.

Protocol::Card::Raw

카드 목록.
1
namespace Protocol
2
{
3
namespace Card
4
{
5
class List
6
{
7
public:
8
u8 index; // 현재 실행중인 카드의 인덱스
9
u8 size; // 입력된 카드의 총 갯수
10
11
u8 cardIndex; // 현재 전송하는 카드 배열의 시작 번호
12
u8 card[12];
13
};
14
}
15
}
Copied!
변수 이름.
형식.
크기.
범위.
설명.
index
uint8_t
1 Byte
0 ~ 100
현재 실행중인 카드의 인덱스.
size
uint8_t
1 Byte
0 ~ 100
입력된 카드의 총 갯수.
cardIndex
uint8_t
1 Byte
0 ~ 100
현재 전송하는 카드 배열의 시작 번호.
card[12]
Card::CardNameColor::Type, Card::CardNameFunction::Type
12 Byte
-
카드 목록.
Last modified 8mo ago