2 #include <mrm-action.h>
8 #define CATCH_SERVO_L_CATCH 30
9 #define CATCH_SERVO_L_CLOSE 0
10 #define CATCH_SERVO_L_OPEN 90
11 #define CATCH_SERVO_R_CATCH 60
12 #define CATCH_SERVO_R_CLOSE 90
13 #define CATCH_SERVO_R_OPEN 0
16 #define LIFT_SERVO_DOWN 80
17 #define LIFT_SERVO_UP 120
21 #define WALL_DIFFERENCE_ALLOWED_MM 50
22 #define MAXIMUM_WALL_MM 300
25 enum ledSign {LED_EVACUATION_ZONE, LED_FULL_CROSSING_BOTH_MARKS, LED_FULL_CROSSING_MARK_LEFT, LED_FULL_CROSSING_MARK_RIGHT, LED_FULL_CROSSING_NO_MARK,
26 LED_HALF_CROSSING_MARK_LEFT, LED_HALF_CROSSING_MARK_RIGHT, LED_HALF_CROSSING_LEFT_NO_MARK, LED_HALF_CROSSING_RIGHT_NO_MARK,
27 LED_LINE_FULL, LED_LINE_FULL_BOTH_MARKS, LED_LINE_FULL_MARK_LEFT, LED_LINE_FULL_MARK_RIGHT, LED_LINE_INTERRUPTED, LED_CURVE_LEFT,
28 LED_CURVE_RIGHT, LED_OBSTACLE, LED_OBSTACLE_AROUND_LEFT, LED_OBSTACLE_AROUND_RIGHT, LED_PAUSE, LED_PLAY, LED_T_CROSSING_BY_L,
29 LED_T_CROSSING_BY_R, LED_WALL_AHEAD, LED_WALL_L, LED_WALL_R};
54 uint16_t BIGGEST_GAP_IN_LINE_MS = 2500;
56 const uint8_t TOP_SPEED = 90;
57 const uint16_t AHEAD_IN_CROSSING = 210;
58 const uint8_t LAST_TRANSISTOR = 7;
80 uint16_t barrierBrightest = 2000;
88 RobotLine(
char name[] = (
char*)
"RCJ Line");
121 uint16_t
brightness(uint8_t transistorNumber);
127 bool button(uint8_t number);
172 void go(int16_t leftSpeed, int16_t rightSpeed);
189 bool lineAny(uint8_t fistTransistor = 0, uint8_t lastTransistor = 0xFF);
195 bool line(uint8_t transistorNumber);
231 uint8_t
hue(uint8_t deviceNumber);
237 void illumination(uint8_t current, uint8_t deviceNumber);
301 void servo(uint16_t degrees = 90, uint8_t servoNumber = 0);
306 void sign(uint8_t number);
316 void surfacePrint(
bool newLine =
false, uint16_t delayMsAfterPrint = 0);
321 void turn(int16_t byDegreesClockwise);
327 uint8_t
value(uint8_t deviceNumber);
369 void perform(){ ((
RobotLine*)_robot)->lineFollow(); }
377 void perform() { ((
RobotLine*)_robot)->obstacleAvoid(); }
387 void perform() { ((
RobotLine*)_robot)->evacuationZone(); }
396 void perform() { ((
RobotLine*)_robot)->rcjLine(); }
404 void perform() { ((
RobotLine*)_robot)->wallFollow(); }
413 void perform() { ((
RobotLine*)_robot)->loop0(); }
419 void perform() { ((
RobotLine*)_robot)->loop1(); }
425 void perform() { ((
RobotLine*)_robot)->loop2(); }
431 void perform() { ((
RobotLine*)_robot)->loop3(); }
437 void perform() { ((
RobotLine*)_robot)->loop4(); }
443 void perform() { ((
RobotLine*)_robot)->loop5(); }
449 void perform() { ((
RobotLine*)_robot)->loop6(); }
455 void perform() { ((
RobotLine*)_robot)->loop7(); }
461 void perform() { ((
RobotLine*)_robot)->loop8(); }
469 void perform() { ((
RobotLine*)_robot)->loopMenu(); }
Definition: mrm-action.h:7
ActionBase(Robot *robot, const char shortcut[4], const char text[20], uint8_t menuLevel=1, BoardId boardsId=ID_ANY)
Definition: mrm-action.cpp:23
Definition: mrm-robot-line.h:386
Definition: mrm-robot-line.h:368
Definition: mrm-robot-line.h:412
Definition: mrm-robot-line.h:418
Definition: mrm-robot-line.h:424
Definition: mrm-robot-line.h:430
Definition: mrm-robot-line.h:436
Definition: mrm-robot-line.h:442
Definition: mrm-robot-line.h:448
Definition: mrm-robot-line.h:454
Definition: mrm-robot-line.h:460
Definition: RobotLineTest.h:16
Definition: mrm-robot-line.h:376
Definition: mrm-robot-line.h:395
Definition: mrm-action.h:277
Definition: mrm-robot-line.h:403
Definition: mrm-board.h:403
Definition: mrm-robot.h:42
Definition: mrm-robot-line.h:53
RobotLine(char name[]=(char *)"RCJ Line")
Definition: mrm-robot-line.cpp:16
uint16_t front()
Definition: mrm-robot-line.cpp:655
uint16_t leftFront()
Definition: mrm-robot-line.cpp:723
void bitmapsSet()
Definition: mrm-robot-line.cpp:144
void curve()
Definition: mrm-robot-line.cpp:559
bool barrier()
Definition: mrm-robot-line.cpp:138
void armDrop()
Definition: mrm-robot-line.cpp:121
void surfacePrint(bool newLine=false, uint16_t delayMsAfterPrint=0)
Definition: mrm-robot-line.cpp:1063
bool markers()
Definition: mrm-robot-line.cpp:861
void armUp()
Definition: mrm-robot-line.cpp:129
void armCatchReady()
Definition: mrm-robot-line.cpp:104
void wallFollow()
Definition: mrm-robot-line.cpp:1105
uint8_t patternColors(uint8_t deviceNumber)
Definition: mrm-robot-line.cpp:984
void display(ledSign image)
Definition: mrm-robot-line.cpp:610
void stop()
Definition: mrm-robot-line.cpp:1055
void rcjLine()
Definition: mrm-robot-line.cpp:997
void evacuationZone()
Definition: mrm-robot-line.cpp:624
void goAhead()
Definition: mrm-robot-line.cpp:684
void go(int16_t leftSpeed, int16_t rightSpeed)
Definition: mrm-robot-line.cpp:678
float pitch()
Definition: mrm-robot-line.cpp:991
bool dark()
Definition: mrm-robot-line.cpp:603
uint16_t brightness(uint8_t transistorNumber)
Definition: mrm-robot-line.cpp:553
void turn(int16_t byDegreesClockwise)
Definition: mrm-robot-line.cpp:1077
float heading()
Definition: mrm-robot-line.cpp:693
void illumination(uint8_t current, uint8_t deviceNumber)
Definition: mrm-robot-line.cpp:709
void lineFollow()
Definition: mrm-robot-line.cpp:753
uint16_t frontRight()
Definition: mrm-robot-line.cpp:669
bool button(uint8_t number)
Definition: mrm-robot-line.cpp:545
uint16_t rightBack()
Definition: mrm-robot-line.cpp:1012
uint8_t saturation(uint8_t deviceNumber)
Definition: mrm-robot-line.cpp:1034
void obstacleAvoid()
Definition: mrm-robot-line.cpp:906
uint16_t leftBack()
Definition: mrm-robot-line.cpp:716
uint16_t frontLeft()
Definition: mrm-robot-line.cpp:662
float lineCenter()
Definition: mrm-robot-line.cpp:747
uint8_t hue(uint8_t deviceNumber)
Definition: mrm-robot-line.cpp:701
float roll()
Definition: mrm-robot-line.cpp:1026
bool wallRight()
Definition: mrm-robot-line.cpp:1210
bool line(uint8_t transistorNumber)
Definition: mrm-robot-line.cpp:740
bool wallLeft()
Definition: mrm-robot-line.cpp:1203
bool lineAny(uint8_t fistTransistor=0, uint8_t lastTransistor=0xFF)
Definition: mrm-robot-line.cpp:732
void loopMenu()
Definition: mrm-robot-line.cpp:852
void servo(uint16_t degrees=90, uint8_t servoNumber=0)
Definition: mrm-robot-line.cpp:1042
uint16_t rightFront()
Definition: mrm-robot-line.cpp:1019
uint8_t value(uint8_t deviceNumber)
Definition: mrm-robot-line.cpp:1098
void loop()
Definition: mrm-robot-line.cpp:821
void armCatch()
Definition: mrm-robot-line.cpp:96
void sign(uint8_t number)
Definition: mrm-robot-line.cpp:1049
void loop0()
Definition: mrm-robot-line.cpp:829