Commit e3fefb6b authored by 15김건우's avatar 15김건우

몬가... 몬가 일어나고 있음

parent e77555a8
......@@ -63,7 +63,56 @@ C_RESULT ardrone_tool_init_custom(void)
return C_OK;
}
C_RESULT ardrone_tool_update_custom() {
static float ag = 0, ab = 0, ad = 0, ah = 0,
l1 = 0, r1 = 0, l2 = 0, r2 = 0,
select = 0, start = 0, x = 0, y = 0,
phi_trim = 0, theta_trim = 0, yaw_trim = 0;
int key = kbhit();
switch(key) {
case 'i': ardrone_tool_set_ui_pad_xy(x= 0, y= 1); break; // up
case 'j': ardrone_tool_set_ui_pad_xy(x= -1, y= 0); break; // left
case 'k': ardrone_tool_set_ui_pad_xy(x= 0, y= -1); break; // down
case 'l': ardrone_tool_set_ui_pad_xy(x= 1, y= 0); break; // right
case 'm': ardrone_tool_set_ui_pad_xy(x= 0, y= 0); break;
}
#define _TOG(_c, _v) case _c : _v = ! _v ; ardrone_tool_set_ui_pad_##_v ( _v ); break
switch(key) {
_TOG('q', ag);
_TOG('w', ab);
_TOG('e', ad);
_TOG('r', ah);
_TOG('a', l1);
_TOG('s', r1);
_TOG('d', l2);
_TOG('f', r2);
_TOG('1', select);
_TOG('2', start);
_TOG(',', phi_trim);
_TOG('.', theta_trim);
_TOG('/', yaw_trim);
default: key = -1;
}
#undef _TOG
if (key != -1) {
printf(
"--------------------------------------------------------- \n"
"--- ag ab ad ah l1 r1 l2 r2 x y sel sta phi tht yaw --- \n"
"---%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d %3d %3d %3d %3d %3d --- \n"
"--------------------------------------------------------- \n",
ag, ab, ad, ah, l1, r1, l2, r2, x, y,
select, start, phi_trim, theta_trim, yaw_trim
);
}
return C_OK;
}
/* The delegate object calls this method every time in the event loop */
/*
C_RESULT ardrone_tool_update_custom() {
static float phi = 0, theta = 0, gaz = 0, yaw = 0, psi = 0, psi_accuracy = 0;
static int start = 0, emergency = 0, hover = 0, yaw_mode = 0, abs_ctrl_mode = 0;
......@@ -125,7 +174,7 @@ C_RESULT ardrone_tool_update_custom() {
return C_OK;
}
*/
/* The delegate object calls this method when the event loop exit */
C_RESULT ardrone_tool_shutdown_custom(void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment