30 changes: 1 addition & 29 deletions sw/airborne/arch/sim/modules/radio_control/ppm_arch.c
Expand Up @@ -27,21 +27,14 @@

#include "modules/radio_control/radio_control.h"
#include "modules/radio_control/ppm.h"

#include <inttypes.h>

#if USE_NPS
#include "nps_radio_control.h"
#else
#include <caml/mlvalues.h>
#endif
#include <inttypes.h>


void ppm_arch_init(void)
{
}

#if USE_NPS
#ifdef RADIO_CONTROL
#define PPM_OF_NPS(_nps, _neutral, _min, _max) \
((_nps) >= 0 ? (_neutral) + (_nps) * ((_max)-(_neutral)) : (_neutral) + (_nps) * ((_neutral)- (_min)))
Expand Down Expand Up @@ -74,24 +67,3 @@ void radio_control_feed(void)
void radio_control_feed(void) {}
#endif //RADIO_CONTROL

#elif !USE_JSBSIM // not NPS and not JSBSIM -> simple ocaml sim
#ifdef RADIO_CONTROL
value update_rc_channel(value c, value v)
{
ppm_pulses[Int_val(c)] = Double_val(v);
return Val_unit;
}

value send_ppm(value unit)
{
ppm_frame_available = true;
return unit;
}
#else // RADIO_CONTROL
value update_rc_channel(value c __attribute__((unused)), value v __attribute__((unused)))
{
return Val_unit;
}
value send_ppm(value unit) {return unit;}
#endif // RADIO_CONTROL
#endif // USE_NPS
35 changes: 0 additions & 35 deletions sw/airborne/arch/sim/modules/radio_control/rc_datalink.c

This file was deleted.

34 changes: 0 additions & 34 deletions sw/airborne/arch/sim/modules/radio_control/spektrum_arch.c
Expand Up @@ -32,11 +32,7 @@
#include "std.h"
#include <inttypes.h>

#if USE_NPS
#include "nps_radio_control.h"
#else
#include <caml/mlvalues.h>
#endif

static bool spektrum_available;

Expand All @@ -58,7 +54,6 @@ void spektrum_event(void)

void spektrum_try_bind(void) {}

#if USE_NPS
#ifdef RADIO_CONTROL
void radio_control_feed(void)
{
Expand All @@ -73,32 +68,3 @@ void radio_control_feed(void)
void radio_control_feed(void) {}
#endif //RADIO_CONTROL

#else // not NPS -> simple ocaml sim
#ifdef RADIO_CONTROL
value update_rc_channel(value c, value v)
{
// OCaml sim sends ppm values read from radio xml
//assume "ppm" value range from 1000 to 2000 for now.. like in fake spektrum.xml
if (Int_val(c) == 0) {
// throttle channel has neutral at 1000
radio_control.values[Int_val(c)] = (Double_val(v) - 1000.0) / 1000 * MAX_PPRZ;
} else {
// all other channels at 1500
radio_control.values[Int_val(c)] = (Double_val(v) - 1500.0) / 500 * MAX_PPRZ;
}
return Val_unit;
}

value send_ppm(value unit)
{
spektrum_available = true;
return unit;
}
#else // RADIO_CONTROL
value update_rc_channel(value c __attribute__((unused)), value v __attribute__((unused)))
{
return Val_unit;
}
value send_ppm(value unit) {return unit;}
#endif // RADIO_CONTROL
#endif // USE_NPS
19 changes: 0 additions & 19 deletions sw/airborne/arch/sim/sim_adc_generic.c

This file was deleted.

38 changes: 0 additions & 38 deletions sw/airborne/arch/sim/sim_ahrs.c

This file was deleted.

17 changes: 0 additions & 17 deletions sw/airborne/arch/sim/sim_airspeed.c

This file was deleted.

123 changes: 0 additions & 123 deletions sw/airborne/arch/sim/sim_ap.c

This file was deleted.

82 changes: 0 additions & 82 deletions sw/airborne/arch/sim/sim_gps.c

This file was deleted.

5 changes: 0 additions & 5 deletions sw/airborne/arch/sim/sim_uart_hw.c

This file was deleted.

24 changes: 2 additions & 22 deletions sw/simulator/Makefile
Expand Up @@ -31,38 +31,18 @@ INCLUDES =
PKG = -package glibivy,pprz
LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz,pprzlink

SIMML = simlib.ml data.ml flightModel.ml gps.ml
SIMHML = $(SIMML) hitl.ml sim.ml
SIMHCMO=$(SIMHML:%.ml=%.cmo)
SIMSML = $(SIMML) sitl.ml sim.ml
SIMSCMO=$(SIMSML:%.ml=%.cmo)
SIMSCMX=$(SIMSML:%.ml=%.cmx)

AIRBORNE = ../airborne
VARINCLUDE=$(PAPARAZZI_HOME)/var/include
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)

