ETrobocon2017 - 片山研究所モデルベース開発推進事業部
common_definition.h
[詳解]
1 #ifndef __COMMON_DEFINITION__
2 #define __COMMON_DEFINITION__
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <math.h>
7 #include <string.h>
8 
9 
10 
11 #define DRIVING_POWER 30
12 /* ‰º‹L‚̃}ƒNƒ�‚͌‘̊‹«‚É�‡‚킹‚Ä•Ï�X‚·‚é•K—v‚ª‚ ‚è‚Ü‚· */ #define GYRO_OFFSET 0 /* ƒWƒƒƒCƒ�ƒZƒ“ƒTƒIƒtƒZƒbƒg’l(Šp‘¬“x0[deg/sec]Žž) */ #define LIGHT_WHITE 40 /* ”’�F‚ÌŒõƒZƒ“ƒT’l */ #define LIGHT_BLACK 0 /* �•�F‚ÌŒõƒZƒ“ƒT’l */ #define SONAR_ALERT_DISTANCE 30 /* ’´‰¹”gƒZƒ“ƒT‚É‚æ‚é�áŠQ•¨ŒŸ’m‹——£[cm] */ #define TAIL_ANGLE_STAND_UP 93 /* Š®‘S’âŽ~Žž‚ÌŠp“x[“x] */ #define TAIL_ANGLE_DRIVE 3 /* ƒoƒ‰ƒ“ƒX‘–�sŽž‚ÌŠp“x[“x] */ #define P_GAIN 2.5F /* Š®‘S’âŽ~—pƒ‚�[ƒ^�§Œä”ä—áŒW�” */ #define PWM_ABS_MAX 60 /* Š®‘S’âŽ~—pƒ‚�[ƒ^�§ŒäPWM�â‘Î�Å‘å’l */ //#define DEVICE_NAME "ET0" /* Bluetooth–¼ hrp2/target/ev3.h BLUETOOTH_LOCAL_NAME‚Å�Ý’è */ //#define PASS_KEY "1234" /* ƒpƒXƒL�[ hrp2/target/ev3.h BLUETOOTH_PIN_CODE‚Å�Ý’è */ #define CMD_START '1' /* ƒŠƒ‚�[ƒgƒXƒ^�[ƒgƒRƒ}ƒ“ƒh */ #define BLACK 2 #define WHITE 47 #define GREY (BLACK+WHITE)/2 /* LCDƒtƒHƒ“ƒgƒTƒCƒY */ #define CALIB_FONT (EV3_FONT_SMALL) #define CALIB_FONT_WIDTH (6/*TODO: magic number*/) #define CALIB_FONT_HEIGHT (8/*TODO: magic number*/) #define DRIVE_L EV3_PORT_C #define DRIVE_R EV3_PORT_B #define ARM EV3_PORT_A #define TAIL EV3_PORT_D #define ULTRASONIC EV3_PORT_3 #define TOUCH EV3_PORT_1 #define IR EV3_PORT_2 #define GYRO EV3_PORT_4 #define DEL 0.004 #endif /ŠÂ‹«‚É�‡‚킹‚Ä•Ï�X‚·‚é•K—v‚ª‚ ‚è‚Ü‚· */
13 #define GYRO_OFFSET 0 /* ƒWƒƒƒCƒ�ƒZƒ“ƒTƒIƒtƒZƒbƒg’l(Šp‘¬“x0[deg/sec]Žž) */
14 #define LIGHT_WHITE 40 /* ”’�F‚ÌŒõƒZƒ“ƒT’l */
15 #define LIGHT_BLACK 0 /* �•�F‚ÌŒõƒZƒ“ƒT’l */
16 #define SONAR_ALERT_DISTANCE 30 /* ’´‰¹”gƒZƒ“ƒT‚É‚æ‚é�áŠQ•¨ŒŸ’m‹——£[cm] */
17 #define TAIL_ANGLE_STAND_UP 93 /* Š®‘S’âŽ~Žž‚ÌŠp“x[“x] */
18 #define TAIL_ANGLE_DRIVE 3 /* ƒoƒ‰ƒ“ƒX‘–�sŽž‚ÌŠp“x[“x] */
19 #define P_GAIN 2.5F /* Š®‘S’âŽ~—pƒ‚�[ƒ^�§Œä”ä—áŒW�” */
20 #define PWM_ABS_MAX 60 /* Š®‘S’âŽ~—pƒ‚�[ƒ^�§ŒäPWM�â‘Î�Å‘å’l */
21 //#define DEVICE_NAME "ET0" /* Bluetooth–¼ hrp2/target/ev3.h BLUETOOTH_LOCAL_NAME‚Å�Ý’è */
22 //#define PASS_KEY "1234" /* ƒpƒXƒL�[ hrp2/target/ev3.h BLUETOOTH_PIN_CODE‚Å�Ý’è */
23 #define CMD_START '1' /* ƒŠƒ‚�[ƒgƒXƒ^�[ƒgƒRƒ}ƒ“ƒh */
24 #define BLACK 2
25 #define WHITE 47
26 #define GREY (BLACK+WHITE)/2
27 
28 /* LCDƒtƒHƒ“ƒgƒTƒCƒY */
29 #define CALIB_FONT (EV3_FONT_SMALL)
30 #define CALIB_FONT_WIDTH (6/*TODO: magic number*/)
31 #define CALIB_FONT_HEIGHT (8/*TODO: magic number*/)
32 
33 #define DRIVE_L EV3_PORT_C
34 #define DRIVE_R EV3_PORT_B
35 #define ARM EV3_PORT_A
36 #define TAIL EV3_PORT_D
37 #define ULTRASONIC EV3_PORT_3
38 #define TOUCH EV3_PORT_1
39 #define IR EV3_PORT_2
40 #define GYRO EV3_PORT_4
41 #define DEL 0.004
42 
43 #endif
44