|
Eyebot 7
7.16
A Hardware API to control various hardware
|
Header file for the EyeBot 7 functions. More...
#include "types.h"Functions | |
LCD | |
Available functions for the LCD | |
| int | LCDPrintf (const char *format,...) |
| Print formatted string to LCD and refresh LCD. Cursor position is updated. More... | |
| int | LCDSetPrintf (int row, int column, const char *format,...) |
| LCDPrintf with text position specified. More... | |
| int | LCDClear (void) |
| Clear the LCD display and all display buffers ie. turn it black. More... | |
| int | LCDSetPos (int row, int column) |
| Set the text cursor position to (row, column). More... | |
| int | LCDGetPos (int *row, int *column) |
| Get the text cursor position. More... | |
| int | LCDSetColor (COLOR fg, COLOR bg) |
| Set the default color for text (including background). More... | |
| int | LCDSetFont (int font, int variation) |
| Sets the font using font type and variation. More... | |
| int | LCDSetFontSize (int fontsize) |
| Sets the font size. More... | |
| int | LCDSetMode (int mode) |
| Update the internal mode flag bits. More... | |
| int | LCDMenu (char *st1, char *st2, char *st3, char *st4) |
| Set menu entries in KEY_CLASSIC mode (4-buttons). More... | |
| int | LCDMenuI (int pos, char *string, COLOR fg, COLOR bg) |
| Set specific menu entry in KEY_CLASSIC mode (index given by pos). More... | |
| int | LCDGetSize (int *x, int *y) |
| Get LCD resolution in pixels. More... | |
| int | LCDPixel (int x, int y, COLOR col) |
| Sets the color of the pixel at (x,y) coordinate to color. More... | |
| int | LCDPixelInvert (int x, int y) |
| Bit-invert the color of the pixel at (x,y) coordinate. More... | |
| COLOR | LCDGetPixel (int x, int y) |
| Get the RGB color value of the pixel at (x,y) coordinate. More... | |
| int | LCDLine (int x1, int y1, int x2, int y2, COLOR col) |
| Draw a color line from (x1,y1) to (x2,y2). More... | |
| int | LCDLineInvert (int x1, int y1, int x2, int y2) |
| Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels. More... | |
| int | LCDArea (int x1, int y1, int x2, int y2, COLOR col, int fill) |
| Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. More... | |
| int | LCDAreaInvert (int x1, int y1, int x2, int y2) |
| Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels. More... | |
| int | LCDCircle (int x1, int y1, int size, COLOR col, int fill) |
| Draws a circle. More... | |
| int | LCDCircleInvert (int x1, int y1, int size) |
| Inverts the pixels inside of the given circle. More... | |
| int | LCDImageSize (int t) |
| Specifies the size of subsequent LCDImage functions. More... | |
| int | LCDImageStart (int x, int y, int xs, int ys) |
| Sets the location and size parameters for subsequent image draws. More... | |
| int | LCDImage (BYTE *img) |
| Draws a colour (RGB) image to the LCD. More... | |
| int | LCDImageGray (BYTE *g) |
| Draws a greyscale [0..255] image to the LCD. More... | |
| int | LCDImageBinary (BYTE *b) |
| Draws a binary [0..1] image to the LCD. More... | |
| int | LCDRefresh (void) |
| Refresh the screen. Refreshes the menu. More... | |
KEY | |
Available functions for usage of the Keys | |
| int | KEYGet (void) |
| Blocking read (and wait) for key press (returns KEY1..KEY4) More... | |
| int | KEYRead (void) |
| Non-blocking read of key press (returns NOKEY=0 if no key) More... | |
| int | KEYWait (int key) |
| Wait for specific keys to be pressed. (use ANYKEY for any key) More... | |
| int | KEYGetXY (int *x, int *y) |
| Blocking read for touch at any position, and returns the coordinates of the pressed position. More... | |
| int | KEYReadXY (int *x, int *y) |
| Non-blocking read for touch at any position, returns coordinates of pressed position. More... | |
CAM | |
Available functions for usage of the Camera | |
| int | CAMInit (int resolution) |
| Initialises the camera. More... | |
| int | CAMRelease (void) |
| Stops and releases all camera structures. More... | |
| int | CAMGet (BYTE *buf) |
| Retrieve a camera frame into the provided buffer. More... | |
| int | CAMGetGray (BYTE *buf) |
| Grabs a gray image off the camera. More... | |
IP | |
Available functions for image processing | |
| int | IPSetSize (int resolution) |
| Sets the size for the image processing (also automatically set by CAMInit). More... | |
| int | IPReadFile (char *filename, BYTE *img) |
| Read PNM file, fill/crop if req.; return 0 for color, 1 for gray image. More... | |
| int | IPWriteFile (char *filename, BYTE *img) |
| Write color PNM file. More... | |
| int | IPWriteFileGray (char *filename, BYTE *gray) |
| Write greyscale PNM file. More... | |
| void | IPLaplace (BYTE *grayIn, BYTE *grayOut) |
| apply Laplace tranform to the image More... | |
| void | IPSobel (BYTE *imageIn, BYTE *imageOut) |
| apply Sobel tranform to the image More... | |
| void | IPCol2Gray (BYTE *imgIn, BYTE *grayOut) |
| Transfer color to gray image. More... | |
| void | IPGray2Col (BYTE *imgIn, BYTE *colOut) |
| Transfer grey to color (3-byte) image. More... | |
| void | IPRGB2Col (BYTE *r, BYTE *g, BYTE *b, BYTE *imgOut) |
| Transfer grey to color (3-byte) image. More... | |
| void | IPCol2HSI (BYTE *img, BYTE *h, BYTE *s, BYTE *i) |
| Transfer color image to hue sat int. More... | |
| void | IPOverlay (BYTE *c1, BYTE *c2, BYTE *cOut) |
| Overlay c2 onto c1, all color images. More... | |
| void | IPOverlayGray (BYTE *g1, BYTE *g2, COLOR col, BYTE *cOut) |
| Overlay gray image g2 onto g1, using col. More... | |
| COLOR | IPPRGB2Col (BYTE r, BYTE g, BYTE b) |
| Transforms RGB to a COLOR (for one Pixel) More... | |
| void | IPPCol2RGB (COLOR col, BYTE *r, BYTE *g, BYTE *b) |
| Transforms COLOR to RGB (for one Pixel) More... | |
| void | IPPCol2HSI (COLOR c, BYTE *h, BYTE *s, BYTE *i) |
| Transforms RGB to HSI (for one pixel) More... | |
| BYTE | IPPRGB2Hue (BYTE r, BYTE g, BYTE b) |
| Convert RGB to hue (0 for gray values) More... | |
| void | IPPRGB2HSI (BYTE r, BYTE g, BYTE b, BYTE *h, BYTE *s, BYTE *i) |
| Convert RGB to hue, sat, int; hue=0 for gray values. More... | |
OS | |
Available functions for obtaining system information | |
| char * | OSExecute (char *command) |
| Executes a system command and obtains the string returned after the command. More... | |
| int | OSVersion (char *buf) |
| Returns string containing running RoBIOS version. More... | |
| int | OSVersionIO (char *buf) |
| Gives the version of the IO board. More... | |
| int | OSMachineSpeed (void) |
| Inform the user how fast the processor runs. More... | |
| int | OSMachineType (void) |
| Inform the user in which environment the program runs. More... | |
| int | OSMachineName (char *buf) |
| Inform the user with which name the Eyebot is titled. More... | |
| int | OSMachineID (void) |
| Inform the user with which ID the Eyebot is titled. More... | |
MT | |
Available functions for usage of the Multitasking | |
| int | MTInit (void) |
| initialises the threads More... | |
| int | MTSleep (int n) |
| sleeps for 10ms ie n/100s More... | |
| TASK | MTSpawn (void *(*fct)(void *), int id) |
| Create and initialize thread with given ID. More... | |
| int | MTGetUID (TASK t) |
| gets the ID of the taks More... | |
| int | MTKill (TASK t) |
| kills the task t More... | |
| int | MTExit (void) |
| kills current task More... | |
| int | SEMAInit (SEMA *sem, int val) |
| initialises the semaphores More... | |
| int | SEMALock (SEMA *sem) |
| locks the given semaphoe More... | |
| int | SEMAUnlock (SEMA *sem) |
| unlocks the given semaphore More... | |
| int | OSWait (int n) |
| Waits for 1 ms. More... | |
| TIMER | OSAttachTimer (int scale, void(*fct)(void)) |
| adds a function to a 1kHz/scale timer, ie. executes every 1ms*scale usage: OSAttachTimer(<scale>, &<function>); More... | |
| int | OSDetachTimer (TIMER t) |
| removes the Timer from the list More... | |
| int | OSSetTime (int hrs, int mins, int secs) |
| sets the system time More... | |
| int | OSGetTime (int *hrs, int *mins, int *secs, int *ticks) |
| Get system time (ticks in 1/100 sec) More... | |
| int | OSGetCount (void) |
| gives you the count in 1/100 sec since the system start More... | |
SER | |
Available functions for usage of the serial communication | |
| int | SERInit (int interface, int baud, int handshake) |
| Initialises the port. More... | |
| int | SERSendChar (int interface, char ch) |
| Sends a single character to the given port handle. More... | |
| int | SERSend (int interface, char *buf) |
| Sends a string to the given port handle. More... | |
| char | SERReceiveChar (int interface) |
| Receives a single character from the given port handle. More... | |
| int | SERReceive (int interface, char *buf) |
| Receives a string from port handle. More... | |
| bool | SERCheck (int interface) |
| checks and flushes the port by sending enter until seeing prompt More... | |
| int | SERFlush (int interface) |
| flushes the port More... | |
| int | SERClose (int interface) |
| closes the port More... | |
AU | |
Available functions for usage of the audio on the eyebot | |
| int | AUBeep (void) |
| Play beep sound. More... | |
| int | AUTone (int freq, int time) |
| Play tone with FREQ for time/100 sec. More... | |
| int | AUCheckTone (void) |
| Non-blocking test if tone has finished. More... | |
| int | AUPlay (BYTE *sample) |
| Play audio sample. More... | |
| int | AUCheckPlay (void) |
| Non-blocking test if playing has finished. More... | |
| int | AUMicrophone (void) |
| Return microphone A-to-D sample value. More... | |
| int | AURecord (BYTE *buf, int time, long freq) |
| Record sound for time/100sec using sample FREQ. More... | |
| int | AUCheckRecord (void) |
| Non-blocking check whether recording has finished. More... | |
PSD | |
Available functions for access of the IR PSDs | |
| int | PSDGet (int psd) |
| Delivers actual timestamp or distance measured by the selected PSD. More... | |
| int | PSDGetRaw (int psd) |
| Delivers raw-data measured by the selected PSD. More... | |
SERVO | |
Available functions for usage of the Servos | |
| int | SERVOSet (int servo, int angle) |
| Set the given servos to the same given angle depending on table value. More... | |
| int | SERVOSetRaw (int servo, int angle) |
| Set the given servos to the same given angle in raw mode. More... | |
| int | SERVORange (int servo, int low, int high) |
| Sets the range for the servos. More... | |
MOTOR | |
Available functions for usage of the Motors | |
| int | MOTORDrive (int motor, int speed) |
| Set the given motors to the same given speed dependant on hdt table. More... | |
| int | MOTORDriveRaw (int motor, int speed) |
| Set the given motor to a given speed. More... | |
| int | MOTORPID (int motor, int p, int i, int d) |
| Set the given motors with PID control. More... | |
| int | MOTORPIDOff (int motor) |
| Shuts off PID control. More... | |
| int | MOTORSpeed (int motor, int ticks) |
| Sets the controlled motor speed in ticks/sec. More... | |
ENCODER | |
Available functions for usage of the encoders | |
| int | ENCODERRead (int quad) |
| Reads the value from the encoder. More... | |
| int | ENCODERReset (int quad) |
| Resets the encoder to 0. More... | |
VW | |
Available functions for usage of VW drive functions | |
| int | VWSetSpeed (int linSpeed, int angSpeed) |
| Sets the VW speed, angle. More... | |
| int | VWGetSpeed (int *linSspeed, int *angSpeed) |
| Obtains the current speeds. More... | |
| int | VWSetPosition (int x, int y, int phi) |
| Sets the position wrt current position. More... | |
| int | VWGetPosition (int *x, int *y, int *phi) |
| Gets the position wrt original position. More... | |
| int | VWControl (int Vv, int Tv, int Vw, int Tw) |
| Set PI params. for v and w (typical 70 30 70 10) More... | |
| int | VWControlOff (void) |
| Stop PI control for v and w. More... | |
| int | VWStraight (int dist, int lin_speed) |
| Drives straight. More... | |
| int | VWTurn (int angle, int ang_speed) |
| Turns the vehicle on the spot. More... | |
| int | VWCurve (int dist, int angle, int lin_speed) |
| Turns the vehicle in a curve. More... | |
| int | VWDrive (int dx, int dy, int lin_speed) |
| Turns the vehicle in a curve: x[mm] straight and y[mm] left, x>|y|. More... | |
| int | VWDriveRemain (void) |
| Checks the remaining drive time. More... | |
| int | VWDriveDone (void) |
| Checks to see if the current drive is complete. More... | |
| int | VWDriveWait (void) |
| Blocks until the drive is complete. More... | |
| int | VWStalled (void) |
| Checks to see if the vehicle is stalled. More... | |
DIGITAL | |
Available functions for usage of the IO pins | |
| int | DIGITALSetup (int io, char direction) |
| Sets up the digital input/output pins. More... | |
| int | DIGITALRead (int io) |
| Reads the digital input/output pins. More... | |
| int | DIGITALReadAll (void) |
| Reads all digital pins. More... | |
| int | DIGITALWrite (int io, int state) |
| Writes to the digital input/output pins. More... | |
| int | ANALOGRead (int channel) |
| Reads the analog channel on the IO board. More... | |
| int | ANALOGVoltage (void) |
| Finds the Analog Voltage as read from the IO board. More... | |
IRTV | |
Available functions for usage of the IR remote control | |
| int | IRTVGet (void) |
| Blocking read of IRTV command and returns the keycode. More... | |
| int | IRTVRead (void) |
| Non-blocking read, return 0 if nothing and returns the keycode. More... | |
| int | IRTVFlush (void) |
| Terminates the remote control decoder and releases the irtv thread. More... | |
| int | IRTVGetStatus (void) |
| Checks to see if IR input is enabled;. More... | |
RADIO | |
Available functions for usage of the radio communication to the other eyebots | |
| int | RADIOInit (void) |
| Starts radio communication between the Eyebots. More... | |
| int | RADIOGetID (void) |
| Get own radio ID. More... | |
| int | RADIOSend (int id_no, BYTE *buf, int size) |
| Send spec. number of bytes to ID destination. More... | |
| int | RADIOReceive (int *id_no, BYTE *buf, int *size) |
| Read num. of bytes from ID source. More... | |
| int | RADIOCheck (int *id_no) |
| Non-blocking check whether message is waiting. More... | |
| int | RADIOStatus (int IDlist[]) |
| Returns number of robots (incl. self) and list of IDs in network. More... | |
| int | RADIORelease (void) |
| Terminate radio communication. More... | |
Header file for the EyeBot 7 functions.
| int ANALOGRead | ( | int | channel | ) |
Reads the analog channel on the IO board.
| the | channel to read from [1..8] |
| int ANALOGVoltage | ( | void | ) |
Finds the Analog Voltage as read from the IO board.
| int AUBeep | ( | void | ) |
Play beep sound.
| int AUCheckPlay | ( | void | ) |
Non-blocking test if playing has finished.
| int AUCheckRecord | ( | void | ) |
Non-blocking check whether recording has finished.
| int AUCheckTone | ( | void | ) |
Non-blocking test if tone has finished.
| int AUMicrophone | ( | void | ) |
Return microphone A-to-D sample value.
| int AUPlay | ( | BYTE * | sample | ) |
Play audio sample.
| sample | the raw audio file |
| int AURecord | ( | BYTE * | buf, |
| int | time, | ||
| long | freq | ||
| ) |
Record sound for time/100sec using sample FREQ.
| buf | the buffer to record audio to |
| time | the length of the recording |
| freq | the sample freq |
| int AUTone | ( | int | freq, |
| int | time | ||
| ) |
Play tone with FREQ for time/100 sec.
| freq | the frequency of the beep |
| time | the time/100s for the beep to play |
| int CAMGet | ( | BYTE * | buf | ) |
Retrieve a camera frame into the provided buffer.
| BYTE | *buf: the buffer to store the image |
| int CAMGetGray | ( | BYTE * | buf | ) |
Grabs a gray image off the camera.
| the | byte stream to store the image data, data in Gray format |
| int CAMInit | ( | int | resolution | ) |
Initialises the camera.
| int | resolution The resolution of the camera (QQVGA, QVGA, VGA, CAM1MP, CAMHD, CAM5MP, CUSTOM) default QVGA |
| int CAMRelease | ( | void | ) |
Stops and releases all camera structures.
Releases all allocated memory and stops video capture.
| int DIGITALRead | ( | int | io | ) |
Reads the digital input/output pins.
| io | the pin to check status [1..16] |
| int DIGITALReadAll | ( | void | ) |
Reads all digital pins.
| int DIGITALSetup | ( | int | io, |
| char | direction | ||
| ) |
Sets up the digital input/output pins.
| io | the pin to setup [1..16] |
| direction | [i-n/o-ut/I-n pull-up/J-n pull-down] |
| int DIGITALWrite | ( | int | io, |
| int | state | ||
| ) |
Writes to the digital input/output pins.
| io | the pin to set [1..16] |
| state | the state of the pin [0 or 1] |
| int ENCODERRead | ( | int | quad | ) |
Reads the value from the encoder.
| quad | the encoder to read from [1..4] |
| int ENCODERReset | ( | int | quad | ) |
Resets the encoder to 0.
| quad | the encoder to reset [1..4] |
Transfer color to gray image.
| imgIn | the input image |
| grayOut | the formatted output image |
Transfer color image to hue sat int.
| img | the input image |
| h | the hue |
| s | the saturation |
| i | the intensity |
Transfer grey to color (3-byte) image.
| imgIn | the input image |
| colOut | the formatted output image |
apply Laplace tranform to the image
| grayIn | the input image |
| grayOut | the formatted output image |
Overlay c2 onto c1, all color images.
| c2 | |
| c1 | |
| cOut | the output image |
Overlay gray image g2 onto g1, using col.
| g1 | |
| g2 | |
| col | |
| cOut | the output image |
Transforms RGB to HSI (for one pixel)
| COLOR | c the color to transform |
| h | the hue |
| s | the saturation |
| i | the intensity |
Transforms COLOR to RGB (for one Pixel)
| r | the red |
| g | the green |
| b | the blue |
| COLOR | the COLOR |
Transforms RGB to a COLOR (for one Pixel)
| r | the red |
| g | the green |
| b | the blue |
Convert RGB to hue, sat, int; hue=0 for gray values.
| r | the red |
| g | the green |
| b | the blue |
| h | the hue |
| s | the saturation |
| i | the intensity |
Convert RGB to hue (0 for gray values)
| r | the red |
| g | the green |
| b | the blue |
| int IPReadFile | ( | char * | filename, |
| BYTE * | img | ||
| ) |
Read PNM file, fill/crop if req.; return 0 for color, 1 for gray image.
| filename | the file to open |
| img | the buffer to store the image |
Transfer grey to color (3-byte) image.
| imgIn | the input image |
| colOut | the formatted output image |
| int IPSetSize | ( | int | resolution | ) |
Sets the size for the image processing (also automatically set by CAMInit).
| mode | the resolution (QQVGA, QVGA, VGA, CAM1MP, CAMHD, CAM5MP, CUSTOM) specifying the resolution of the camera |
apply Sobel tranform to the image
| imageIn | the input image |
| imageOut | the formatted output image |
| int IPWriteFile | ( | char * | filename, |
| BYTE * | img | ||
| ) |
Write color PNM file.
| filename | the file to save to |
| img | the buffer to store the image |
| int IPWriteFileGray | ( | char * | filename, |
| BYTE * | gray | ||
| ) |
Write greyscale PNM file.
| filename | the file to save to |
| img | the buffer to store the image |
| int IRTVFlush | ( | void | ) |
Terminates the remote control decoder and releases the irtv thread.
| int IRTVGet | ( | void | ) |
Blocking read of IRTV command and returns the keycode.
| int IRTVGetStatus | ( | void | ) |
Checks to see if IR input is enabled;.
| int IRTVRead | ( | void | ) |
Non-blocking read, return 0 if nothing and returns the keycode.
| int KEYGet | ( | void | ) |
Blocking read (and wait) for key press (returns KEY1..KEY4)
| int KEYGetXY | ( | int * | x, |
| int * | y | ||
| ) |
Blocking read for touch at any position, and returns the coordinates of the pressed position.
| int KEYRead | ( | void | ) |
Non-blocking read of key press (returns NOKEY=0 if no key)
| int KEYReadXY | ( | int * | x, |
| int * | y | ||
| ) |
Non-blocking read for touch at any position, returns coordinates of pressed position.
| int KEYWait | ( | int | key | ) |
Wait for specific keys to be pressed. (use ANYKEY for any key)
| int | key : Expected keycode values (KEY1..KEY4) |
| int LCDArea | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| COLOR | col, | ||
| int | fill | ||
| ) |
Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate.
| int | x1 : X-coordinate of top-left pixel |
| int | y1 : Y-coordinate of top-left pixel |
| int | x2 : X-coordinate of bottom-right pixel |
| int | y2 : Y-coordinate of bottom-right pixel |
| COLOR | col : RGB fill color value |
| int LCDAreaInvert | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2 | ||
| ) |
Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels.
| int | x1 : X-coordinate of top-left pixel |
| int | y1 : Y-coordinate of top-left pixel |
| int | x2 : X-coordinate of bottom-right pixel |
| int | y2 : Y-coordinate of bottom-right pixel |
| int LCDCircle | ( | int | x1, |
| int | y1, | ||
| int | size, | ||
| COLOR | col, | ||
| int | fill | ||
| ) |
Draws a circle.
| int | x1 : X-coordinate of the centre |
| int | y1 : Y-coordinate of the centre |
| int | size : radius of the circle |
| COLOR | col: the color of the circle |
| int | fill : fill(1) or no fill(0) |
| int LCDCircleInvert | ( | int | x1, |
| int | y1, | ||
| int | size | ||
| ) |
Inverts the pixels inside of the given circle.
| int | x1 : X-coordinate of the centre |
| int | y1 : Y-coordinate of the centre |
| int | r the radius of the circle |
| int LCDClear | ( | void | ) |
Clear the LCD display and all display buffers ie. turn it black.
| COLOR LCDGetPixel | ( | int | x, |
| int | y | ||
| ) |
Get the RGB color value of the pixel at (x,y) coordinate.
| int | x : X-coordinate of the pixel |
| int | y : Y-coordinate of the pixel |
| int LCDGetPos | ( | int * | row, |
| int * | column | ||
| ) |
Get the text cursor position.
| int* | row : Pointer to cursor row index |
| int* | column : Pointer to cursor column index |
| int LCDGetSize | ( | int * | x, |
| int * | y | ||
| ) |
Get LCD resolution in pixels.
| x | : Where to store the width of the LCD |
| y | : Where to store the height of the LCD |
| int LCDImage | ( | BYTE * | img | ) |
Draws a colour (RGB) image to the LCD.
| img | : A pointer to the BYTE buffer of the image |
| int LCDImageBinary | ( | BYTE * | b | ) |
Draws a binary [0..1] image to the LCD.
| img | : A pointer to the BYTE buffer of the image |
| int LCDImageGray | ( | BYTE * | g | ) |
Draws a greyscale [0..255] image to the LCD.
| img | : A pointer to the BYTE buffer of the image |
| int LCDImageSize | ( | int | t | ) |
Specifies the size of subsequent LCDImage functions.
| int | type: the size of the image (QQVGA, QVGA, VGA, CAM1MP, CAMHD, CAM5MP, CUSTOM), default QVGA |
| int LCDImageStart | ( | int | x, |
| int | y, | ||
| int | xs, | ||
| int | ys | ||
| ) |
Sets the location and size parameters for subsequent image draws.
| int | t : the image type |
| int | x : x-coordinate of top-left image position |
| int | y : y-coordinate of top-left image position |
| int | xs : Image width |
| int | ys : Image height |
| int LCDLine | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| COLOR | col | ||
| ) |
Draw a color line from (x1,y1) to (x2,y2).
| int | x1 : X-coordinate of first pixel |
| int | y1 : Y-coordinate of first pixel |
| int | x2 : X-coordinate of second pixel |
| int | y2 : Y-coordinate of second pixel |
| COLOR | color : RGB color value for the pixel |
| int LCDLineInvert | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2 | ||
| ) |
Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels.
| int | x1 : X-coordinate of first pixel |
| int | y1 : Y-coordinate of first pixel |
| int | x2 : X-coordinate of second pixel |
| int | y2 : Y-coordinate of second pixel |
| int LCDMenu | ( | char * | st1, |
| char * | st2, | ||
| char * | st3, | ||
| char * | st4 | ||
| ) |
Set menu entries in KEY_CLASSIC mode (4-buttons).
| char* | string1 : Menu entry for KEY1 in classic mode |
| char* | string2 : Menu entry for KEY2 in classic mode |
| char* | string3 : Menu entry for KEY3 in classic mode |
| char* | string4 : Menu entry for KEY4 in classic mode |
Set specific menu entry in KEY_CLASSIC mode (index given by pos).
| int | pos : Select menu entry in classic mode (from 1->4) |
| char* | string : Menu entry for the key at specified index |
| XColor | fgcol : Textcolor for the menu |
| XColor | bgcol : Background color for the menu |
| int LCDPixel | ( | int | x, |
| int | y, | ||
| COLOR | col | ||
| ) |
Sets the color of the pixel at (x,y) coordinate to color.
| int | x : X-coordinate of the pixel |
| int | y : Y-coordinate of the pixel |
| col | : RGB color value for the pixel |
| int LCDPixelInvert | ( | int | x, |
| int | y | ||
| ) |
Bit-invert the color of the pixel at (x,y) coordinate.
| int | x : X-coordinate of the pixel |
| int | y : Y-coordinate of the pixel |
| int LCDPrintf | ( | const char * | format, |
| ... | |||
| ) |
Print formatted string to LCD and refresh LCD. Cursor position is updated.
| const | char* format : Formatted string |
| int LCDRefresh | ( | void | ) |
Refresh the screen. Refreshes the menu.
Set the default color for text (including background).
| fg | : Default color for text |
| bg | : Default color for text background |
| int LCDSetFont | ( | int | font, |
| int | variation | ||
| ) |
Sets the font using font type and variation.
| int | font: The type of font (HELVETICA/TIMES/COURIER) |
| int | variation: The variation (NORMAL/BOLD/ITALICS) |
| int LCDSetFontSize | ( | int | fontsize | ) |
Sets the font size.
| int | fontsize: The size of subsequent printf (8, 12, 14, 18, 24) |
| int LCDSetMode | ( | int | mode | ) |
Update the internal mode flag bits.
| int | mode : LCD Mode flag (default = 0) |
| int LCDSetPos | ( | int | row, |
| int | column | ||
| ) |
Set the text cursor position to (row, column).
| int | row : Text cursor row index |
| int | column : Text cursor column index |
| int LCDSetPrintf | ( | int | row, |
| int | column, | ||
| const char * | format, | ||
| ... | |||
| ) |
LCDPrintf with text position specified.
| int | row : Cursor position |
| int | column : Cursor position |
| const | char* format : Formatted string |
| int MOTORDrive | ( | int | motor, |
| int | speed | ||
| ) |
Set the given motors to the same given speed dependant on hdt table.
| motor | the motor to set [1..4] |
| speed | : motor speed in percent [-100 ..+100] |
| int MOTORDriveRaw | ( | int | motor, |
| int | speed | ||
| ) |
Set the given motor to a given speed.
| motor | the motor to set [1..4] |
| speed | : motor speed [-100 ..+100] |
| int MOTORPID | ( | int | motor, |
| int | p, | ||
| int | i, | ||
| int | d | ||
| ) |
Set the given motors with PID control.
| motor | the motor to set [1..4] |
| p | the p setting [1..255] |
| i | the i setting [1..255] |
| d | the d setting [1..255] |
| int MOTORPIDOff | ( | int | motor | ) |
Shuts off PID control.
| motor | the motor to set [1..4] |
| int MOTORSpeed | ( | int | motor, |
| int | ticks | ||
| ) |
Sets the controlled motor speed in ticks/sec.
| motor | the motor to set [1..4] |
| ticks | the number of ticks per sec |
| int MTExit | ( | void | ) |
kills current task
| int MTGetUID | ( | TASK | t | ) |
| int MTInit | ( | void | ) |
initialises the threads
| int MTKill | ( | TASK | t | ) |
| int MTSleep | ( | int | n | ) |
sleeps for 10ms ie n/100s
| n | the number of periods waited |
| TASK MTSpawn | ( | void *(*)(void *) | fct, |
| int | id | ||
| ) |
Create and initialize thread with given ID.
| fct | the function to spawn |
| if | td the id of the function |
| TIMER OSAttachTimer | ( | int | scale, |
| void(*)(void) | fct | ||
| ) |
adds a function to a 1kHz/scale timer, ie. executes every 1ms*scale usage: OSAttachTimer(<scale>, &<function>);
| scale | the rate to run the function |
| fct | the function to run, note must return void and have no arguments |
| int OSDetachTimer | ( | TIMER | t | ) |
removes the Timer from the list
| handle | the timer to remove |
| char* OSExecute | ( | char * | command | ) |
Executes a system command and obtains the string returned after the command.
| command | the command to run |
| int OSGetCount | ( | void | ) |
gives you the count in 1/100 sec since the system start
| int OSGetTime | ( | int * | hrs, |
| int * | mins, | ||
| int * | secs, | ||
| int * | ticks | ||
| ) |
Get system time (ticks in 1/100 sec)
| hrs | the pointer to the hours integer |
| mins | the pointer to the mins integer |
| secs | the pointer to the secs integer |
| ticks | the pointer to the ticks integer |
| int OSMachineID | ( | void | ) |
Inform the user with which ID the Eyebot is titled.
| int OSMachineName | ( | char * | buf | ) |
Inform the user with which name the Eyebot is titled.
| int OSMachineSpeed | ( | void | ) |
Inform the user how fast the processor runs.
| int OSMachineType | ( | void | ) |
Inform the user in which environment the program runs.
Valid values are: VEHICLE, PLATFORM, WALKER
| int OSSetTime | ( | int | hrs, |
| int | mins, | ||
| int | secs | ||
| ) |
sets the system time
| hrs | the hours |
| mins | the mins |
| secs | the secs |
| int OSVersion | ( | char * | buf | ) |
Returns string containing running RoBIOS version.
| int OSVersionIO | ( | char * | buf | ) |
Gives the version of the IO board.
| version,the | string to store the version string |
| int OSWait | ( | int | n | ) |
Waits for 1 ms.
| n | the number of ms to wait for |
| int PSDGet | ( | int | psd | ) |
Delivers actual timestamp or distance measured by the selected PSD.
| psd | the number of the psd to read |
| int PSDGetRaw | ( | int | psd | ) |
Delivers raw-data measured by the selected PSD.
| psd | the psd to read [1..6] |
| int RADIOCheck | ( | int * | id_no | ) |
Non-blocking check whether message is waiting.
| id_no | the id number of the eyebot to check |
| int RADIOGetID | ( | void | ) |
Get own radio ID.
| int RADIOInit | ( | void | ) |
Starts radio communication between the Eyebots.
| int RADIOReceive | ( | int * | id_no, |
| BYTE * | buf, | ||
| int * | size | ||
| ) |
Read num. of bytes from ID source.
| id_no | the id number of the eyebot |
| buf | the bytes to receive |
| size | the size of the buffer to receive |
| int RADIORelease | ( | void | ) |
Terminate radio communication.
| int RADIOSend | ( | int | id_no, |
| BYTE * | buf, | ||
| int | size | ||
| ) |
Send spec. number of bytes to ID destination.
| id_no | the id number of the eyebot |
| buf | the bytes to send |
| size | the size of the buffer to send |
| int RADIOStatus | ( | int | IDlist[] | ) |
Returns number of robots (incl. self) and list of IDs in network.
| IDList[] | the list of robots and ids |
| int SEMAInit | ( | SEMA * | sem, |
| int | val | ||
| ) |
initialises the semaphores
| SEMA | sem the semaphore |
| val | the value to set it at |
| int SEMALock | ( | SEMA * | sem | ) |
locks the given semaphoe
| SEMA | sem the semaphore to lock |
| int SEMAUnlock | ( | SEMA * | sem | ) |
unlocks the given semaphore
| SEMA | sem the semaphore to unlock |
| bool SERCheck | ( | int | interface | ) |
checks and flushes the port by sending enter until seeing prompt
| interface | the inteface type |
| int SERClose | ( | int | interface | ) |
closes the port
| interface | the inteface type |
| int SERFlush | ( | int | interface | ) |
flushes the port
| interface | the inteface type |
| int SERInit | ( | int | interface, |
| int | baud, | ||
| int | handshake | ||
| ) |
Initialises the port.
| interface | the inteface type |
| baud | the baud rate |
| handshake | the handshake type |
| int SERReceive | ( | int | interface, |
| char * | buf | ||
| ) |
Receives a string from port handle.
| interface | the inteface type |
| buf | the string to store the received bytes |
| size | the length of the string to receive |
| char SERReceiveChar | ( | int | interface | ) |
Receives a single character from the given port handle.
| interface | the inteface type |
| int SERSend | ( | int | interface, |
| char * | buf | ||
| ) |
Sends a string to the given port handle.
| interface | the inteface type |
| buf | the string to send |
| size | the length of the string to send |
| int SERSendChar | ( | int | interface, |
| char | ch | ||
| ) |
Sends a single character to the given port handle.
| interface | the inteface type |
| ch | the character to send |
| int SERVORange | ( | int | servo, |
| int | low, | ||
| int | high | ||
| ) |
Sets the range for the servos.
| servo | the servo to set [1..14] limits in 1/100 sec |
| low | the lower limit |
| high | the upper limit |
| int SERVOSet | ( | int | servo, |
| int | angle | ||
| ) |
Set the given servos to the same given angle depending on table value.
| servo | the servo number [1..14] |
| angle | the angle to set it to [1..255] |
| int SERVOSetRaw | ( | int | servo, |
| int | angle | ||
| ) |
Set the given servos to the same given angle in raw mode.
| servo | the servo to set [1..14] |
| int | angle : valid values = 0-255 |
| int VWControl | ( | int | Vv, |
| int | Tv, | ||
| int | Vw, | ||
| int | Tw | ||
| ) |
Set PI params. for v and w (typical 70 30 70 10)
| Vv | |
| Tv | |
| Vw | |
| Vw |
| int VWControlOff | ( | void | ) |
Stop PI control for v and w.
| int VWCurve | ( | int | dist, |
| int | angle, | ||
| int | lin_speed | ||
| ) |
Turns the vehicle in a curve.
| dist | the radial distance [mm] |
| angle | the angle to rotate in Radians * 100 (eg. 314 = half circle) |
| lin_speed | the speed to rotate [mm/s] |
| int VWDrive | ( | int | dx, |
| int | dy, | ||
| int | lin_speed | ||
| ) |
Turns the vehicle in a curve: x[mm] straight and y[mm] left, x>|y|.
| dx | the distance in front of the vehicle to drive (in mm) |
| dy | the distance perpendicular to the direction of travel (in mm) |
| lin_speed | the speed to rotate |
| int VWDriveDone | ( | void | ) |
Checks to see if the current drive is complete.
| int VWDriveRemain | ( | void | ) |
Checks the remaining drive time.
| int VWDriveWait | ( | void | ) |
Blocks until the drive is complete.
| int VWGetPosition | ( | int * | x, |
| int * | y, | ||
| int * | phi | ||
| ) |
Gets the position wrt original position.
| x | stores the horizontal component (mm) |
| y | stores the vertical component (mm) |
| phi | stores the turn angle (rad*100) |
| int VWGetSpeed | ( | int * | linSspeed, |
| int * | angSpeed | ||
| ) |
Obtains the current speeds.
| linspeed | the integer to store the linear speed (mm/s) |
| angSpeed | the integer to store the angular speed (100 * rad/s) |
| int VWSetPosition | ( | int | x, |
| int | y, | ||
| int | phi | ||
| ) |
Sets the position wrt current position.
| x | the horizontal component (mm) |
| y | the vertical component (mm) |
| phi | the turn angle (rad*100) |
| int VWSetSpeed | ( | int | linSpeed, |
| int | angSpeed | ||
| ) |
Sets the VW speed, angle.
| linSpeed | the straightline speed (mm/s) |
| angSpeed | the angular turning speed (100 * rad/s) |
| int VWStalled | ( | void | ) |
Checks to see if the vehicle is stalled.
| int VWStraight | ( | int | dist, |
| int | lin_speed | ||
| ) |
Drives straight.
| dist | the distance to travel [mm] |
| lin_speed | the speed to travel at [[mm/s] |
| int VWTurn | ( | int | angle, |
| int | ang_speed | ||
| ) |
Turns the vehicle on the spot.
| angle | the angle to turn to in Radians*100 (eg. 314 = Rotation Half Circle) |
| ang_speed | the speed to turn the angle [(rads/100)/s] |