[sim] removed launchsitl and replaced it with symlink to pprzsim-launch

This commit is contained in:
Felix Ruess
2013-01-24 13:01:44 +01:00
parent bab3e018af
commit 17c6cf2cac
7 changed files with 12 additions and 62 deletions
-1
View File
@@ -138,7 +138,6 @@
# /sw/simulator/
/sw/simulator/gaia
/sw/simulator/simhitl
/sw/simulator/launchsitl
# /sw/supervision/
/sw/supervision/gtk_process.ml
+2 -10
View File
@@ -208,18 +208,12 @@ sim: sim_static
include Makefile.lpctools
lpctools: lpc21iap usb_lib
commands: paparazzi sw/simulator/launchsitl
commands: paparazzi
paparazzi:
cat src/paparazzi | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@
chmod a+x $@
sw/simulator/launchsitl:
cat src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@
chmod a+x $@
run_sitl :
$(PAPARAZZI_HOME)/var/$(AIRCRAFT)/sim/simsitl
install :
$(MAKE) -f Makefile.install PREFIX=$(PREFIX)
@@ -238,7 +232,6 @@ clean:
$(Q)find . -mindepth 2 -name Makefile -a ! -path "./sw/ext/*" -exec sh -c 'echo "Cleaning {}"; $(MAKE) -C `dirname {}` $@' \;
$(Q)$(MAKE) -C $(EXT) clean
$(Q)find . -name '*~' -exec rm -f {} \;
$(Q)rm -f paparazzi sw/simulator/launchsitl
cleanspaces:
find sw -path sw/ext -prune -o -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \;
@@ -279,7 +272,6 @@ test: all replace_current_conf_xml run_tests restore_conf_xml
.PHONY: all print_build_version update_google_version ground_segment \
subdirs $(SUBDIRS) conf ext lib multimon cockpit tmtc tools\
static sim_static lpctools \
commands run_sitl install uninstall \
static sim_static lpctools commands install uninstall \
clean cleanspaces ab_clean dist_clean distclean dist_clean_irreversible \
test replace_current_conf_xml run_tests restore_conf_xml
+1 -1
View File
@@ -90,7 +90,7 @@ install_bin:
$(INSTALL) paparazzi-make $(PREFIX)/usr/bin/
$(INSTALLDATA) -d $(DESTDIR)/sw/simulator
$(INSTALL) sw/simulator/*.cmo $(DESTDIR)/sw/simulator
$(INSTALL) sw/simulator/launchsitl $(DESTDIR)/sw/simulator
$(INSTALL) sw/simulator/pprzsim-launch $(DESTDIR)/sw/simulator
$(INSTALL) -d $(DESTDIR)/sw/ground_segment/cockpit
$(INSTALL) -d $(DESTDIR)/sw/ground_segment/tmtc
$(INSTALL) -d $(DESTDIR)/sw/ground_segment/multimon
+1 -1
View File
@@ -49,7 +49,7 @@
<arg flag="-b" variable="ivy_bus"/>
</program>
<program name="Simulator" command="sw/simulator/ppzsim-launch">
<program name="Simulator" command="sw/simulator/pprzsim-launch">
<arg flag="-b" variable="ivy_bus"/>
</program>
-37
View File
@@ -1,37 +0,0 @@
#!OCAMLRUN OCAML
#load "unix.cma";;
let (//) = Filename.concat
let paparazzi_home =
try
Sys.getenv "PAPARAZZI_HOME"
with
_ -> Filename.concat (Sys.getenv "HOME") "paparazzi"
let () =
let n = Array.length Sys.argv in
try
let rec loop = fun i ->
if Sys.argv.(i) = "-a" && (i+1) < n then
let ac = Sys.argv.(i+1) in
(* Shift other args *)
for j = i+2 to n-1 do Sys.argv.(j-2) <- Sys.argv.(j) done;
ac
else if i = n then raise Not_found
else loop (i+1) in
let ac = loop 0 in
let rec sim_type = fun i ->
if Sys.argv.(i) = "-jsbsim" then "jsbsim"
else if i = (n-2) then "sim"
else sim_type (i+1) in
let sim = sim_type 0 in
let com = paparazzi_home // "var" // ac // sim // "simsitl" in
if not (Sys.file_exists com) then begin
Printf.fprintf stderr "Error: '%s' is missing. Build target sim for A/C %s ?\n" com ac;
exit 1
end;
let args = Array.sub Sys.argv 0 (n-2) in
args.(0) <- com;
prerr_endline com;
Unix.execv com args
with _ ->
failwith "Usage: launchsitl -a <ac_name> <options>"
+1 -5
View File
@@ -53,7 +53,7 @@ VARINCLUDE=$(PAPARAZZI_HOME)/var/include
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
all : gaia sitl.cma $(LAUNCHSITL) simhitl
all : gaia sitl.cma simhitl
simhitl : fg.o $(SIMHCMO) simhitl.cmo
@echo OL $@
@@ -90,10 +90,6 @@ diffusion : stdlib.cmo diffusion.cmo
@echo OC $<
$(Q)$(OCAMLC) $(INCLUDES) -c $<
launchsitl :
cat ../../src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@
chmod a+x $@
# dependency on lib-pprz
simhitl diffusion gaia: $(LIBPPRZCMA)
+7 -7
View File
@@ -25,12 +25,12 @@ my $server = Proc::Background->new($server_command, @server_options);
sleep 2; # The service should die in this time if there's an error
ok($server->alive(), "The server process started successfully");
# Start the launchsitl process
my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl";
my @launchsitl_options = qw(-a Microjet -boot -norc);
# Start the pprzsim-launch process
my $pprzsim_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/pprzsim-launch";
my @pprzsim_options = qw(-a Microjet --boot --norc);
sleep 2; # The service should die in this time if there's an error
my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options);
ok($launchsitl->alive(), "The launchsitl process started successfully");
my $pprzsim = Proc::Background->new($pprzsim_command, @pprzsim_options);
ok($pprzsim->alive(), "The pprzsim-launch process started successfully");
# Open the Ivy bus and read from it...
SKIP : {
@@ -39,9 +39,9 @@ SKIP : {
# TODO: learn how to read and write to the Ivy bus
}
# Shutdown the server and launchsitl processes
# Shutdown the server and pprzsim-launch processes
ok($server->die(), "The server process shutdown successfully.");
ok($launchsitl->die(), "The launchsitl process shutdown successfully.");
ok($pprzsim->die(), "The pprzsim-launch process shutdown successfully.");
################################################################################
# functions used by this test script.