diff --git a/sw/airborne/boards/bebop.h b/sw/airborne/boards/bebop.h index da7f5cceb3..5521cf5659 100644 --- a/sw/airborne/boards/bebop.h +++ b/sw/airborne/boards/bebop.h @@ -36,6 +36,32 @@ #define MT9F002_OUTPUT_WIDTH 2048 #endif +#ifndef MT9F002_INITIAL_OFFSET_X +#define MT9F002_INITIAL_OFFSET_X 1000 // pixels in the raw sensor!! +#endif + +#ifndef MT9F002_INITIAL_OFFSET_Y +#define MT9F002_INITIAL_OFFSET_Y 0 // pixels in the raw sensor!! +#endif + +/** Our output is only OUTPUT_SCALER of the pixels we take of the sensor + * Example: + * output_width = 512 + * output_height = 830 + * output_scaler = 0.25 + * We now get an image of 512 by 830 which contains a "compressed version" + * of what would normally be an image of 2048 by 3320. + * Be warned: set your offset x appropriately. + * Example of what could go wrong: + * output_width = 512 + * output_height = 830 + * output_scaler = 0.25 + * offset_x = 1500 + * We now ask for pixels outside the 4608H x 2592V sensor or the 3320H x 2048W of the ISP. + */ +#ifndef MT9F002_OUTPUT_SCALER +#define MT9F002_OUTPUT_SCALER 1.0 +#endif /** uart connected to GPS internally */ #define UART1_DEV /dev/ttyPA1 diff --git a/sw/airborne/boards/bebop/board.c b/sw/airborne/boards/bebop/board.c index 61d1908e5c..a068733a15 100644 --- a/sw/airborne/boards/bebop/board.c +++ b/sw/airborne/boards/bebop/board.c @@ -123,9 +123,9 @@ void board_init2(void) .gain_green2 = 2.0, .output_width = MT9F002_OUTPUT_WIDTH, .output_height = MT9F002_OUTPUT_HEIGHT, - .output_scaler = 1.0, - .offset_x = 1000, - .offset_y = 0, + .output_scaler = MT9F002_OUTPUT_SCALER, + .offset_x = MT9F002_INITIAL_OFFSET_X, + .offset_y = MT9F002_INITIAL_OFFSET_Y, // I2C connection port .i2c_periph = &i2c0