PC side Elisa-3 library
|
#include <stdio.h>
#include <sys/types.h>
#include <math.h>
#include <unistd.h>
#include "usb-comm.h"
Go to the source code of this file.
Functions | |
void | startCommunication (int *robotAddr, int numRobots) |
To be called once at the beginning, it init the USB communication with the RF module that is responsible to send data to the robots and initialize the list of robots to be controlled; max number of simultaneous robots is 100. | |
void | stopCommunication () |
To be called once at the end, it closes the USB communication. | |
void | setLeftSpeed (int robotAddr, char value) |
Set the left speed of the robot. | |
void | setRightSpeed (int robotAddr, char value) |
Set the right speed of the robot. | |
void | setLeftSpeedForAll (char *value) |
Set the left speed of all the robots specified in the list. | |
void | setRightSpeedForAll (char *value) |
Set the right speed of all the robots specified in the list. | |
void | setRed (int robotAddr, unsigned char value) |
Set the red intensity of the RGB led on the robot. | |
void | setGreen (int robotAddr, unsigned char value) |
Set the green intensity of the RGB led on the robot. | |
void | setBlue (int robotAddr, unsigned char value) |
Set the blue intensity of the RGB led on the robot. | |
void | setRedForAll (unsigned char *value) |
Set the red intensity of the RGB led of all the robots specified in the list. | |
void | setGreenForAll (unsigned char *value) |
Set the green intensity of the RGB led of all the robots specified in the list. | |
void | setBlueForAll (unsigned char *value) |
Set the blue intensity of the RGB led of all all the robots specified in the list. | |
void | turnOnFrontIRs (int robotAddr) |
Turn on both the front IRs transmitter on the robot. | |
void | turnOffFrontIRs (int robotAddr) |
Turn off both the front IRs transmitter on the robot. | |
void | turnOnBackIR (int robotAddr) |
Turn on the back IR transmitter on the robot. | |
void | turnOffBackIR (int robotAddr) |
Turn off the back IR transmitter on the robot. | |
void | turnOnAllIRs (int robotAddr) |
Turn on all the 3 IRs transmitter on the robot. | |
void | turnOffAllIRs (int robotAddr) |
Turn off all the 3 IRs transmitter on the robot. | |
void | enableTVRemote (int robotAddr) |
Enable the reception of commands from a TV remote. | |
void | disableTVRemote (int robotAddr) |
Disable the reception of commands from a TV remote. | |
void | enableSleep (int robotAddr) |
Put the robot in sleep mode (energy saving mode). | |
void | disableSleep (int robotAddr) |
Put the robot in normal mode (out of sleep). | |
void | calibrateSensors (int robotAddr) |
Calibrate the sensors of the robot (proximity, accelerometer). | |
void | calibrateSensorsForAll () |
Calibrate the sensors (proximity, accelerometer) of all the robots specified in the list. | |
void | enableObstacleAvoidance (int robotAddr) |
Enable the onboard obstacle avoidance. | |
void | disableObstacleAvoidance (int robotAddr) |
Disable the onboard obstacle avoidance. | |
void | enableCliffAvoidance (int robotAddr) |
Enable the onboard cliff avoidance. | |
void | disableCliffAvoidance (int robotAddr) |
Disable the onboard cliff avoidance. | |
void | setRobotAddress (int robotIndex, int robotAddr) |
Set the address of a robot related to a particular index, the index must be in the range of the robot list size. | |
void | setRobotAddresses (int *robotAddr, int numRobots) |
Set the addresses of the robots that need to be controlled; max number of simultaneous robots is 100. | |
unsigned int | getProximity (int robotAddr, int proxId) |
Request one of the proximity sensors value of the robot. | |
unsigned int | getProximityAmbient (int robotAddr, int proxId) |
Request one of the ambient value (from proximity sensors) of the robot. | |
unsigned int | getGround (int robotAddr, int groundId) |
Request one of the ground sensors value of the robot. | |
unsigned int | getGroundAmbient (int robotAddr, int groundId) |
Request one of the ambient value (from ground sensors) of the robot. | |
void | getAllProximity (int robotAddr, unsigned int *proxArr) |
Request all the proximity sensors values at once. | |
void | getAllProximityAmbient (int robotAddr, unsigned int *proxArr) |
Request all the ambient values (from proximity sensors) at once. | |
void | getAllGround (int robotAddr, unsigned int *groundArr) |
Request all the ground sensors values at once. | |
void | getAllGroundAmbient (int robotAddr, unsigned int *groundArr) |
Request all the ambient values (from ground sensors) at once. | |
void | getAllProximityFromAll (unsigned int proxArr[][8]) |
Request all the proximity sensors values of all the robots specified in the list. | |
void | getAllProximityAmbientFromAll (unsigned int proxArr[][8]) |
Request all the ambient values (from proximity sensors) of all the robots specified in the list. | |
void | getAllGroundFromAll (unsigned int groundArr[][4]) |
Request all the ground sensors values of all the robots specified in the list. | |
void | getAllGroundAmbientFromAll (unsigned int groundArr[][4]) |
Request all the ambient values (from ground sensors) of all the robots specified in the list. | |
unsigned int | getBatteryAdc (int robotAddr) |
Request the raw battery value, it contains the sampled value of the battery. | |
unsigned int | getBatteryPercent (int robotAddr) |
Request the charge percentage of the battery. | |
signed int | getAccX (int robotAddr) |
Request the raw value of the accelerometer x axis. | |
signed int | getAccY (int robotAddr) |
Request the raw value of the accelerometer y axis. | |
signed int | getAccZ (int robotAddr) |
Request the raw value of the accelerometer z axis. | |
unsigned char | getSelector (int robotAddr) |
Request the selector position. | |
unsigned char | getTVRemoteCommand (int robotAddr) |
Request last command received from the TV remote. | |
void | setSmallLed (int robotAddr, int ledId, int state) |
Set a new stato (on or off) for the small green leds around the robot. | |
void | turnOffSmallLeds (int robotAddr) |
Turn off all the small green leds around the robot. | |
void | turnOnSmallLeds (int robotAddr) |
Turn on all the small green leds around the robot. | |
signed int | getOdomTheta (int robotAddr) |
Request the current orientation of the robot computed from the measured speed of the motors. | |
signed int | getOdomXpos (int robotAddr) |
Request the current position (x component) of the robot computed from the measured speed of the motors. | |
signed int | getOdomYpos (int robotAddr) |
Request the current position (y component) of the robot computed from the measured speed of the motors. | |
int | getVerticalAngle (int robotAddr) |
Request the current orientation of the robot given by the accelerometer. This function is usable only if the robot is moving vertically. | |
void | startOdometryCalibration (int robotAddr) |
Start the odometry calibration. | |
void | transferData () |
This function need to be called periodically (as fast as possible) in order to exchange data with the robots. | |
void | stopTransferData () |
This function stop the transmission of the packets to the robots. | |
void | resumeTransferData () |
This function resume the transmission of the packets to the robots. | |
unsigned char | robotIsCharging (int robotAddr) |
Tell whether the robot is charging or not. | |
unsigned char | robotIsCharged (int robotAddr) |
Tell whether the robot is completely charged or not. | |
unsigned char | buttonIsPressed (int robotAddr) |
Tell whether the button on the back side of the robot is pressed or not. | |
void | resetFlagTX (int robotAddr) |
Reset all the flags sent to the robot. | |
unsigned char | getFlagTX (int robotAddr, int flagInd) |
Request the current flags value (raw) sent to the robot. | |
unsigned char | getFlagRX (int robotAddr) |
Request the current flags value (raw) received from the robot. | |
signed long int | getLeftMotSteps (int robotAddr) |
Request the current raw value of the left motor steps (sum of the measured speed). | |
signed long int | getRightMotSteps (int robotAddr) |
Request the current raw value of the right motor steps (sum of the measured speed). | |
double | getRFQuality (int robotAddr) |
Request the current percentage of failed trasnfers in the last 5 seconds. | |
void | resetMessageIsSentFlag (int robotAddr) |
Reset the flag indicating that the last modified packet is sent to the robot; it should be called before using "messageIsSent". | |
unsigned char | messageIsSent (int robotAddr) |
Request if the last modified packet is sent to the robot; this function is thought to be used in polling mode (continue to check whether the message is sent untill it is actually sent). Before the polling the function "resetMessageIsSentFlag" need to be called. It can be used for both check whether the robots received the new messages and to know when new data from the robots are available. | |
unsigned char | waitForMessageTransmission (int robotAddr, unsigned long us) |
Wait for the message to be actually sent to the robot; if the robot isn't reachable (out of range, discharged, ...) then the function will exit after the amount of time specified as parameter even if the robot doesn't receive the data. | |
void | setCompletePacket (int robotAddr, char red, char green, char blue, char flags[2], char left, char right, char leds) |
Set all the values of a robot at one time. | |
void | setCompletePacketForAll (int *robotAddr, char *red, char *green, char *blue, char flags[][2], char *left, char *right, char *leds) |
Set all the values of all the robots specified in the list. | |
unsigned char | waitForUpdate (int robotAddr, unsigned long us) |
Wait for updated data coming from the robot; if the robot isn't reachable (out of range, discharged, ...) then the function will exit after the amount of time specified as parameter even if no data are received. this function can be used also to check whether a message is successfully sent to a robot or not. | |
unsigned char | sendMessageToRobot (int robotAddr, char red, char green, char blue, char flags[2], char left, char right, char leds, unsigned long us) |
Send a message to a particular robot resetting the list of robots to a single one (all previous address set with "startCommunication" will be lost). |
unsigned char buttonIsPressed | ( | int | robotAddr | ) |
Tell whether the button on the back side of the robot is pressed or not.
robotAddr | the address of the robot from which receive data. |
void calibrateSensors | ( | int | robotAddr | ) |
Calibrate the sensors of the robot (proximity, accelerometer).
robotAddr | the address of the robot for which to change the packet. |
void calibrateSensorsForAll | ( | ) |
Calibrate the sensors (proximity, accelerometer) of all the robots specified in the list.
void disableCliffAvoidance | ( | int | robotAddr | ) |
Disable the onboard cliff avoidance.
robotAddr | the address of the robot for which to change the packet. |
void disableObstacleAvoidance | ( | int | robotAddr | ) |
Disable the onboard obstacle avoidance.
robotAddr | the address of the robot for which to change the packet. |
void disableSleep | ( | int | robotAddr | ) |
Put the robot in normal mode (out of sleep).
robotAddr | the address of the robot for which to change the packet. |
void disableTVRemote | ( | int | robotAddr | ) |
Disable the reception of commands from a TV remote.
robotAddr | the address of the robot for which to change the packet. |
void enableCliffAvoidance | ( | int | robotAddr | ) |
Enable the onboard cliff avoidance.
robotAddr | the address of the robot for which to change the packet. |
void enableObstacleAvoidance | ( | int | robotAddr | ) |
Enable the onboard obstacle avoidance.
robotAddr | the address of the robot for which to change the packet. |
void enableSleep | ( | int | robotAddr | ) |
Put the robot in sleep mode (energy saving mode).
robotAddr | the address of the robot for which to change the packet. |
void enableTVRemote | ( | int | robotAddr | ) |
Enable the reception of commands from a TV remote.
robotAddr | the address of the robot for which to change the packet. |
signed int getAccX | ( | int | robotAddr | ) |
Request the raw value of the accelerometer x axis.
robotAddr | the address of the robot from which receive data. |
signed int getAccY | ( | int | robotAddr | ) |
Request the raw value of the accelerometer y axis.
robotAddr | the address of the robot from which receive data. |
signed int getAccZ | ( | int | robotAddr | ) |
Request the raw value of the accelerometer z axis.
robotAddr | the address of the robot from which receive data. |
void getAllGround | ( | int | robotAddr, |
unsigned int * | groundArr | ||
) |
Request all the ground sensors values at once.
robotAddr | the address of the robot from which receive data. |
groundArr | destination array for the ground values (size must be 4). |
void getAllGroundAmbient | ( | int | robotAddr, |
unsigned int * | groundArr | ||
) |
Request all the ambient values (from ground sensors) at once.
robotAddr | the address of the robot from which receive data. |
groundArr | destination array for the ambient values (size must be 4). |
void getAllGroundAmbientFromAll | ( | unsigned int | groundArr[][4] | ) |
Request all the ambient values (from ground sensors) of all the robots specified in the list.
groundArr | destination matrix for the ambient values (size must be list_size x 4). |
void getAllGroundFromAll | ( | unsigned int | groundArr[][4] | ) |
Request all the ground sensors values of all the robots specified in the list.
groundArr | destination matrix for the ground values (size must be list_size x 4). |
void getAllProximity | ( | int | robotAddr, |
unsigned int * | proxArr | ||
) |
Request all the proximity sensors values at once.
robotAddr | the address of the robot from which receive data. |
proxArr | destination array for the proximity values (size must be 8). |
void getAllProximityAmbient | ( | int | robotAddr, |
unsigned int * | proxArr | ||
) |
Request all the ambient values (from proximity sensors) at once.
robotAddr | the address of the robot from which receive data. |
proxArr | destination array for the ambient values (size must be 8). |
void getAllProximityAmbientFromAll | ( | unsigned int | proxArr[][8] | ) |
Request all the ambient values (from proximity sensors) of all the robots specified in the list.
proxArr | destination matrix for the ambient values (size must be list_size x 8). |
void getAllProximityFromAll | ( | unsigned int | proxArr[][8] | ) |
Request all the proximity sensors values of all the robots specified in the list.
proxArr | destination matrix for the proximity values (size must be list_size x 8). |
unsigned int getBatteryAdc | ( | int | robotAddr | ) |
Request the raw battery value, it contains the sampled value of the battery.
robotAddr | the address of the robot from which receive data. |
unsigned int getBatteryPercent | ( | int | robotAddr | ) |
Request the charge percentage of the battery.
robotAddr | the address of the robot from which receive data. |
unsigned char getFlagRX | ( | int | robotAddr | ) |
Request the current flags value (raw) received from the robot.
robotAddr | the address of the robot from which receive data. |
unsigned char getFlagTX | ( | int | robotAddr, |
int | flagInd | ||
) |
Request the current flags value (raw) sent to the robot.
robotAddr | the address of the robot from which receive data. |
flagInd | 0 or 1 |
unsigned int getGround | ( | int | robotAddr, |
int | groundId | ||
) |
Request one of the ground sensors value of the robot.
robotAddr | the address of the robot from which receive data. |
groundId | from 0 to 3 (0 is on the left side, then increases clockwise). |
unsigned int getGroundAmbient | ( | int | robotAddr, |
int | groundId | ||
) |
Request one of the ambient value (from ground sensors) of the robot.
robotAddr | the address of the robot from which receive data. |
groundId | from 0 to 3 (0 is on the left side, then increases clockwise). |
signed long int getLeftMotSteps | ( | int | robotAddr | ) |
Request the current raw value of the left motor steps (sum of the measured speed).
robotAddr | the address of the robot from which receive data. |
signed int getOdomTheta | ( | int | robotAddr | ) |
Request the current orientation of the robot computed from the measured speed of the motors.
robotAddr | the address of the robot from which receive data. |
signed int getOdomXpos | ( | int | robotAddr | ) |
Request the current position (x component) of the robot computed from the measured speed of the motors.
robotAddr | the address of the robot from which receive data. |
signed int getOdomYpos | ( | int | robotAddr | ) |
Request the current position (y component) of the robot computed from the measured speed of the motors.
robotAddr | the address of the robot from which receive data. |
unsigned int getProximity | ( | int | robotAddr, |
int | proxId | ||
) |
Request one of the proximity sensors value of the robot.
robotAddr | the address of the robot from which receive data. |
proxId | from 0 to 7 (0 is in front, then increases clockwise). |
unsigned int getProximityAmbient | ( | int | robotAddr, |
int | proxId | ||
) |
Request one of the ambient value (from proximity sensors) of the robot.
robotAddr | the address of the robot from which receive data. |
proxId | from 0 to 7 (0 is in front, then increases clockwise). |
double getRFQuality | ( | int | robotAddr | ) |
Request the current percentage of failed trasnfers in the last 5 seconds.
robotAddr | the address of the robot from which receive data. |
signed long int getRightMotSteps | ( | int | robotAddr | ) |
Request the current raw value of the right motor steps (sum of the measured speed).
robotAddr | the address of the robot from which receive data. |
unsigned char getSelector | ( | int | robotAddr | ) |
Request the selector position.
robotAddr | the address of the robot from which receive data. |
unsigned char getTVRemoteCommand | ( | int | robotAddr | ) |
Request last command received from the TV remote.
robotAddr | the address of the robot from which receive data. |
int getVerticalAngle | ( | int | robotAddr | ) |
Request the current orientation of the robot given by the accelerometer. This function is usable only if the robot is moving vertically.
robotAddr | the address of the robot from which receive data. |
unsigned char messageIsSent | ( | int | robotAddr | ) |
Request if the last modified packet is sent to the robot; this function is thought to be used in polling mode (continue to check whether the message is sent untill it is actually sent). Before the polling the function "resetMessageIsSentFlag" need to be called. It can be used for both check whether the robots received the new messages and to know when new data from the robots are available.
robotAddr | the address of the robot from which receive data. |
void resetFlagTX | ( | int | robotAddr | ) |
Reset all the flags sent to the robot.
robotAddr | the address of the robot for which to change data. |
void resetMessageIsSentFlag | ( | int | robotAddr | ) |
Reset the flag indicating that the last modified packet is sent to the robot; it should be called before using "messageIsSent".
robotAddr | the address of the robot for which to change data. |
void resumeTransferData | ( | ) |
This function resume the transmission of the packets to the robots.
unsigned char robotIsCharged | ( | int | robotAddr | ) |
Tell whether the robot is completely charged or not.
robotAddr | the address of the robot from which receive data. |
unsigned char robotIsCharging | ( | int | robotAddr | ) |
Tell whether the robot is charging or not.
robotAddr | the address of the robot from which receive data. |
unsigned char sendMessageToRobot | ( | int | robotAddr, |
char | red, | ||
char | green, | ||
char | blue, | ||
char | flags[2], | ||
char | left, | ||
char | right, | ||
char | leds, | ||
unsigned long | us | ||
) |
Send a message to a particular robot resetting the list of robots to a single one (all previous address set with "startCommunication" will be lost).
robotAddr | the address of the robot for which to change data. |
red,green,red | RGB channels intensity, range is between 0 (led off) to 100 (max power). |
flags | raw flag bytes: byte0:
|
left,right | left and right speed, range is -128..127. |
leds | raw byte value for small green leds (bit0=0/1 turn off/on led0, bit1=0/1 turn off/on led1, ...). |
us | function timeout given in microseconds |
void setBlue | ( | int | robotAddr, |
unsigned char | value | ||
) |
Set the blue intensity of the RGB led on the robot.
robotAddr | the address of the robot for which to change the packet. |
value | The intensity, range is between 0 (led off) to 100 (max power). |
void setBlueForAll | ( | unsigned char * | value | ) |
Set the blue intensity of the RGB led of all all the robots specified in the list.
value | The intensity array, range is between 0 (led off) to 100 (max power). |
void setCompletePacket | ( | int | robotAddr, |
char | red, | ||
char | green, | ||
char | blue, | ||
char | flags[2], | ||
char | left, | ||
char | right, | ||
char | leds | ||
) |
Set all the values of a robot at one time.
robotAddr | the address of the robot for which to change data. |
red,green,red | RGB channels intensity, range is between 0 (led off) to 100 (max power). |
flags | raw flag bytes: byte0:
|
left,right | left and right speed, range is -128..127. |
leds | raw byte value for small green leds (bit0=0/1 turn off/on led0, bit1=0/1 turn off/on led1, ...). |
void setCompletePacketForAll | ( | int * | robotAddr, |
char * | red, | ||
char * | green, | ||
char * | blue, | ||
char | flags[][2], | ||
char * | left, | ||
char * | right, | ||
char * | leds | ||
) |
Set all the values of all the robots specified in the list.
robotAddr | array the addresses of the robots for which to change data. |
red,green,red | arrays RGB channels intensity, range is between 0 (led off) to 100 (max power). |
flags | array raw flag bytes: byte0:
|
left,right | arrays left and right speed, range is -128..127. |
leds | array raw byte value for small green leds (bit0=0/1 turn off/on led0, bit1=0/1 turn off/on led1, ...). |
void setGreen | ( | int | robotAddr, |
unsigned char | value | ||
) |
Set the green intensity of the RGB led on the robot.
robotAddr | the address of the robot for which to change the packet. |
value | The intensity, range is between 0 (led off) to 100 (max power). |
void setGreenForAll | ( | unsigned char * | value | ) |
Set the green intensity of the RGB led of all the robots specified in the list.
value | The intensity array, range is between 0 (led off) to 100 (max power). |
void setLeftSpeed | ( | int | robotAddr, |
char | value | ||
) |
Set the left speed of the robot.
robotAddr | the address of the robot for which to change the packet. |
value | The speed, range is between -128 to 127. |
void setLeftSpeedForAll | ( | char * | value | ) |
Set the left speed of all the robots specified in the list.
value | The speed array, range is between -128 to 127. |
void setRed | ( | int | robotAddr, |
unsigned char | value | ||
) |
Set the red intensity of the RGB led on the robot.
robotAddr | the address of the robot for which to change the packet. |
value | The intensity, range is between 0 (led off) to 100 (max power). |
void setRedForAll | ( | unsigned char * | value | ) |
Set the red intensity of the RGB led of all the robots specified in the list.
value | The intensity array, range is between 0 (led off) to 100 (max power). |
void setRightSpeed | ( | int | robotAddr, |
char | value | ||
) |
Set the right speed of the robot.
robotAddr | the address of the robot for which to change the packet. |
value | The speed, range is between -128 to 127. |
void setRightSpeedForAll | ( | char * | value | ) |
Set the right speed of all the robots specified in the list.
value | The speed array, range is between -128 to 127. |
void setRobotAddress | ( | int | robotIndex, |
int | robotAddr | ||
) |
Set the address of a robot related to a particular index, the index must be in the range of the robot list size.
robotIndex | from 0 to number of robots - 1 (set with "setRobotAddresses" function) |
robotAddr | the address of the robot |
void setRobotAddresses | ( | int * | robotAddr, |
int | numRobots | ||
) |
Set the addresses of the robots that need to be controlled; max number of simultaneous robots is 100.
robotAddr | array list of robot addresses to be handled. |
numRobots | the array size (number of robots to handle). |
void setSmallLed | ( | int | robotAddr, |
int | ledId, | ||
int | state | ||
) |
Set a new stato (on or off) for the small green leds around the robot.
robotAddr | the address of the robot from which receive data. |
ledId | the led to change, from 0 to 7 (0 is in front, then increases clockwise). |
state | 0 to turn off, 1 to turn on. |
void startCommunication | ( | int * | robotAddr, |
int | numRobots | ||
) |
To be called once at the beginning, it init the USB communication with the RF module that is responsible to send data to the robots and initialize the list of robots to be controlled; max number of simultaneous robots is 100.
robotAddr | array list of robot addresses to be handled. |
numRobots | the array size (number of robots to handle). |
void startOdometryCalibration | ( | int | robotAddr | ) |
Start the odometry calibration.
robotAddr | the address of the robot for which to change the packet. |
void stopCommunication | ( | ) |
To be called once at the end, it closes the USB communication.
void stopTransferData | ( | ) |
This function stop the transmission of the packets to the robots.
void transferData | ( | ) |
This function need to be called periodically (as fast as possible) in order to exchange data with the robots.
void turnOffAllIRs | ( | int | robotAddr | ) |
Turn off all the 3 IRs transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOffBackIR | ( | int | robotAddr | ) |
Turn off the back IR transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOffFrontIRs | ( | int | robotAddr | ) |
Turn off both the front IRs transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOffSmallLeds | ( | int | robotAddr | ) |
Turn off all the small green leds around the robot.
robotAddr | the address of the robot from which receive data. |
void turnOnAllIRs | ( | int | robotAddr | ) |
Turn on all the 3 IRs transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOnBackIR | ( | int | robotAddr | ) |
Turn on the back IR transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOnFrontIRs | ( | int | robotAddr | ) |
Turn on both the front IRs transmitter on the robot.
robotAddr | the address of the robot for which to change the packet. |
void turnOnSmallLeds | ( | int | robotAddr | ) |
Turn on all the small green leds around the robot.
robotAddr | the address of the robot from which receive data. |
unsigned char waitForMessageTransmission | ( | int | robotAddr, |
unsigned long | us | ||
) |
Wait for the message to be actually sent to the robot; if the robot isn't reachable (out of range, discharged, ...) then the function will exit after the amount of time specified as parameter even if the robot doesn't receive the data.
robotAddr | the address of the robot for which to change data. |
us | function timeout given in microseconds |
unsigned char waitForUpdate | ( | int | robotAddr, |
unsigned long | us | ||
) |
Wait for updated data coming from the robot; if the robot isn't reachable (out of range, discharged, ...) then the function will exit after the amount of time specified as parameter even if no data are received. this function can be used also to check whether a message is successfully sent to a robot or not.
robotAddr | the address of the robot from which receive data. |
us | function timeout given in microseconds |