MyroC Project
Package to control Scribbler 2 robots via Bluetooth
|
Header for a C-based, my-robot package for the Scribbler 2. More...
Go to the source code of this file.
Data Structures | |
struct | Pixel |
Struct for a pixel. More... | |
struct | Picture |
Struct for a picture object. More... | |
Macros | |
#define | ROBOT_CONNECTION_TYPE int |
Functions | |
ROBOT_CONNECTION_TYPE | rConnect (const char *address) |
connects program to Scribbler More... | |
void | rDisconnect () |
stop Scribbler motion and close Bluetooth More... | |
void | rSetConnection (ROBOT_CONNECTION_TYPE new_socket_num) |
set current connection to the socket number More... | |
void | rFinishProcessing () |
all timed motions/image displays completed, all robots stopped, and all robot Bluetooth connections closed More... | |
void | rSetVolume (char highMute) |
Set sound to high volume (H) or mute (M) highMute set volume of Scribbler. More... | |
void | rBeep (double duration, int frequency) |
Beeps with the given duration and frequency. More... | |
void | rBeep2 (double duration, int freq1, int freq2) |
Generates two notes for the prescribed duration. More... | |
void | rSetName (const char *name) |
Change name stored in the robot to the 16-byte name given. More... | |
char * | rGetName () |
Get the name of the robot. More... | |
void | rSetForwardness (char *direction) |
specifies which end of the Scribbler is considered the front More... | |
void | rSetForwardnessTxt (char *direction) |
alternative to rSetForwardness for compatibility with earlier MyroC More... | |
char * | rGetForwardness () |
Gets the forwardness of the Scribbler. More... | |
void | rSetLEDFront (int led) |
Set the front [fluke] LED on or off. More... | |
void | rSetLEDBack (double led) |
Set the the intensity of the back fluke LED. More... | |
double | rGetBattery () |
Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.1 volts. More... | |
int | rGetStall (int sampleSize) |
void | rSetBluetoothEcho (char onOff) |
Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes Fluke commands have varying lengths The fluke echos most, but not all, of the commands For many commands, the fluke also echos 11 bytes of sensor data. More... | |
void | rGetLightsAll (int lightSensors[3], int sampleSize) |
Get the average values of each of the three light sensors in an array. Values of each light sensor can somewhat (typically under 5%-10%). To even out variability, the sensor can be queried sampleSize times and an average obtained. More... | |
int | rGetLightTxt (const char *sensorName, int sampleSize) |
Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5%-10%). To even out variability, the sensor can be queried sampleSize times and an average obtained. More... | |
void | rGetIRAll (int irSensors[2], int sampleSize) |
Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sampleSize times and an average obtained. More... | |
int | rGetIRTxt (const char *sensorName, int sampleSize) |
Use specified IR sensor to determine if obstacle is present. Since values of each light sensor can vary substantially, the sensor can be queried sampleSize times and an average obtained. More... | |
void | rGetLine (int lineSensors[2], int sampleSize) |
Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sampleSize times and an average obtained. More... | |
void | rSetIRPower (int power) |
Set the amount of power for the dongle's IR sensors. More... | |
void | rGetObstacleAll (int obstSensors[3], int sampleSize) |
Get the average values of the three obstacle sensors in an array. Since readings of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), each sensor can be queried sampleSize times and an average obtained. More... | |
int | rGetObstacleTxt (const char *sensorName, int sampleSize) |
Get the average values of a specified obstacle (IR) sensor. Since values of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), the sensor can be queried sampleSize times and an average obtained. More... | |
void | rGetBrightAll (int brightSensors[3], int sampleSize) |
Read the Fluke's virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-10000), each sensor can be queried sampleSize times and an average obtained. More... | |
int | rGetBrightTxt (char *sensorName, int sampleSize) |
Reads one of the Fluke's virtual light sensors. Each sensor reports a total intensity in the left, middle, or right of the Fluke's camera Since values of each obstacle sensor can vary substantially (successive readings may differ by 5000-10000), the sensor can be queried sampleSize times and an average obtained. More... | |
void | rGetInfo (char *infoBuffer) |
returns information about the robot's dongle, firmware, and communication mode as a 60 character array in infoBuffer. More... | |
void | rTurnLeft (double speed, double time) |
turn Scribbler left for a specified time and speed More... | |
void | rTurnRight (double speed, double time) |
turn Scribbler right for a specified time and speed More... | |
void | rTurnSpeed (char *direction, double speed, double time) |
turn Scribbler in direction for a specified time and speed More... | |
void | rForward (double speed, double time) |
moves Scribbler forward for a specified time and speed More... | |
void | rFastForward (double time) |
moves Scribbler forward at the largest possible speed for a specified time More... | |
void | rBackward (double speed, double time) |
moves Scribbler backward for a specified time and speed More... | |
void | rMotors (double leftSpeed, double rightSpeed) |
move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-blocking) More... | |
void | rStop () |
directs robot to stop movement More... | |
void | rHardStop () |
cuts power to the motor of the robot More... | |
Picture | rTakePicture () |
Use the camera to take a photo. More... | |
void | rSavePicture (Picture *pic, char *filename) |
Save a Picture to a .jpeg. More... | |
Picture | rLoadPicture (char *filename) |
Load a picture from a .jpeg file. More... | |
void | rDisplayPicture (Picture *pic, double duration, const char *windowTitle) |
Display a picture in a new window. More... | |
void | rDisplayImageProcessingErrors () |
Turn on and off the printing of error messasge for image processing. More... | |
void | rWaitTimedImageDisplay () |
Wait until all timed, non-blocking image window timers are complete. More... | |
Header for a C-based, my-robot package for the Scribbler 2.
Revision History
Version 1.0 based on a C++ package by April O'Neill, David Cowden, Dilan Ustek, Erik Opavsky, and Henry M. Walker
Developers of the C package for Linux: Creators Version 2.0 (C functions for utilities,general,sensors,movement): Spencer Liberto Dilan Ustek Jordan Yuan Henry M. Walker Contributors Version 2.2-2.3: (C functions for image processing) Anita DeWitt Jason Liu Nick Knoebber Vasilisa Bashlovkina Revision for Version 2.4: (image row/column made to match matrix notation) Henry M. Walker
Revisions for Version 3.0 Henry M. Walker
C ported to Macintosh Linux/Mac differences required for connections — otherwise same code OpenGL used to display images, replacing ImageMagick same [new] code used for both Linux and Macintosh 1 process for robot control 1 process needed for each titled window (not each image, as in 2.2-2.4) Blocking options (negative duration parameter) utilize separate thread timer MyroC implementation files organized by user function as follows:
Revisions for Version 3.1 Henry M. Walker
Picture struct and image functions revised to allow 192 by 256 images from origial Fluke camera 266 x 427 low-resolution images from Fluke 2 (high-resolution (800 x 1280) too large for more than 2-4 variables on run-time stack) storage, retrieval, and display of any images up to 266 x 427
Revisions for Version 3.2 Henry M. Walker
Practical range of rBeep duration identified as <= 3.0014 seconds Image display and processing resolves several matters and adds functionality function rDisplayPicture completely rewritten over time OpenGL rountines had encountered troubles on Linux, specifically glutHideWindow() hid images, but could not be restored, with difficulties depending on the graphics card on Mac, High Sierra generated compile warnings and restricted threads that could display images function rDisplayImageProcessingErrors added function rWaitTimedImageDisplay updated substantially
Revisions for Version 3.3 Henry M. Walker
MyroC ported to Windows 10, in addition to Linux and Mac OS X Additional refinements text parameter for rGetLightTxt expanded to "Middle" as well as "Center"
This program and all MyroC software is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. Details may be found at http://creativecommons.org/licenses/by-nc-sa/3.0/us/
void rBackward | ( | double | speed, |
double | time | ||
) |
moves Scribbler backward for a specified time and speed
speed | the rate at which the robot should move backward linear range: -1.0 specifies move forward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move backward at full speed |
time | specifies the duration of the turn if negative: the robot starts backward (non-blocking) other processing proceeds, and the robot continues backward until given another motion command or disconnected (non-blocking) if zero: robot starts moving backward (non-blocking) other processing proceeds if positive: robot moves backward for the given duration, in seconds |
moves Scribbler backward for a specified time and speed
speed | the rate at which the robot should move backward linear range: -1.0 specifies move forward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move backward at full speed |
time | specifies the duration of the turn if negative: robot continues to go backward until given another motion command or disconnected (non-blocking) if nonnegative: robot moves backward for the given duration, in seconds |
void rBeep | ( | double | duration, |
int | frequency | ||
) |
Beeps with the given duration and frequency.
duration | length of note in seconds |
frequency | frequency of pitch in cycles per second (hertz) |
void rBeep2 | ( | double | duration, |
int | freq1, | ||
int | freq2 | ||
) |
Generates two notes for the prescribed duration.
duration | length of note in seconds |
freq1 | frequency of first pitch in cycles per second (hertz) |
freq2 | frequency of second pitch in cycles per second (hertz) |
ROBOT_CONNECTION_TYPE rConnect | ( | const char * | address | ) |
connects program to Scribbler
address | string, giving name of workstation port or a Scribbler Bluetooth designation |
several string formats are possible
Linux and Mac:
a communications port, such as "/dev/rfcomm0"
a Scribbler 2 fluke serial number, such as "245787"
a full IPRE serial number, such as "IPRE245787"
a Fluke 2 serial number (hexadecimal), such as "021F"
a full Fluke 2 serial number, such as "Fluke2-021F"
Linux only:
a MAC address, such as "00:1E:19:01:0E:13"
Mac only:
any substring of a complete device file name,
as long as the resulting device is unique
some possibilities include
a complete device file name, such as
uniqueness is ensured by requiring 4 hex digits
or 6 decimal digits
connects program to Scribbler
address | string, giving name of workstation port or a Scribbler Bluetooth designation |
several string formats are possible a communications port, such as "/dev/rfcomm0" a MAC address, such as "00:1E:19:01:0E:13" a Scribbler 2 fluke serial number, such as "245787" a full IPRE serial number, such as "IPRE245787" a Fluke 2 serial number (hexadecimal), such as "021F" a full Fluke 2 serial number, such as "Fluke2-021F"
address | string, giving name of workstation port or a Scribbler Bluetooth designation |
several string formats are possible a complete device file name, such as
Note: Connections via a MAC address, such as "00:1E:19:01:0E:13", is NOT available, for MyroC on Mac OS X, since AF_BLUETOOTH socket types are not defined in /usr/include/sys/socket.h Type man socket for additional information
void rDisconnect | ( | ) |
stop Scribbler motion and close Bluetooth
void rDisplayImageProcessingErrors | ( | ) |
Turn on and off the printing of error messasge for image processing.
void rDisplayPicture | ( | Picture * | pic, |
double | duration, | ||
const char * | windowTitle | ||
) |
Display a picture in a new window.
pic | pointer to an RGB picture struct from Scribbler 2 camera |
duration | if duration > 0, operation is blocking if duration <= 0, operation is non-blocking for duration != 0, picture displayed for abs(duration) seconds or until picture closed manually or until the program terminates if duration == 0, picture displayed until closed manually |
windowTitle | The title of the window that appears. white spaces will be replaced with underscores. |
Display a picture.
pic | pointer to an RGB picture struct from Scribbler 2 camera |
duration | if duration > 0, operation is blocking if duration <= 0, operation is non-blocking for duration != 0, picture displayed for abs(duration) seconds or until picture closed manually or until the program terminates if duration == 0, picture displayed until closed manually |
windowTitle | The title of the window that appears. white spaces will be replaced with underscores. |
void rFastForward | ( | double | time | ) |
moves Scribbler forward at the largest possible speed for a specified time
time | specifies the duration of the turn if negative: the robot starts forward (non-blocking) other processing proceeds, and the robot continues forward until given another motion command or disconnected (non-blocking) if zero: robot starts moving forward (non-blocking); other processing proceeds if positive: robot moves forward for the given duration, in seconds |
moves Scribbler forward at the largest possible speed for a specified time
time | specifies the duration of movement if negative: robot continues to move forward until given another motion command or disconnected (non-blocking) if nonnegative: robot moves forward for the given duration, in seconds |
void rFinishProcessing | ( | ) |
all timed motions/image displays completed, all robots stopped, and all robot Bluetooth connections closed
same result as rDisconnect for all robots plus rComleteImageDisplay
produces same result as calling rDisconnect for all robots and also calling rComleteImageDisplay
void rForward | ( | double | speed, |
double | time | ||
) |
moves Scribbler forward for a specified time and speed
speed | the rate at which the robot should move forward linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forward at full speed |
time | specifies the duration of the turn if negative: the robot starts forward (non-blocking) other processing proceeds, and the robot continues forward until given another motion command or disconnected (non-blocking) if zero: robot starts moving forward (non-blocking); other processing proceeds if positive: robot moves forward for the given duration, in seconds |
moves Scribbler forward for a specified time and speed
speed | the rate at which the robot should move forward linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forward at full speed |
time | specifies the duration of movement if negative: robot continues to move forward until given another motion command or disconnected (non-blocking) if nonnegative: robot moves forward for the given duration, in seconds |
double rGetBattery | ( | ) |
Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.1 volts.
Get the current voltage from the Scribbler batteries; Maximum charge from 6 batteries could be up to 6 volts; Manufacturer suggests batteries should be changed below 4.1 volts.
void rGetBrightAll | ( | int | brightSensors[3], |
int | sampleSize | ||
) |
Read the Fluke's virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-10000), each sensor can be queried sampleSize times and an average obtained.
brightSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
Read the Fluke's virtual light sensors. Since readings of each brightness sensor can vary substantially (successive readings may differ by 5000-10000), each sensor can be queried sampleSize times and an average obtained.
brightSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
int rGetBrightTxt | ( | char * | sensorName, |
int | sampleSize | ||
) |
Reads one of the Fluke's virtual light sensors. Each sensor reports a total intensity in the left, middle, or right of the Fluke's camera Since values of each obstacle sensor can vary substantially (successive readings may differ by 5000-10000), the sensor can be queried sampleSize times and an average obtained.
sensorName | name of the bright sensor |
sampleSize | how many readings are taken for the sensor |
sensorName | name of the bright sensor |
sampleSize | how many readings are taken for the sensor |
char* rGetForwardness | ( | ) |
Gets the forwardness of the Scribbler.
Gets the forwardness of the Scribbler
void rGetInfo | ( | char * | infoBuffer | ) |
returns information about the robot's dongle, firmware, and communication mode as a 60 character array in infoBuffer.
infoBuffer | a pre-defined, 60-character array |
returns information about the robot's dongle, firmware, and communication mode as a 60 character array in infoBuffer.
infoBuffer | a pre-defined, 60-character array |
void rGetIRAll | ( | int | irSensors[2], |
int | sampleSize | ||
) |
Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sampleSize times and an average obtained.
irSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
Get an array of true/false values regarding the presence of obstacle based on the average values of each of the three IR sensors. Since readings of each light sensor can vary substantially, each sensor can be queried sampleSize times and an average obtained.
irSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
int rGetIRTxt | ( | const char * | sensorName, |
int | sampleSize | ||
) |
Use specified IR sensor to determine if obstacle is present. Since values of each light sensor can vary substantially, the sensor can be queried sampleSize times and an average obtained.
sensorName | name of the light sensor |
sampleSize | how many readings are taken for the sensor |
sensorName | name of the light sensor |
sampleSize | how many readings are taken for the sensor |
void rGetLightsAll | ( | int | lightSensors[3], |
int | sampleSize | ||
) |
Get the average values of each of the three light sensors in an array. Values of each light sensor can somewhat (typically under 5%-10%). To even out variability, the sensor can be queried sampleSize times and an average obtained.
lightSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
lightSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
int rGetLightTxt | ( | const char * | sensorName, |
int | sampleSize | ||
) |
Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5%-10%). To even out variability, the sensor can be queried sampleSize times and an average obtained.
sensorName | name of the light sensor |
sampleSize | how many readings are taken for the sensor |
Get the average values of a specified light sensor. Values of each light sensor can somewhat (typically under 5%-10%). To even out variability, the sensor can be queried sampleSize times and an average obtained.
sensorName | name of the light sensor |
sampleSize | how many readings are taken for the sensor |
void rGetLine | ( | int | lineSensors[2], |
int | sampleSize | ||
) |
Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sampleSize times and an average obtained.
lineSensors | array to store line values detected |
sampleSize | how many readings are taken for each sensor |
Use Scribbler 2 line sensors of Scribbler to check for a black line on a white surface under the robot. Since values of each light sensor can vary substantially, the sensor can be queried sampleSize times and an average obtained.
lineSensors | array to store line values detected |
sampleSize | how many readings are taken for each sensor |
char* rGetName | ( | ) |
Get the name of the robot.
void rGetObstacleAll | ( | int | obstSensors[3], |
int | sampleSize | ||
) |
Get the average values of the three obstacle sensors in an array. Since readings of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), each sensor can be queried sampleSize times and an average obtained.
obstSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
obstSensors | array to store intensity values |
sampleSize | how many readings are taken for each sensor |
int rGetObstacleTxt | ( | const char * | sensorName, |
int | sampleSize | ||
) |
Get the average values of a specified obstacle (IR) sensor. Since values of each obstacle sensor can vary substantially (successive readings may differ by several hundred or more), the sensor can be queried sampleSize times and an average obtained.
sensorName | name of the obstacle sensor |
sampleSize | how many readings are taken for the sensor |
sensorName | name of the obstacle sensor |
sampleSize | how many readings are taken for the sensor |
int rGetStall | ( | int | sampleSize | ) |
Determine if robot has stalled
MyroC Reference Manual (http://wiki.roboteducation.org/Myro_Reference_Manual) states "Every time you issue a move command, the stall sensor resets, and it needs to wait a short time to see whether the motors are stalled. This means that the sensor won't give accurate results if you test it too soon after the robot starts to move."
In practice, it may take 0.5-1.0 seconds for rGetStall to sense the robot is stalled
sampleSize | how many readings are taken for each sensor |
Determine if robot has stalled
MyroC Reference Manual (http://wiki.roboteducation.org/Myro_Reference_Manual) states Every time you issue a move command, the stall sensor resets, and it needs to wait a short time to see whether the motors are stalled. This means that the sensor won't give accurate results if you test it too soon after the robot starts to move.
In practice, it may take 0.5-1.0 seconds for rGetStall to sense the robot is stalled
sampleSize | how many readings are taken for each sensor |
void rHardStop | ( | ) |
cuts power to the motor of the robot
cuts power to the motor of the robot
Picture rLoadPicture | ( | char * | filename | ) |
Load a picture from a .jpeg file.
filename | the name of the file |
filename | the name of the file |
void rMotors | ( | double | leftSpeed, |
double | rightSpeed | ||
) |
move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-blocking)
leftSpeed | the rate at which the left wheel should turn linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forwardward at full speed |
rightSpeed | the rate at which the right wheel should turn linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forward at full speed |
move robot with given speeds for the left and right motors continues until given another motion command or disconnected (non-blocking)
leftSpeed | the rate at which the left wheel should turn linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forwardward at full speed |
rightSpeed | the rate at which the right wheel should turn linear range: -1.0 specifies move backward at full speed 0.0 specifies no forward/backward movement 1.0 specifies move forward at full speed |
void rSavePicture | ( | Picture * | pic, |
char * | filename | ||
) |
Save a Picture to a .jpeg.
pic | pointer to an RGB picture struct from Scribbler 2 camera |
filename | the name of the file |
This section contains functions for taking and manipulating images All images are constrained with height <= 266 and width <= 427
images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-resolution images for the Fluke 2 are 266 by 427 high-resolution images for the fluke 2 are 800 by 1280 (not supported)
Bluetooth communication constrains the time required for the Fluke to take a picture Typical times: original fluke: 2- 4 seconds Fluke 2 (low res): 4- 6 seconds Fluke 2 (high res): 25-30 seconds
BASED ON TIMINGS AND MEMORY CONSIDERATIONS, Myro C ALLOWS ONLY LOW RESOLUTION IMAGES
the Picture struct allows direct access to Pixel data Pictures can be saved and loaded as .jpeg files
pic | pointer to an RGB picture struct from Scribbler 2 camera |
filename | the name of the file |
this code is a slightly modified version of write_JPEG_file(char *, int) from example.c from the libjpeg.v8d library directory.
void rSetBluetoothEcho | ( | char | onOff | ) |
Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes
Fluke commands have varying lengths
The fluke echos most, but not all, of the commands
For many commands, the fluke also echos 11 bytes of sensor data.
onOff | char 'y' enables printing of Bluetooth communications char 'n' disables printng other character values ignored |
Turn on and off the printing transmission and echong of Bluetooth transmissions All robot commands involve the transmission of a command over Bluetooth Scribbler commands are always 9 bytes
Fluke commands have varying lengths
The fluke echos most, but not all, of the commands
For many commands, the fluke also echos 11 bytes of sensor data.
onOff | char 'y' enables echoing char 'n' disables echoing other character values ignored |
void rSetConnection | ( | ROBOT_CONNECTION_TYPE | new_socket_num | ) |
set current connection to the socket number
new_socket_num | the number of an open socket for communication |
set current connection to the socket number
new_socket_num | the number of an open socket for communication |
void rSetForwardness | ( | char * | direction | ) |
specifies which end of the Scribbler is considered the front
direction | identifies front direction |
specifies which end of the Scribbler is considered the front
direction | identifies front direction |
void rSetForwardnessTxt | ( | char * | direction | ) |
alternative to rSetForwardness for compatibility with earlier MyroC
alternative to rSetForwardness for compatibility with earlier MyroC
void rSetIRPower | ( | int | power | ) |
Set the amount of power for the dongle's IR sensors.
power | the desired power level for the IR sensors |
power | the desired power level for the IR sensors |
void rSetLEDBack | ( | double | led | ) |
Set the the intensity of the back fluke LED.
led | intensity of the LED values between 0 and 1 provide a range of brightness from off to full intensity values bigger than 1 are treated as 1 (full brightness) values less than 0 are treated as 0 (LED off) |
Set the the intensity of the back fluke LED,
led | intensity of the LED values between 0 and 1 provide a range of brightness from off to full intensity values bigger than 1 are treated as 1 (full brightness) values less than 0 are treated as 0 (LED off). |
void rSetLEDFront | ( | int | led | ) |
Set the front [fluke] LED on or off.
led | value 1 turns on LED value 0 turns off LED |
Set the front [fluke] LED on or off
led | value 1 turns on LED value 0 turns off LED |
void rSetName | ( | const char * | name | ) |
Change name stored in the robot to the 16-byte name given.
name | specifies new name of robot if < 16 bytes given, name is filled with null characters if >= 16 bytes given, name is truncated to 15 bytes plus null Change name stored in the robot to the 16-byte name given |
name | specifies new name of robot if < 16 bytes given, name is filled with null characters if >= 16 bytes given, name is truncated to 15 bytes plus null |
void rSetVolume | ( | char | highMute | ) |
Set sound to high volume (H) or mute (M) highMute set volume of Scribbler.
Set sound to high volume (H) or mute (M) highMute set volume of Scribbler.
void rStop | ( | ) |
directs robot to stop movement
directs robot to stop movement
Picture rTakePicture | ( | ) |
Use the camera to take a photo.
This section contains functions for taking and manipulating images All images are constrained with height <= 266 and width <= 427
images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-resolution images for the Fluke 2 are 266 by 427 high-resolution images for the fluke 2 are 800 by 1280
Bluetooth communication constrains the time required for the Fluke to take a picture Typical times: original fluke: 2- 4 seconds Fluke 2 (low res): 4- 6 seconds Fluke 2 (high res): 25-30 seconds
BASED ON TIMINGS AND MEMORY CONSIDERATIONS, Myro C ALLOWS ONLY LOW RESOLUTION IMAGES
the Picture struct allows direct access to Pixel data Pictures can be saved and loaded as .jpeg files
This section contains functions for taking and manipulating images All images are constrained with height <= 266 and width <= 427
images from robot cameras have varying sizes, depending on the Fluke images for the original Fluke are 192 (height) by 256 (width) low-resolution images for the Fluke 2 are 266 by 427 high-resolution images for the fluke 2 are 800 by 1280
Bluetooth communication constrains the time required for the Fluke to take a picture Typical times: original fluke: 2- 4 seconds Fluke 2 (low res): 4- 6 seconds Fluke 2 (high res): 25-30 seconds
BASED ON TIMINGS AND MEMORY CONSIDERATIONS, Myro C ALLOWS ONLY LOW RESOLUTION IMAGES
the Picture struct allows direct access to Pixel data Pictures can be saved and loaded as .jpeg files
void rTurnLeft | ( | double | speed, |
double | time | ||
) |
turn Scribbler left for a specified time and speed
speed | the rate at which the robot should move left linear range: -1.0 specifies right turn at full speed 0.0 specifies no turn 1.0 specifies left turn at full speed |
time | specifies the duration of the turn if negative: the robot starts to turn (non-blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-blocking) if zero: robot starts turning (non-blocking); other processing proceeds if positive: robot turns for the given duration, in seconds |
turn Scribbler left for a specified time and speed
speed | the rate at which the robot should move left linear range: -1.0 specifies right turn at full speed 0.0 specifies no turn 1.0 specifies left turn at full speed |
time | specifies the duration of the turn if negative: robot continues to turn until given another motion command or disconnected (non-blocking) if nonnegative: robot turns for the given duration, in seconds |
void rTurnRight | ( | double | speed, |
double | time | ||
) |
turn Scribbler right for a specified time and speed
speed | the rate at which the robot should move right linear range: -1.0 specifies left turn at full speed 0.0 specifies no turn 1.0 specifies right turn at full speed |
time | specifies the duration of the turn if negative: the robot starts to turn (non-blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-blocking) if zero: robot starts turning (non-blocking); other processing proceeds if positive: robot turns for the given duration, in seconds if nonnegative: robot turns for the given duration, in seconds |
turn Scribbler right for a specified time and speed
speed | the rate at which the robot should move right linear range: -1.0 specifies left turn at full speed 0.0 specifies no turn 1.0 specifies right turn at full speed |
time | specifies the duration of the turn if negative: robot continues to turn until given another motion command or disconnected (non-blocking) if nonnegative: robot turns for the given duration, in seconds |
void rTurnSpeed | ( | char * | direction, |
double | speed, | ||
double | time | ||
) |
turn Scribbler in direction for a specified time and speed
direction | direction of turn, based on looking from the center of the robot and facing forward |
speed | the rate at which the robot should move forward linear range: -1.0 specifies turn at full speed 0.0 specifies no turn 1.0 specifies turn at full speed |
time | specifies the duration of the turn if negative: the robot starts to turn (non-blocking) other processing proceeds, and the robot continues to turn until given another motion command or disconnected (non-blocking) if zero: robot starts turning (non-blocking); other processing proceeds if positive: robot turns for the given duration, in seconds |
turn Scribbler in direction for a specified time and speed
direction | direction of turn, based on looking from the center of the robot and facing forward |
speed | the rate at which the robot should move forward linear range: -1.0 specifies turn at full speed 0.0 specifies no turn 1.0 specifies turn at full speed |
time | specifies the duration of the turn if negative: robot continues to turn until given another motion command or disconnected if nonnegative: robot turns for the given duration, in seconds |
void rWaitTimedImageDisplay | ( | ) |
Wait until all timed, non-blocking image window timers are complete.