CAML_CFLAGS = -I $(shell $(OCAMLC) -where)


all : gaia sitl.cma

sitl.cma : fg.o $(SIMSCMO) $(LIBPPRZCMA) $(LIBPPRZLINKCMA)
@echo OL $@
$(Q)$(OCAMLMKLIB) -o sitl $^

sitl.cmxa : $(SIMSCMX) $(LIBPPRZCMXA) $(LIBPPRZLINKCMXA)
@echo OC $@
$(Q)$(OCAMLOPT) -o $@ -a $^
all : gaia

gaia : gaia.cmo $(LIBPPRZCMA) $(LIBPPRZLINKCMA)
@echo OL $@
$(Q)$(OCAMLC) $(INCLUDES) -o $@ $(LINKPKG) gtkInit.cmo $<

diffusion : simlib.cmo diffusion.cmo
@echo OL $@
$(Q)$(OCAMLC) $(INCLUDES) -o $@ $(LINKPKG) gtkInit.cmo $^

%.cmo : %.ml
@echo OC $<
$(Q)$(OCAMLC) $(INCLUDES) -c $(PKG) $<
Expand All @@ -80,7 +60,7 @@ diffusion : simlib.cmo diffusion.cmo
$(Q)$(OCAMLC) $(INCLUDES) -c $(PKG) $<

clean :
$(Q)rm -f *.cm* *~ *.out .depend *.o *.a *.so gaia simhitl diffusion
$(Q)rm -f *.cm* *~ *.out .depend *.o *.a *.so gaia

.PHONY: all clean

Expand Down
73 changes: 0 additions & 73 deletions sw/simulator/data.ml

This file was deleted.

36 changes: 0 additions & 36 deletions sw/simulator/data.mli

This file was deleted.

138 changes: 0 additions & 138 deletions sw/simulator/diffusion.ml

This file was deleted.

57 changes: 0 additions & 57 deletions sw/simulator/fg.c

This file was deleted.

53 changes: 0 additions & 53 deletions sw/simulator/fg_environment.xml

This file was deleted.

280 changes: 0 additions & 280 deletions sw/simulator/flightModel.ml

This file was deleted.

53 changes: 0 additions & 53 deletions sw/simulator/flightModel.mli

This file was deleted.

320 changes: 0 additions & 320 deletions sw/simulator/flight_gear.h

This file was deleted.

81 changes: 0 additions & 81 deletions sw/simulator/gps.ml

This file was deleted.

36 changes: 0 additions & 36 deletions sw/simulator/gps.mli

This file was deleted.

