PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <string.h>
#include <drivers/device/i2c.h>
#include <drivers/device/ringbuffer.h>
#include <px4_platform_common/getopt.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <systemlib/err.h>
#include <uORB/uORB.h>
#include <uORB/topics/irlock_report.h>
Go to the source code of this file.
Classes | |
struct | irlock_target_s |
struct | irlock_s |
irlock_s structure returned from read calls More... | |
class | IRLOCK |
Macros | |
#define | IRLOCK_I2C_BUS PX4_I2C_BUS_EXPANSION |
Configuration Constants. More... | |
#define | IRLOCK_I2C_ADDRESS 0x54 /** 7-bit address (non shifted) **/ |
#define | IRLOCK_CONVERSION_INTERVAL_US 20000U /** us = 20ms = 50Hz **/ |
#define | IRLOCK_SYNC 0xAA55 |
#define | IRLOCK_RESYNC 0x5500 |
#define | IRLOCK_ADJUST 0xAA |
#define | IRLOCK_RES_X 320 |
#define | IRLOCK_RES_Y 200 |
#define | IRLOCK_CENTER_X (IRLOCK_RES_X/2) |
#define | IRLOCK_CENTER_Y (IRLOCK_RES_Y/2) |
#define | IRLOCK_FOV_X (60.0f*M_PI_F/180.0f) |
#define | IRLOCK_FOV_Y (35.0f*M_PI_F/180.0f) |
#define | IRLOCK_TAN_HALF_FOV_X 0.57735026919f |
#define | IRLOCK_TAN_HALF_FOV_Y 0.31529878887f |
#define | IRLOCK_TAN_ANG_PER_PIXEL_X (2*IRLOCK_TAN_HALF_FOV_X/IRLOCK_RES_X) |
#define | IRLOCK_TAN_ANG_PER_PIXEL_Y (2*IRLOCK_TAN_HALF_FOV_Y/IRLOCK_RES_Y) |
#define | IRLOCK_BASE_DEVICE_PATH "/dev/irlock" |
#define | IRLOCK0_DEVICE_PATH "/dev/irlock0" |
#define | IRLOCK_OBJECTS_MAX 5 /** up to 5 objects can be detected/reported **/ |
Functions | |
void | irlock_usage () |
__EXPORT int | irlock_main (int argc, char *argv[]) |
Driver for an IR-Lock and Pixy vision sensor connected via I2C.
Created on: Nov 12, 2014
Definition in file irlock.cpp.
#define IRLOCK0_DEVICE_PATH "/dev/irlock0" |
Definition at line 80 of file irlock.cpp.
#define IRLOCK_ADJUST 0xAA |
Definition at line 62 of file irlock.cpp.
Referenced by IRLOCK::sync_device().
#define IRLOCK_BASE_DEVICE_PATH "/dev/irlock" |
Definition at line 79 of file irlock.cpp.
#define IRLOCK_CENTER_X (IRLOCK_RES_X/2) |
Definition at line 67 of file irlock.cpp.
Referenced by IRLOCK::read_device_block().
#define IRLOCK_CENTER_Y (IRLOCK_RES_Y/2) |
Definition at line 68 of file irlock.cpp.
Referenced by IRLOCK::read_device_block().
#define IRLOCK_CONVERSION_INTERVAL_US 20000U /** us = 20ms = 50Hz **/ |
Definition at line 58 of file irlock.cpp.
Referenced by IRLOCK::Run().
#define IRLOCK_FOV_X (60.0f*M_PI_F/180.0f) |
Definition at line 70 of file irlock.cpp.
#define IRLOCK_FOV_Y (35.0f*M_PI_F/180.0f) |
Definition at line 71 of file irlock.cpp.
#define IRLOCK_I2C_ADDRESS 0x54 /** 7-bit address (non shifted) **/ |
Definition at line 57 of file irlock.cpp.
Referenced by irlock_main().
#define IRLOCK_I2C_BUS PX4_I2C_BUS_EXPANSION |
Configuration Constants.
Definition at line 56 of file irlock.cpp.
Referenced by irlock_main(), and irlock_usage().
#define IRLOCK_OBJECTS_MAX 5 /** up to 5 objects can be detected/reported **/ |
Definition at line 82 of file irlock.cpp.
Referenced by IRLOCK::read_device().
#define IRLOCK_RES_X 320 |
Definition at line 64 of file irlock.cpp.
#define IRLOCK_RES_Y 200 |
Definition at line 65 of file irlock.cpp.
#define IRLOCK_RESYNC 0x5500 |
Definition at line 61 of file irlock.cpp.
Referenced by IRLOCK::sync_device().
#define IRLOCK_SYNC 0xAA55 |
Definition at line 60 of file irlock.cpp.
Referenced by IRLOCK::sync_device().
#define IRLOCK_TAN_ANG_PER_PIXEL_X (2*IRLOCK_TAN_HALF_FOV_X/IRLOCK_RES_X) |
Definition at line 76 of file irlock.cpp.
Referenced by IRLOCK::read_device_block().
#define IRLOCK_TAN_ANG_PER_PIXEL_Y (2*IRLOCK_TAN_HALF_FOV_Y/IRLOCK_RES_Y) |
Definition at line 77 of file irlock.cpp.
Referenced by IRLOCK::read_device_block().
#define IRLOCK_TAN_HALF_FOV_X 0.57735026919f |
Definition at line 73 of file irlock.cpp.
#define IRLOCK_TAN_HALF_FOV_Y 0.31529878887f |
Definition at line 74 of file irlock.cpp.
int irlock_main | ( | int | argc, |
char * | argv[] | ||
) |
start driver
instantiate global instance
initialise global instance
need the driver past this point
stop the driver
Print driver information
test driver
display usage info
Definition at line 441 of file irlock.cpp.
References command, errx, IRLOCK::IRLOCK(), IRLOCK_I2C_ADDRESS, IRLOCK_I2C_BUS, irlock_usage(), OK, and warnx.
void irlock_usage | ( | ) |
Definition at line 434 of file irlock.cpp.
References IRLOCK_I2C_BUS, and warnx.
Referenced by irlock_main().