Classes |
struct | Rectangle_T |
| Type of rectangle for object being tracked. More...
|
Public Types |
enum | eTrackingType { OBJECT = OBJECT_TRACKING,
LINE = LINE_TRACKING
} |
| Tracking types. More...
|
enum | eSortType { SIZE = SORT_OBJ_BY_SIZE,
COLOR = SORT_OBJ_BY_COLOR,
NO_SORTING = NO_SORTING_OBJ
} |
| Tracked objects sorting types. More...
|
Public Member Functions |
| Camera (ePortS port) |
| Constructor (activate I2C).
|
void | enableTracking (boolean enable) |
| Enable/disable tracking objects.
|
void | setTrackingType (eTrackingType mode) |
| Choose either object or line tracking mode.
|
void | sortBy (eSortType sortType) |
| Camera sorts objects it detects according to criteria, either color, size, or no sorting at all.
|
SINT | getNumberOfObjects (void) const |
| Get the number of objects being tracked.
|
SINT | getObjectColor (SINT id) const |
| Get the color number for a tracked object.
|
void | getRectangle (SINT id, Rectangle_T *rect) |
| Get the rectangle containing a tracked object.
|
bool | update (void) |
| Call regularly to poll the status of the camera device.
|
bool | sendCommand (U8 command) |
| Send a camera command.
|
bool | receive (U32 address, U8 *data, U32 length) |
| Receive raw data from the camera.
|
Static Public Attributes |
static const U8 | SORT_OBJ_BY_SIZE = 0x41 |
| Command to sort tracked objects by size.
|
static const U8 | OBJECT_TRACKING = 0x42 |
| Command to select object tracing mode.
|
static const U8 | WRITE_CAM_REG = 0x43 |
| Command to write to camera registers.
|
static const U8 | DISABLE_TRACKING = 0x44 |
| Command to disable tracking.
|
static const U8 | ENABLE_TRACKING = 0x45 |
| Command to enable tracking.
|
static const U8 | GET_COLOR_MAP = 0x47 |
| Command to get the color map from camera engine.
|
static const U8 | READ_CAM_REG = 0x48 |
| Command to read data from the camera engine.
|
static const U8 | ILLUMINATION_ON = 0x49 |
| Command to turn illumination On (Future)
|
static const U8 | LINE_TRACKING = 0x4C |
| Command to select line tracking mode.
|
static const U8 | SET_ADPA_ON = 0x4E |
| Command to set ADPA mode On.
|
static const U8 | SET_ADPA_OFF = 0x4F |
| Command to set ADPA mode Off (default)
|
static const U8 | PING_CAMERA_ENGINE = 0x50 |
| Command to ping camera engine.
|
static const U8 | RESET_CAMERA_ENGINE = 0x52 |
| Command to reset camera engine.
|
static const U8 | SET_COLOR_MAP = 0x53 |
| Command to send the color map to camera engine.
|
static const U8 | ILLUMINATION_OFF = 0x54 |
| Command to turn illumination Off.
|
static const U8 | SORT_OBJ_BY_COLOR = 0x55 |
| Command to sort tracked objects by color.
|
static const U8 | GET_VERSION = 0x56 |
| Command to get camera engine firmware version.
|
static const U8 | NO_SORTING_OBJ = 0x58 |
| Command to not sort tracked objects.
|
Mindsensor Camera device (http://www.mindsensors.com/) class.
[ How to use with TOPPERS/ATK1(OSEK) ]
I2C (derived/compositted) class and Clock class internally use RTOS features. Thus, user needs to implement a C function and RTOS provided events.
+ Invoke SleeperMonitor function in user_1msec_isr_type2 hook.
void user_1ms_isr_type2(void)
{
SleeperMonitor(); // needed for I2C devices and Clock class
}
+ Define EventSleepI2C and EventSleep Events in user oil file.
EVENT EventSleepI2C
{
MASK = AUTO;
};
EVENT EventSleep
{
MASK = AUTO;
};
TASK TaskMain
{
AUTOSTART = TRUE
{
APPMODE = appmode1;
};
PRIORITY = 1;
ACTIVATION = 1;
SCHEDULE = FULL;
STACKSIZE = 512;
EVENT = EventSleepI2C; <- Here it is
EVENT = EventSleep; <- Here it is
};
[ How to use with TOPPERS/JSP(ITRON) ]
In case of using this class with TOPPERS/JSP(ITRON), RTOS specific definitions for the class are not needed.