2 changes: 1 addition & 1 deletion sw/simulator/nps/nps_fdm.h
Expand Up @@ -27,7 +27,7 @@ extern "C" {
#endif

#include "std.h"
#include "../flight_gear.h"
#include "flight_gear.h"
#include "math/pprz_geodetic_double.h"
#include "math/pprz_algebra_double.h"

Expand Down
309 changes: 309 additions & 0 deletions sw/simulator/nps/nps_fdm_fixedwing_sim.c
@@ -0,0 +1,309 @@
/*
* Copyright (C) 2023 Gautier Hattenberger <gautier.hattenberger@enac.fr>
*
* This file is part of paparazzi.
*
* paparazzi 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, or (at your option)
* any later version.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/

#include "nps_fdm.h"

#include <stdlib.h>
#include <stdio.h>

#include "std.h"
#include "math/pprz_geodetic.h"
#include "math/pprz_geodetic_double.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_algebra.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_isa.h"

#include "generated/airframe.h"
#include "generated/flight_plan.h"

#include "state.h"

// Check if rover firmware
#ifndef FIXEDWING_FIRMWARE
#error "The module nps_fdm_fixedwing_sim is a basic flight model for fixedwing only"
#endif

#ifndef ROLL_RESPONSE_FACTOR
#define ROLL_RESPONSE_FACTOR 15.
#endif

#ifndef PITCH_RESPONSE_FACTOR
#define PITCH_RESPONSE_FACTOR 1.
#endif

#ifndef YAW_RESPONSE_FACTOR
#define YAW_RESPONSE_FACTOR 1.
#endif

#ifndef WEIGHT
#define WEIGHT 1.
#endif

#ifndef ROLL_MAX_SETPOINT
#define ROLL_MAX_SETPOINT RadOfDeg(40.)
#endif

#ifndef ROLL_RATE_MAX_SETPOINT
#define ROLL_RATE_MAX_SETPOINT RadOfDeg(15.)
#endif

#ifndef NOMINAL_AIRSPEED
#error "Please define NOMINAL_AIRSPEED in your airframe file"
#endif

#ifndef MAXIMUM_AIRSPEED
#define MAXIMUM_AIRSPEED (NOMINAL_AIRSPEED * 1.5)
#endif

#ifndef MAXIMUM_POWER
#define MAXIMUM_POWER (5. * MAXIMUM_AIRSPEED * WEIGHT)
#endif

#ifndef AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE
#define AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE 0.45
#endif

// NpsFdm structure
struct NpsFdm fdm;

// Reference point
static struct LtpDef_d ltpdef;

// Static functions declaration
static void init_ltp(void);

struct fixedwing_sim_state {
struct EnuCoor_d pos;
struct EnuCoor_d speed;
struct DoubleEulers attitude;
struct DoubleEulers rates;
double airspeed;
double delta_roll;
double delta_pitch;
double delta_thrust;
struct EnuCoor_d wind;
};

static struct fixedwing_sim_state sim_state;


/** NPS FDM rover init ***************************/
void nps_fdm_init(double dt)
{
fdm.init_dt = dt; // (1 / simulation freq)
fdm.curr_dt = dt;
fdm.time = dt;

fdm.on_ground = TRUE;

fdm.nan_count = 0;
fdm.pressure = -1;
fdm.pressure_sl = PPRZ_ISA_SEA_LEVEL_PRESSURE;
fdm.total_pressure = -1;
fdm.dynamic_pressure = -1;
fdm.temperature = -1;

fdm.ltpprz_to_body_eulers.phi = 0.0;
fdm.ltpprz_to_body_eulers.theta = 0.0;
fdm.ltpprz_to_body_eulers.psi = 0.0;

VECT3_ASSIGN(sim_state.pos, 0., 0., 0.);
VECT3_ASSIGN(sim_state.speed, 0., 0., 0.);
EULERS_ASSIGN(sim_state.attitude, 0., 0., 0.);
EULERS_ASSIGN(sim_state.rates, 0., 0., 0.);
VECT3_ASSIGN(sim_state.wind, 0., 0., 0.);
sim_state.airspeed = 0.;
sim_state.delta_roll = 0.;
sim_state.delta_pitch = 0.;
sim_state.delta_thrust = 0.;

init_ltp();
}


/** Minimum complexity flight dynamic model
* In legacy Paparazzi simulator, was implemented in OCaml
* and correspond to the 'sim' target
*
* Johnson, E.N., Fontaine, S.G., and Kahn, A.D.,
* “Minimum Complexity Uninhabited Air Vehicle Guidance And Flight Control System,”
* Proceedings of the 20th Digital Avionics Systems Conference, 2001.
* http://www.ae.gatech.edu/~ejohnson/JohnsonFontaineKahn.pdf
* Johnson, E.N. and Fontaine, S.G.,
* “Use Of Flight Simulation To Complement Flight Testing Of Low-Cost UAVs,”
* Proceedings of the AIAA Modeling and Simulation Technology Conference, 2001.
* http://www.ae.gatech.edu/~ejohnson/AIAA%202001-4059.pdf
*/
void nps_fdm_run_step(bool launch, double *commands, int commands_nb __attribute__((unused)))
{

// commands
sim_state.delta_roll = commands[COMMAND_ROLL] * MAX_PPRZ;
sim_state.delta_pitch = -commands[COMMAND_PITCH] * MAX_PPRZ; // invert back to correct sign
sim_state.delta_thrust = commands[COMMAND_THROTTLE];

static bool already_launched = false;
if (launch && !already_launched) {
sim_state.airspeed = NOMINAL_AIRSPEED;
already_launched = true;
}
if (sim_state.airspeed == 0. && sim_state.delta_thrust > 0.) {
sim_state.airspeed = NOMINAL_AIRSPEED;
}

if (sim_state.pos.z >= -3. && sim_state.airspeed > 0.) {
double v2 = sim_state.airspeed * sim_state.airspeed;
double vn2 = NOMINAL_AIRSPEED * NOMINAL_AIRSPEED;

// roll dynamic
double c_l = 4e-5 * sim_state.delta_roll;
double phi_dot_dot = ROLL_RESPONSE_FACTOR * c_l * v2 / vn2 - sim_state.rates.phi;
sim_state.rates.phi = sim_state.rates.phi + phi_dot_dot * fdm.curr_dt;
BoundAbs(sim_state.rates.phi, ROLL_RATE_MAX_SETPOINT);
sim_state.attitude.phi = sim_state.attitude.phi + sim_state.rates.phi * fdm.curr_dt;
NormRadAngle(sim_state.attitude.phi);
BoundAbs(sim_state.attitude.phi, ROLL_MAX_SETPOINT);

// yaw dynamic
sim_state.rates.psi = PPRZ_ISA_GRAVITY / sim_state.airspeed * tan(YAW_RESPONSE_FACTOR * sim_state.attitude.phi);
sim_state.attitude.psi = sim_state.attitude.psi + sim_state.rates.psi * fdm.curr_dt;
NormRadAngle(sim_state.attitude.psi);

// Aerodynamic pitching moment coeff, proportional to elevator
// No Thrust moment, so null (0) for steady flight
double c_m = 5e-7 * sim_state.delta_pitch;
double theta_dot_dot = PITCH_RESPONSE_FACTOR * c_m * v2 - sim_state.rates.theta;
sim_state.rates.theta = sim_state.rates.theta + theta_dot_dot * fdm.curr_dt;
sim_state.attitude.theta = sim_state.attitude.theta + sim_state.rates.theta * fdm.curr_dt;

// Flight path angle
double gamma = atan2(sim_state.speed.z, sim_state.airspeed);

// Cz proportional to angle of attack
double alpha = sim_state.attitude.theta - gamma;
double c_z = 0.2 * alpha + PPRZ_ISA_GRAVITY / vn2;

// Lift
double lift = c_z * v2;
double z_dot_dot = lift / WEIGHT * cos(sim_state.attitude.theta) * cos(sim_state.attitude.phi) - PPRZ_ISA_GRAVITY;
sim_state.speed.z = sim_state.speed.z + z_dot_dot * fdm.curr_dt;
sim_state.pos.z = sim_state.pos.z + sim_state.speed.z * fdm.curr_dt;

// Constant Cx, drag to get expected cruise and maximum throttle
double cruise_th = AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
double drag = cruise_th + (v2 - vn2) * (1. - cruise_th) / (MAXIMUM_AIRSPEED*MAXIMUM_AIRSPEED - vn2);
double airspeed_dot = MAXIMUM_POWER / sim_state.airspeed * (sim_state.delta_thrust - drag) / WEIGHT - PPRZ_ISA_GRAVITY * sin(gamma);
sim_state.airspeed = sim_state.airspeed + airspeed_dot * fdm.curr_dt;
sim_state.airspeed = Max(sim_state.airspeed, 10.); // avoid stall

// Wind effect (FIXME apply to forces ?)
sim_state.speed.x = sim_state.airspeed * sin(sim_state.attitude.psi) + sim_state.wind.x;
sim_state.speed.y = sim_state.airspeed * cos(sim_state.attitude.psi) + sim_state.wind.y;
sim_state.pos.x = sim_state.pos.x + sim_state.speed.x * fdm.curr_dt;
sim_state.pos.y = sim_state.pos.y + sim_state.speed.y * fdm.curr_dt;
sim_state.pos.z = sim_state.pos.z + sim_state.wind.z * fdm.curr_dt;
}

/****************************************************************************/
// Coordenates transformations |
// ----------------------------|

/* in ECEF */
ecef_of_enu_point_d(&fdm.ecef_pos, &ltpdef, &sim_state.pos);
lla_of_ecef_d(&fdm.lla_pos, &fdm.ecef_pos);
ecef_of_enu_vect_d(&fdm.ecef_ecef_vel, &ltpdef, &sim_state.speed);
//ecef_of_enu_vect_d(&fdm.ecef_ecef_accel, &ltpdef, &rover_acc);

/* in NED */
ned_of_ecef_point_d(&fdm.ltpprz_pos, &ltpdef, &fdm.ecef_pos);
ned_of_ecef_vect_d(&fdm.ltpprz_ecef_vel, &ltpdef, &fdm.ecef_ecef_vel);
ned_of_ecef_vect_d(&fdm.ltpprz_ecef_accel, &ltpdef, &fdm.ecef_ecef_accel);
fdm.hmsl = -fdm.ltpprz_pos.z + NAV_ALT0 / 1000.;

/* Eulers */
fdm.ltp_to_body_eulers = sim_state.attitude;
// Exporting Eulers to AHRS (in quaternions)
double_quat_of_eulers(&fdm.ltp_to_body_quat, &fdm.ltp_to_body_eulers);

// Angular vel & acc
fdm.body_ecef_rotvel.p = sim_state.rates.phi;
fdm.body_ecef_rotvel.q = sim_state.rates.theta;
fdm.body_ecef_rotvel.r = sim_state.rates.psi;
}


/**************************
** Generating LTP plane **
**************************/

static void init_ltp(void)
{

struct LlaCoor_d llh_nav0; /* Height above the ellipsoid */
llh_nav0.lat = RadOfDeg((double)NAV_LAT0 / 1e7);
llh_nav0.lon = RadOfDeg((double)NAV_LON0 / 1e7);
llh_nav0.alt = (double)(NAV_ALT0) / 1000.0;

struct EcefCoor_d ecef_nav0;

ecef_of_lla_d(&ecef_nav0, &llh_nav0);

ltp_def_from_ecef_d(&ltpdef, &ecef_nav0);
fdm.ecef_pos = ecef_nav0;

// accel and mag data should not be used
// AHRS and INS are bypassed
fdm.ltp_g.x = 0.;
fdm.ltp_g.y = 0.;
fdm.ltp_g.z = 0.;

fdm.ltp_h.x = 1.;
fdm.ltp_h.y = 0.;
fdm.ltp_h.z = 0.;

}


void nps_fdm_set_wind(double speed, double dir)
{
sim_state.wind.x = speed * sin(dir);
sim_state.wind.y = speed * cos(dir);
sim_state.wind.z = 0.;
}

void nps_fdm_set_wind_ned(double wind_north, double wind_east, double wind_down)
{
sim_state.wind.x = wind_east;
sim_state.wind.y = wind_north;
sim_state.wind.z = -wind_down;
}

void nps_fdm_set_turbulence(double wind_speed __attribute__((unused)),
int turbulence_severity __attribute__((unused)))
{
}

void nps_fdm_set_temperature(double temp __attribute__((unused)),
double h __attribute__((unused)))
{
}

2 changes: 1 addition & 1 deletion sw/simulator/nps/nps_flightgear.c
Expand Up @@ -13,7 +13,7 @@
#include <pthread.h>

#include "std.h"
#include "../flight_gear.h"
#include "flight_gear.h"
#include "nps_main.h"
#include "nps_fdm.h"
#include "nps_atmosphere.h"
Expand Down
79 changes: 23 additions & 56 deletions sw/simulator/pprzsim-launch
Expand Up @@ -50,46 +50,28 @@ def main():
action="store_true", dest="verbose")
parser.add_option("--norc", dest="norc", action="store_true",
help="Hide the simulated RC")

