Robolocust control program for the iRobot Create's Command Module. More...
#include "LoRemote.h"
#include "LoBumps.h"
#include "LoCliffs.h"
#include "LoDrive.h"
#include "LoSensors.h"
#include "LoBeep.h"
#include "LoUtils.h"
#include "LoIO.h"
#include "LoTimer.h"
#include "LoCMInterface.h"
#include "LoOpenInterface.h"
#include <avr/io.h>
#include <avr/interrupt.h>
Go to the source code of this file.
Classes | |
struct | CommandInfo |
Defines | |
#define | LOBOT_CREATE_BOOT_DELAY 3500 |
#define | LOBOT_COMPUTER_TIMEOUT 250 |
#define | LOBOT_STARTUP_BEEP_DELAY 5000 |
#define | LOBOT_UPDATE_DELAY 50 |
#define | LOBOT_HEARTBEAT_INTERVAL 25 |
#define | ignore_high_level() (lo_is_wheel_dropped() || lo_is_cliff_detected() || lo_is_remote_control()) |
#define | play_quit() |
Typedefs | |
typedef void(* | CommandHandler )(int op) |
Functions | |
static void | init_command_module (void) |
static void | init_robot (void) |
static void | init_open_interface (void) |
static void | init_leds (void) |
static void | react_to_sensors (void) |
static void | send_pending_acks (void) |
static char | bad_parity (char cmd[LOBOT_CMD_SIZE]) |
static void | execute (char cmd, int param) |
int | main (void) |
Variables | |
static const CommandInfo | g_command_map [] |
static const char | LOBOT_NUM_COMMANDS |
Robolocust control program for the iRobot Create's Command Module.
This file defines the main function for a control program meant to be run on the iRobot Create's Command Module. This program is designed to listen to the Command Module's USB port for incoming motor commands from the higher (C++) layers of the lobot controller and convert them into the equivalent sequence of Open Interface opcode and operand bytes to be sent to the iRobot Create.
Definition in file LoCmdMain.c.
#define play_quit | ( | ) |
((lo_get_sensor(LOBOT_SENSORS_BUTTONS) & LOBOT_OI_BUTTON_PLAY) == \ LOBOT_OI_BUTTON_PLAY)
Definition at line 339 of file LoCmdMain.c.
const CommandInfo g_command_map[] [static] |
{ {LOBOT_CMD_NOP, &lo_nop}, {LOBOT_CMD_FORWARD, &lo_forward}, {LOBOT_CMD_REVERSE, &lo_reverse}, {LOBOT_CMD_STOP, &lo_stop}, {LOBOT_CMD_LEFT, &lo_left}, {LOBOT_CMD_RIGHT, &lo_right}, {LOBOT_CMD_STRAIGHT, &lo_straight}, {LOBOT_CMD_SPIN, &lo_cmd_spin}, {LOBOT_CMD_ENABLE_REAR_BUMPS, &lo_enable_rear_bumps}, {LOBOT_CMD_DISABLE_REAR_BUMPS, &lo_disable_rear_bumps}, }
Definition at line 101 of file LoCmdMain.c.
const char LOBOT_NUM_COMMANDS [static] |
sizeof(g_command_map)/sizeof(g_command_map[0])
Definition at line 117 of file LoCmdMain.c.