Kangaroo Library for Arduino
Use reliable Packet Serial to communicate with your Kangaroo.
|
Go to the source code of this file.
Classes | |
class | KangarooStatus |
Stores the response to a status request. More... | |
class | KangarooSerial |
Create a KangarooSerial for the serial port you are using, and then attach a KangarooChannel for each channel you want to communicate with. More... | |
class | KangarooTimeout |
Encapsulates a starting time and duration. More... | |
class | KangarooChannel |
Lets you send commands to and get position, speed, etc. for a specific channel of the Kangaroo. More... | |
class | KangarooMonitor |
Makes it easy to track the status of position commands, speed commands, and any other commands that take time to complete. More... | |
Macros | |
#define | KANGAROO_DEFAULT_ADDRESS 128 |
The default Packet Serial address for Kangaroo is 128. | |
#define | KANGAROO_DEFAULT_COMMAND_RETRY_INTERVAL 100 |
By default, commands retry after 100 milliseconds if no response is received. | |
#define | KANGAROO_DEFAULT_COMMAND_TIMEOUT KANGAROO_INFINITE_TIMEOUT |
By default, commands are retried forever. | |
#define | KANGAROO_INFINITE_TIMEOUT -1 |
This value, passed as a timeout, disables the timeout. | |
#define | KANGAROO_UNSPECIFIED_LIMIT -1 |
This value, passed as a limit, leaves the limit unspecified. | |
Functions | |
boolean | waitAll (size_t count, KangarooMonitor *monitors[], int32_t timeoutMS=KANGAROO_INFINITE_TIMEOUT) |
boolean | waitAll (size_t count, KangarooMonitor *monitors[], const KangarooTimeout &timeout) |
int | waitAny (size_t count, KangarooMonitor *monitors[], int32_t timeoutMS=KANGAROO_INFINITE_TIMEOUT) |
int | waitAny (size_t count, KangarooMonitor *monitors[], const KangarooTimeout &timeout) |
Include this file to use the Kangaroo Arduino library.
enum KangarooError |
Errors that can occur in response to status queries.
Enumerator | |
---|---|
KANGAROO_NO_ERROR |
No error occurred. |
KANGAROO_NOT_STARTED |
The channel is not started. Call KangarooChannel::start() on the channel. |
KANGAROO_NOT_HOMED |
The channel needs to be homed. Call KangarooChannel::home() on the channel. |
KANGAROO_CONTROL_ERROR |
A control error has occurred. Call KangarooChannel::start() on the channel to clear the control error. |
KANGAROO_WRONG_MODE |
The controller is in the wrong mode. For example, the DIP switches may be in Mixed Mode while the tune was done in Independent Mode. |
KANGAROO_SERIAL_TIMEOUT |
A serial timeout occurred, or the TX line was disconnected. Call KangarooChannel::start() on the channel to clear the serial timeout. |
KANGAROO_TIMED_OUT |
The requested timeout expired. |
enum KangarooGetFlags |
enum KangarooGetType |
The possible 'get' request types.
enum KangarooMoveFlags |
Flags that modify the behavior of a motion request.
enum KangarooStatusFlags |
Flags that provide details about a query response.
Advanced commands that have special effects on the Kangaroo motion controller.
Enumerator | |
---|---|
KANGAROO_SYS_POWER_DOWN |
Powers down the channel. |
KANGAROO_SYS_POWER_DOWN_ALL |
Powers down all channels of the controller that receives the command. |
KANGAROO_SYS_TUNE_ENTER_MODE |
Enters tune mode 1 (Teach), 2 (Limit Switches), or 3 (Mechanical Stops). This corresponds to pressing the tune button to get to the mode you want. Do not expect a reply from this command. |
KANGAROO_SYS_TUNE_SET_DISABLED_CHANNELS |
Initially all channels are disabled for safety reasons after entering a tune mode. You must send this bitmask before beginning the tune. 0 enables all channels. Do not expect a reply from this command. |
KANGAROO_SYS_TUNE_CONTROL_OPEN_LOOP |
Sets the open loop power. This can be used to position for a Teach tune. The range is -(2^28-1) to 2^28-1. Do not expect a reply from this command. |
KANGAROO_SYS_TUNE_GO |
Begins the tune. This corresponds to pressing the tune button after you are in the desired mode. Tuning has an automatic serial timeout for safety reasons. You must continually send packets or it will abort. KangarooChannel::getP() in a loop does the job. Do not expect a reply from this command. |
KANGAROO_SYS_TUNE_ABORT |
Aborts the tune. Do not expect a reply from this command. |
KANGAROO_SYS_SET_BAUD_RATE |
Sets the baud rate. Do not expect a reply from this command. |
KANGAROO_SYS_SET_SERIAL_TIMEOUT |
Sets the serial timeout. |
boolean waitAll | ( | size_t | count, |
KangarooMonitor * | monitors[], | ||
int32_t | timeoutMS = KANGAROO_INFINITE_TIMEOUT |
||
) |
Waits until all of the monitors are done or the timeout expires.
count | The number of monitors. |
monitors | The monitors to wait for. |
timeoutMS | The timeout to use, in milliseconds. |
boolean waitAll | ( | size_t | count, |
KangarooMonitor * | monitors[], | ||
const KangarooTimeout & | timeout | ||
) |
Waits until all of the monitors are done or the timeout object expires.
count | The number of monitors. |
monitors | The monitors to wait for. |
timeout | The timeout object to use. |
int waitAny | ( | size_t | count, |
KangarooMonitor * | monitors[], | ||
int32_t | timeoutMS = KANGAROO_INFINITE_TIMEOUT |
||
) |
Waits until at least one of the monitors is done or the timeout expires.
count | The number of monitors. |
monitors | The monitors to wait for. |
timeoutMS | The timeout to use, in milliseconds. |
int waitAny | ( | size_t | count, |
KangarooMonitor * | monitors[], | ||
const KangarooTimeout & | timeout | ||
) |
Waits until at least one of the monitors is done or the timeout expires.
count | The number of monitors. |
monitors | The monitors to wait for. |
timeout | The timeout object to use. |