# special options for the fixedwing OCaml sim
ocamlsim_opts = OptionGroup(parser, "Simple fixedwing OCaml Simulator Options",
"These are only relevant to the simple fixedwing OCaml sim")
ocamlsim_opts.add_option("--boot", dest="boot", action="store_true",
help="Boot the aircraft on start")
#ocamlsim_opts.add_option("--norc", dest="norc", action="store_true",
# help="Hide the simulated RC")
ocamlsim_opts.add_option("--noground", dest="noground", action="store_true",
help="Disable ground detection")
ocamlsim_opts.add_option("--launch", dest="launch", action="store_true",
help="Launch the aircraft on startup")

# special options for NPS
nps_opts = OptionGroup(parser, "NPS Options", "These are only relevant to the NPS sim")
nps_opts.add_option("-p", "--fg_port", dest="fg_port", metavar="PORT",
type="int", default=5501, action="store",
help="Port on FlightGear host to connect to (Default: %default)")
nps_opts.add_option("-P", "--fg_port_in", dest="fg_port_in", metavar="PORT_IN",
type="int", default=5502, action="store",
help="Port to receive from FlightGear host (Default: %default)")
nps_opts.add_option("--fg_time_offset", type="int", action="store", metavar="SEC",
help="FlightGear time offset in seconds (e.g. 21600 for 6h)")
nps_opts.add_option("-j", "--js_dev", dest="js_dev", metavar="IDX",
type="int", default=-1, action="store",
help="Use joystick with specified index (e.g. 0)")
nps_opts.add_option("--spektrum_dev", type="string", action="callback",
callback=spektrum_callback, metavar="DEV",
help="Spektrum device to use (e.g. /dev/ttyUSB0)")
nps_opts.add_option("--rc_script", type="int", action="store", metavar="NO",
help="Number of RC script to use")
nps_opts.add_option("--time_factor", type="float", action="store", metavar="factor",
help="Time factor (default 1.0)")
nps_opts.add_option("--fg_fdm", action="store_true",
help="Use FlightGear native-fdm protocol instead of native-gui")
nps_opts.add_option("--nodisplay", dest="nodisplay", action="store_true",
help="Don't send NPS Ivy messages")

