diff --git a/sw/in_progress/fdm/Makefile b/sw/in_progress/fdm/Makefile index 5e51b2186d..0d620ca127 100644 --- a/sw/in_progress/fdm/Makefile +++ b/sw/in_progress/fdm/Makefile @@ -28,6 +28,12 @@ all: fdm_step fdm_step: fdm_step.c gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy -clean: - rm -f *~ core *.o *.bak .depend fdm_step + +fms_steps_attitude: fms_steps_attitude.c + gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy + + + +clean: + rm -f *~ core *.o *.bak .depend fdm_step fms_steps_attitude diff --git a/sw/in_progress/fdm/booz2_fms_extern.h b/sw/in_progress/fdm/booz2_fms_extern.h new file mode 100644 index 0000000000..fa14dca5fb --- /dev/null +++ b/sw/in_progress/fdm/booz2_fms_extern.h @@ -0,0 +1,18 @@ +#ifndef BOOZ2_FMS_EXTERN_H +#define BOOZ2_FMS_EXTERN_H + +#define FMS_H_MODE_RATE 0 +#define FMS_H_MODE_ATTITUDE 1 +#define FMS_H_MODE_SPEED 2 +#define FMS_H_MODE_POS 3 + +#define FMS_ATTITUDE_OF_DEG(_d) ((int32_t)((_d)*0.0000546)) + +#define FMS_V_MODE_DIRECT 0 +#define FMS_V_MODE_CLIMB 1 +#define FMS_V_MODE_HEIGHT 2 + +//#define BOOZ2_SEND_IVY_FMS_COMMAND + + +#endif /* BOOZ2_FMS_EXTERN_H */ diff --git a/sw/in_progress/fdm/fdm_step.c b/sw/in_progress/fdm/fdm_step.c index 764c05ab1f..1109bec08f 100644 --- a/sw/in_progress/fdm/fdm_step.c +++ b/sw/in_progress/fdm/fdm_step.c @@ -1,10 +1,6 @@ /* * fdm_step * - * send joystick control to paparazzi through ivy - * - * based on Force Feedback: Constant Force Stress Test - * Copyright (C) 2001 Oliver Hamann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/sw/in_progress/fdm/fms_steps_attitude.c b/sw/in_progress/fdm/fms_steps_attitude.c new file mode 100644 index 0000000000..b9af9fa5f5 --- /dev/null +++ b/sw/in_progress/fdm/fms_steps_attitude.c @@ -0,0 +1,92 @@ +/* + * fms_steps_attitude + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include +#include "booz2_fms_extern.h" + + +#define TIMEOUT_PERIOD 100 +#define DEFAULT_AC_ID 150 +#define STEP_VAL 2 +#define STEP_PERIOD 3 + +static int aircraft_id = DEFAULT_AC_ID; +static int counter; + +static gboolean periodic(gpointer data __attribute__ ((unused))); + + +void parse_args(int argc, char * argv[]) +{ + int i; + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i],"-a") && i [