*** empty log message ***

This commit is contained in:
Antoine Drouin
2009-02-20 12:13:17 +00:00
parent 7621584b85
commit 5591d1d48f
3 changed files with 48 additions and 45 deletions
+4 -2
View File
@@ -91,8 +91,10 @@ JSBSIM = /home/violato/JSBSim
CC = g++
CFLAGS = -Wall -I $(JSBSIM)/src -I../include
LDFLAGS = -L $(JSBSIM)/lib -lJSBSim
CFLAGS += `pkg-config glib-2.0 --cflags` -I /usr/include/meschach
LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lmeschach -lpcre -lglibivy
CFLAGS += -I /usr/include/meschach
LDFLAGS += -lmeschach
#CFLAGS += `pkg-config glib-2.0 --cflags`
#LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy
test1: nps_test1.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+41 -39
View File
@@ -5,6 +5,45 @@
#include <matrix.h>
/* Vehicle specific descriptions */
struct NpsDummy {
/* force applied to the ball in Newton */
double f_input;
};
#define NPS_QUAD_MOTOR_FRONT 0
#define NPS_QUAD_MOTOR_BACK 1
#define NPS_QUAD_MOTOR_RIGHT 2
#define NPS_QUAD_MOTOR_LEFT 3
#define NPS_QUAD_MOTOR_NB 4
struct NpsQuad {
/* battery voltage in V */
double battery;
/* motor commands [0:1] */
VEC* motor_commands;
/* propeller rotation speed in rad/s */
VEC* prop_omega;
};
#define NPS_SFW_ACTUATOR_THROTTLE 0
#define NPS_SFW_ACTUATOR_AILERON_R 1
#define NPS_SFW_ACTUATOR_AILERON_L 2
#define NPS_SFW_ACTUATOR_NB 3
struct NpsSFW {
double prop_omega;
/*
Deflection of control surfaces in radian
Normalized throttle [0:1]
*/
VEC* actuators;
};
struct NpsFdmState {
@@ -22,54 +61,17 @@ struct NpsFdmState {
VEC* ecef_to_ltp_quat;
// vehicle specific
/* vehicle specific */
union {
struct NpsDummy dummy;
struct NpsQuad quad;
struct NpsSFW fw;
};
} vehicle;
};
struct NpsDummy {
/* force applied to the ball in Newton */
double f_input;
};
#define NPS_QUAD_MOTOR_FRONT 0
#define NPS_QUAD_MOTOR_BACK 1
#define NPS_QUAD_MOTOR_RIGHT 2
#define NPS_QUAD_MOTOR_LEFT 3
#define NPS_QUAD_MOTOR_NB 4
struct NpsQuad {
/* battery voltage in V */
double battery;
/* motor commands [0:1]
VEC* motor_commands;
/* propeller rotation speed in rad/s */
VEC* prop_omega;
};
#define NPS_SFW_ACTUATOR_THROTTLE 0
#define NPS_SFW_ACTUATOR_AILERON_R 1
#define NPS_SFW_ACTUATOR_AILERON_L 2
#define NPS_SFW_ACTUATOR_NB 3
struct NpsSFW {
double prop_omega;
/*
deflection of control surfaces in radian
normalized throttle [0:1]
*/
VEC* actuators;
}
+3 -4
View File
@@ -1,7 +1,8 @@
#include "nps_fdm.h"
#include <FGFDMExec.h>
#include <math/FGColumnVector3.h>
#include "nps_fdm.h"
string RootDir = "/home/violato/JSBSim/";
string AircraftName = "ball";
string ResetName = "reset00";
@@ -9,14 +10,12 @@ string ResetName = "reset00";
static struct NpsFdmState fdm_state;
static void feed_inputs(JSBSim::FGFDMExec* fdmex) {
//double hover_force = 0.;
fdmex->SetPropertyValue("/fdm/jsbsim/fcs/parachute_reef_pos_norm", fdm_state.dummy.f_input);
fdmex->SetPropertyValue("/fdm/jsbsim/fcs/parachute_reef_pos_norm", fdm_state.vehicle.dummy.f_input);
}
static void fetch_state(JSBSim::FGFDMExec* fdmex) {