parser.add_option_group(ocamlsim_opts)
parser.add_option_group(nps_opts)
parser.add_option("-p", "--fg_port", dest="fg_port", metavar="PORT",
type="int", default=5501, action="store",
help="Port on FlightGear host to connect to (Default: %default)")
parser.add_option("-P", "--fg_port_in", dest="fg_port_in", metavar="PORT_IN",
type="int", default=5502, action="store",
help="Port to receive from FlightGear host (Default: %default)")
parser.add_option("--fg_time_offset", type="int", action="store", metavar="SEC",
help="FlightGear time offset in seconds (e.g. 21600 for 6h)")
parser.add_option("-j", "--js_dev", dest="js_dev", metavar="IDX",
type="int", default=-1, action="store",
help="Use joystick with specified index (e.g. 0)")
parser.add_option("--spektrum_dev", type="string", action="callback",
callback=spektrum_callback, metavar="DEV",
help="Spektrum device to use (e.g. /dev/ttyUSB0)")
parser.add_option("--rc_script", type="int", action="store", metavar="NO",
help="Number of RC script to use")
parser.add_option("--time_factor", type="float", action="store", metavar="factor",
help="Time factor (default 1.0)")
parser.add_option("--fg_fdm", action="store_true",
help="Use FlightGear native-fdm protocol instead of native-gui")
parser.add_option("--nodisplay", dest="nodisplay", action="store_true",
help="Don't send NPS Ivy messages")

