diff --git a/common/app/pixy_control.c b/common/app/pixy_control.c index 5786e7a..c30418d 100644 --- a/common/app/pixy_control.c +++ b/common/app/pixy_control.c @@ -21,9 +21,6 @@ #define REG_PID_KD (0.001f) #define REG_PID_TA (0.01f) -void int_init(void){ - // TODO Init ports and outputs if needed. -} // PID controller implementatoin for the y-axis int16_t pixy_PID_Y(int16_t x, int16_t w) diff --git a/common/app/pixy_control.h b/common/app/pixy_control.h index 3eb5f55..708cac4 100644 --- a/common/app/pixy_control.h +++ b/common/app/pixy_control.h @@ -1,14 +1,41 @@ -/* - * pixy_control.h - */ - -#ifndef _CONTROL_H_ -#define _CONTROL_H_ +#ifndef PIXY_CONTROL_H_ +#define PIXY_CONTROL_H_ #include -void int_init(void); +/** + * @addtogroup app + */ +/*@{*/ + +/** + * @defgroup pixy_control Pixy Control Helper + * A collection of helper functions that contain PID Control code used for object tracking. + */ +/*@}*/ + + +/** + * @addtogroup pixy_control + */ +/*@{*/ + +/** + * Execute one step of PID regulation for the Y-servo. + * @param x desired value (e.g. current y-position of the biggest block) + * @param w actual value (e.g desired y-position) + * @return The offset which needs to be added to the Y-Servo position + */ int16_t pixy_PID_Y(int16_t x, int16_t w); + +/** + * Execute one step of PID regulation for the X-servo. + * @param x desired value (e.g. current x-position of the biggest block) + * @param w actual value (e.g desired x-position) + * @return The offset which needs to be added to the X-Servo position + */ int16_t pixy_PID_X(int16_t x, int16_t w); -#endif +/*@}*/ + +#endif /* PIXY_CONTROL_H_ */ diff --git a/common/app/pixy_helper.c b/common/app/pixy_frame.c similarity index 99% rename from common/app/pixy_helper.c rename to common/app/pixy_frame.c index d137d71..8c7dc0d 100644 --- a/common/app/pixy_helper.c +++ b/common/app/pixy_frame.c @@ -1,4 +1,4 @@ -#include "pixy_helper.h" +#include "pixy_frame.h" #include "pixy.h" #include "tft.h" #include diff --git a/common/app/pixy_helper.h b/common/app/pixy_frame.h similarity index 87% rename from common/app/pixy_helper.h rename to common/app/pixy_frame.h index 7f7cd40..5f70b42 100644 --- a/common/app/pixy_helper.h +++ b/common/app/pixy_frame.h @@ -1,10 +1,30 @@ -#ifndef PIXY_HELPER_H -#define PIXY_HELPER_H +#ifndef PIXY_FRAME_H +#define PIXY_FRAME_H #include #include #include "filesystem.h" + +/** + * @addtogroup app + */ +/*@{*/ + +/** + * @defgroup pixy_helper Pixy Frame Helper + * A collection of helper functions that allow receiving and rendering a frame from pixy onto the display. + * Furthermore you can select a color in a frame, to use for tracking. + */ +/*@}*/ + + +/** + * @addtogroup pixy_helper + */ +/*@{*/ + + /** * Receives a fullsized frame from pixy and display's it on the display with the topleft corner at (x,y) * @param x The x-Coordinate of the top left corner @@ -56,4 +76,6 @@ int pixy_save_cropped_frame(FILE_HANDLE* handle, uint16_t xoffset, uint16_t yoff */ int pixy_cc_set_region(uint8_t signum, uint16_t xoffset, uint16_t yoffset, uint16_t width, uint16_t height); -#endif /* PIXY_HELPER_H */ +/*@}*/ + +#endif /* PIXY_FRAME_H */ diff --git a/common/app/screen_photomode.c b/common/app/screen_photomode.c index eb41ed5..01232f4 100644 --- a/common/app/screen_photomode.c +++ b/common/app/screen_photomode.c @@ -5,7 +5,7 @@ #include "touch.h" #include "pixy.h" #include "system.h" -#include "pixy_helper.h" +#include "pixy_frame.h" static bool pixy_connected = false; //Whether or not the pixy cam is currently connected diff --git a/common/app/screen_photomode_save.c b/common/app/screen_photomode_save.c index d05c4c8..e00f8dd 100644 --- a/common/app/screen_photomode_save.c +++ b/common/app/screen_photomode_save.c @@ -4,7 +4,7 @@ #include "tft.h" #include "touch.h" #include "pixy.h" -#include "pixy_helper.h" +#include "pixy_frame.h" #include #include diff --git a/common/app/screen_pixytest.c b/common/app/screen_pixytest.c index 05b5402..8b7b4cd 100644 --- a/common/app/screen_pixytest.c +++ b/common/app/screen_pixytest.c @@ -5,7 +5,7 @@ #include "touch.h" #include "pixy.h" #include "system.h" -#include "pixy_helper.h" +#include "pixy_frame.h" static volatile enum {detecting, idle,update_servos, update_ledcolor, update_ledcurrent} state; //Current state of the screen state machine diff --git a/common/app/screen_tracking.c b/common/app/screen_tracking.c index 508c8b3..cf6af59 100644 --- a/common/app/screen_tracking.c +++ b/common/app/screen_tracking.c @@ -6,7 +6,7 @@ #include "touch.h" #include "pixy.h" #include "system.h" -#include "pixy_helper.h" +#include "pixy_frame.h" static BUTTON_STRUCT b_back; //Button to navigate back static BUTTON_STRUCT b_select; //Button to start the color region selection diff --git a/doc/docu.odt b/doc/docu.odt index 62b1b91..7eabda7 100644 Binary files a/doc/docu.odt and b/doc/docu.odt differ