#include <mrm-robot-line.h>
|
| RobotLine (char name[]=(char *)"RCJ Line") |
|
void | armCatch () |
|
void | armCatchReady () |
|
void | armClose () |
|
void | armDrop () |
|
void | armUp () |
|
bool | barrier () |
|
void | bitmapsSet () |
|
uint16_t | brightness (uint8_t transistorNumber) |
|
bool | button (uint8_t number) |
|
void | curve () |
|
bool | dark () |
|
void | display (ledSign image) |
|
void | display (char *text) |
|
void | evacuationZone () |
|
uint16_t | front () |
|
uint16_t | frontLeft () |
|
uint16_t | frontRight () |
|
void | go (int16_t leftSpeed, int16_t rightSpeed) |
|
uint16_t | leftBack () |
|
uint16_t | leftFront () |
|
bool | lineAny (uint8_t fistTransistor=0, uint8_t lastTransistor=0xFF) |
|
bool | line (uint8_t transistorNumber) |
|
float | lineCenter () |
|
void | loop0 () |
|
void | loop1 () |
|
void | loop2 () |
|
void | loop3 () |
|
void | loop4 () |
|
void | loop5 () |
|
void | loop6 () |
|
void | loop7 () |
|
void | loop8 () |
|
void | loopMenu () |
|
void | goAhead () |
|
float | heading () |
|
uint8_t | hue (uint8_t deviceNumber) |
|
void | illumination (uint8_t current, uint8_t deviceNumber) |
|
void | lineFollow () |
|
void | loop () |
|
bool | markers () |
|
void | obstacleAvoid () |
|
void | omniWheelsTest () |
|
uint8_t | patternColors (uint8_t deviceNumber) |
|
float | pitch () |
|
void | rcjLine () |
|
uint16_t | rightBack () |
|
uint16_t | rightFront () |
|
float | roll () |
|
uint8_t | saturation (uint8_t deviceNumber) |
|
void | servo (uint16_t degrees=90, uint8_t servoNumber=0) |
|
void | sign (uint8_t number) |
|
void | stop () |
|
void | surfacePrint (bool newLine=false, uint16_t delayMsAfterPrint=0) |
|
void | turn (int16_t byDegreesClockwise) |
|
uint8_t | value (uint8_t deviceNumber) |
|
void | wallFollow () |
|
bool | wallLeft () |
|
bool | wallRight () |
|
| Robot (char name[15]=(char *)"MRMS robot", char ssid[15]=(char *)"MRMS", char wiFiPassword[15]=(char *)"mrms") |
|
void | actionAdd (ActionBase *action) |
|
void | actionEnd () |
|
bool | actionPreprocessing (bool andFinish=true) |
|
void | actionPreprocessingEnd () |
|
void | add (Board *aBoard) |
|
void | blink () |
|
void | bluetoothTest () |
|
void | end () |
|
void | canBusSniffToggle () |
|
void | canIdChange () |
|
void | colorIlluminationOff () |
|
void | colorIlluminationOn () |
|
void | colorPatternErase () |
|
void | colorPatternPrint () |
|
void | colorPatternRecognize () |
|
void | colorPatternRecord () |
|
void | delayMs (uint16_t pauseMs) |
|
void | delayMicros (uint16_t pauseMicros) |
|
uint8_t | devicesScan (bool verbose) |
|
void | devicesStart (uint8_t measuringMode=0) |
|
void | devicesStop () |
|
void | errors () |
|
void | firmwarePrint () |
|
float | fpsGet () |
|
void | fpsPrint () |
|
void | i2cTest () |
|
void | info () |
|
void | irFinder3Test () |
|
void | irFinder3TestCalculated () |
|
void | lidar2mTest () |
|
void | lidar4mTest () |
|
void | lidarCalibrate () |
|
void | menu () |
|
void | menuColor () |
|
void | menuMainAndIdle () |
|
void | menuReflectance () |
|
void | menuSystem () |
|
void | messagePrint (CANBusMessage *msg, bool outbound) |
|
void | messagesReceive () |
|
void | motorTest () |
|
void | nodeTest () |
|
void | noLoopWithoutThis () |
|
void | oscillatorTest () |
|
void | reflectanceArrayCalibrationPrint () |
|
void | run () |
|
uint16_t | serialReadNumber (uint16_t timeoutFirst=3000, uint16_t timeoutBetween=500, bool onlySingleDigitInput=false, uint16_t limit=0xFFFE, bool printWarnings=true) |
|
void | servoInteractive () |
|
bool | setup (bool andFinish=true) |
|
bool | sniffing () |
|
void | stopAll () |
|
bool | stressTest () |
|
void | thermoTest () |
|
bool | userBreak () |
|
void | verboseToggle () |
|
Robot for RCJ Rescue Line, a class derived from the base Robot class.
◆ RobotLine()
RobotLine::RobotLine |
( |
char |
name[] = (char*)"RCJ Line" | ) |
|
Constructor
- Parameters
-
name | - it is also used for Bluetooth so a Bluetooth client (like a phone) will list the device using this name. |
◆ armCatch()
void RobotLine::armCatch |
( |
| ) |
|
Arm will go to ball-catch position.
◆ armCatchReady()
void RobotLine::armCatchReady |
( |
| ) |
|
Arm will go to ball-catch ready position.
◆ armDrop()
void RobotLine::armDrop |
( |
| ) |
|
◆ armUp()
void RobotLine::armUp |
( |
| ) |
|
Arm will lift the caught ball in the position where will be ready to drop it.
◆ barrier()
bool RobotLine::barrier |
( |
| ) |
|
Barrier interrupted? return interrupted or not
◆ bitmapsSet()
void RobotLine::bitmapsSet |
( |
| ) |
|
|
virtual |
Stores bitmaps in mrm-led8x8a.
Implements Robot.
◆ brightness()
Line sensor - brightness of the surface
- Parameters
-
transistorNumber | - starts from 0 and end value depends on sensor. Usually 7 (for mrm-ref-can8) or 8 (for mrm-ref-can9). |
- Returns
- - brightness as an analog value.
◆ button()
bool RobotLine::button |
( |
uint8_t |
number | ) |
|
Reads push button switch @number - 0 to 3, push button's ordinal number
- Returns
- - true if pressed
◆ curve()
void RobotLine::curve |
( |
| ) |
|
◆ dark()
Dark surface? return dark or not
◆ display() [1/2]
void RobotLine::display |
( |
char * |
text | ) |
|
Display 8x8 text image's number
◆ display() [2/2]
void RobotLine::display |
( |
ledSign |
image | ) |
|
Display 8x8 image image's number
◆ evacuationZone()
void RobotLine::evacuationZone |
( |
| ) |
|
Enter evacuation-zone algorithm.
Enter evacuation-zone algorithm
◆ front()
Front sensor distance.
- Returns
- - in mm
◆ frontLeft()
Front side - left sensor distance.
- Returns
- - in mm
◆ frontRight()
Front side - right sensor distance.
- Returns
- - in mm
◆ go()
Start motors
- Parameters
-
leftSpeed,in | range -127 to 127 |
right | Speed, in range -127 to 127 |
speedLimit | - Speed limit, 0 to 127. For example, 80 will limit all the speeds to 80/127%. 0 will turn the motors off. |
◆ goAhead()
void RobotLine::goAhead |
( |
| ) |
|
|
virtual |
Test - go straight ahead using a defined speed.
Implements Robot.
◆ heading()
float RobotLine::heading |
( |
| ) |
|
Compass
- Returns
- - North is 0�, clockwise are positive angles, values 0 - 360.
◆ hue()
Color sensor's hue
- Parameters
-
deviceNumber | - Device's ordinal number. Each call of function add() assigns a increasing number to the device, starting with 0. |
- Returns
- - Hue
◆ illumination()
void RobotLine::illumination |
( |
uint8_t |
current, |
|
|
uint8_t |
deviceNumber |
|
) |
| |
Set color sensor's illumination intensity
- Parameters
-
deviceNumber | - Device's ordinal number. Each call of function add() assigns a increasing number to the device, starting with 0. 0xFF - all sensors. |
current | - 0 - 3 |
◆ leftBack()
Left side - rear sensor distance.
- Returns
- - in mm
◆ leftFront()
Left side - front sensor distance.
- Returns
- - in mm
◆ line()
bool RobotLine::line |
( |
uint8_t |
transistorNumber | ) |
|
Line sensor
- Parameters
-
transistorNumber | - starts from 0 and end value depends on sensor. Usually 7 (for mrm-ref-can8) or 8 (for mrm-ref-can9). |
- Returns
- - true if black line found
◆ lineAny()
bool RobotLine::lineAny |
( |
uint8_t |
firstTransistor = 0 , |
|
|
uint8_t |
lastTransistor = 0xFF |
|
) |
| |
Line found?
- Returns
- - true if any sensor detects black.
- Parameters
-
firstTransistor | - start checking from this transistor. |
lastTransistor | - do not check after this one. |
◆ lineCenter()
float RobotLine::lineCenter |
( |
| ) |
|
Center of measurements, like center of the line
- Returns
- - -50 - 50. If 0, center of the robot is on the line. Depending on sensor, this value is roughly number of milimeter the line is left or right.
◆ lineFollow()
void RobotLine::lineFollow |
( |
| ) |
|
◆ loop()
Custom test
Custom test. The function will be called many times during the test, till You issue "x" menu command.
Implements Robot.
◆ loop0()
void RobotLine::loop0 |
( |
| ) |
|
Generic actions, use them as templates
◆ loopMenu()
void RobotLine::loopMenu |
( |
| ) |
|
◆ markers()
bool RobotLine::markers |
( |
| ) |
|
Check markers and turn if any found
- Returns
- - true if marker found, false otherwise
◆ obstacleAvoid()
void RobotLine::obstacleAvoid |
( |
| ) |
|
Avoid an obstacle on line.
◆ omniWheelsTest()
void RobotLine::omniWheelsTest |
( |
| ) |
|
◆ patternColors()
Choose a pattern closest to the current 6 colors
- Parameters
-
deviceNumber | - Device's ordinal number. Each call of function add() assigns a increasing number to the device, starting with 0. |
includeValue | - if true, HSV compared. If not, HS. @raturn - patternNumber |
◆ pitch()
float RobotLine::pitch |
( |
| ) |
|
Pitch
- Returns
- - Pitch in degrees. Inclination forwards or backwards. Leveled robot shows 0�.
◆ rcjLine()
void RobotLine::rcjLine |
( |
| ) |
|
Starts the RCJ Line run after this action selected.
◆ rightBack()
Right side - rear sensor distance.
- Returns
- - in mm
◆ rightFront()
Right side - front sensor distance.
- Returns
- - in mm
◆ roll()
float RobotLine::roll |
( |
| ) |
|
Roll
- Returns
- - Roll in degrees. Inclination to the left or right. Values -90 - 90. Leveled robot shows 0�.
◆ saturation()
Color sensor's saturation
- Parameters
-
deviceNumber | - Device's ordinal number. Each call of function add() assigns a increasing number to the device, starting with 0. |
- Returns
- - saturation.
◆ servo()
Move servo
- Parameters
-
degrees | - Servo's target angle, 0 - 180�, or 0 - 360�, depending on model, counting clockwise |
servoNumber | - Servo's ordinal number. Each call of function add() assigns a increasing number to the servo, starting with 0. |
◆ sign()
void RobotLine::sign |
( |
uint8_t |
number | ) |
|
Display fixed sign stored in sensor sign's number
◆ stop()
◆ surfacePrint()
void RobotLine::surfacePrint |
( |
bool |
newLine = false , |
|
|
uint16_t |
delayMsAfterPrint = 0 |
|
) |
| |
Prints line and color sensors. Used for debugging.
- Parameters
-
newLine | - new line |
delayMsAfterPrint | - delay after print |
◆ turn()
void RobotLine::turn |
( |
int16_t |
byDegreesClockwise | ) |
|
Turns the robot clockwise using compass.
- Parameters
-
byDegreesClockwise | - turn by defined number of degrees. |
◆ value()
Color sensor's value
- Parameters
-
deviceNumber | - device's ordinal number. Each call of function add() assigns a increasing number to the device, starting with 0. |
- Returns
- - value
◆ wallFollow()
void RobotLine::wallFollow |
( |
| ) |
|
◆ wallLeft()
bool RobotLine::wallLeft |
( |
| ) |
|
Wall left?
- Returns
- - true if wall
◆ wallRight()
bool RobotLine::wallRight |
( |
| ) |
|
Wall right?
- Returns
- - true if wall
The documentation for this class was generated from the following files:
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/src/mrm-robot-line.h
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/src/mrm-robot-line.cpp