(options, args) = parser.parse_args()

Expand Down Expand Up @@ -121,22 +103,7 @@ def main():

simargs = []

if options.simtype == "sim":
if options.boot:
simargs.append("-boot")
if options.norc:
simargs.append("-norc")
if options.noground:
simargs.append("-noground")
if options.launch:
simargs.append("-launch")
if options.ivy_bus:
simargs.append("-b")
simargs.append(options.ivy_bus)
if options.fg_host:
simargs.append("-fg")
simargs.append(options.fg_host)
elif (options.simtype == "nps") or (options.simtype == "hitl"):
if options.simtype in ["sim", "nps", "hitl"]:
if options.fg_host:
simargs.append("--fg_host")
simargs.append(options.fg_host)
Expand Down
325 changes: 0 additions & 325 deletions sw/simulator/sim.ml

This file was deleted.

26 changes: 0 additions & 26 deletions sw/simulator/sim.mli

This file was deleted.

65 changes: 0 additions & 65 deletions sw/simulator/simlib.ml

This file was deleted.

37 changes: 0 additions & 37 deletions sw/simulator/simlib.mli

This file was deleted.

14 changes: 0 additions & 14 deletions sw/simulator/simsitl.ml

This file was deleted.

221 changes: 0 additions & 221 deletions sw/simulator/sitl.ml

This file was deleted.

6 changes: 0 additions & 6 deletions sw/simulator/sitl.mli

This file was deleted.

20 changes: 6 additions & 14 deletions sw/supervision/python/session_widget.py
Expand Up @@ -131,20 +131,12 @@ def start_simulation(self):
# simulator is "sim"
simulator = "sim"

if simulator == "nps":
t = self.tools["Simulator"]
simu = Program.from_tool(t)
simu.args.append(Arg("-t", "nps"))
self.launch_program(simu)
datalink = Program.from_tool(self.tools["Data Link"])
datalink.args = [Arg("-udp", None), Arg("-udp_broadcast", None)]
self.launch_program(datalink)
else:
# simulator is "sim"
sim = Program.from_tool(self.tools["Simulator"])
sim.args.extend([Arg("-t", "sim"), Arg("--boot", None), Arg("--norc", None)])
self.launch_program(sim)

sim = Program.from_tool(self.tools["Simulator"])
sim.args.append(Arg("-t", simulator))
self.launch_program(sim)
datalink = Program.from_tool(self.tools["Data Link"])
datalink.args = [Arg("-udp", None), Arg("-udp_broadcast", None)]
self.launch_program(datalink)
server = Program.from_tool(self.tools["Server"])
server.args.append(Arg("-n", None))
gcs = Program.from_tool(self.tools["PprzGCS"])
Expand Down
87 changes: 0 additions & 87 deletions tests/sim/01_Microjet.t

This file was deleted.