diff --git a/.gitignore b/.gitignore
index 9c0e518c98..08da500ec8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,6 +59,8 @@
/sw/ground_segment/cockpit/gtk_setting_time.ml
/sw/ground_segment/cockpit/gcs
/sw/ground_segment/cockpit/gtk_strip.ml
+/sw/ground_segment/cockpit/ant_track
+
# /sw/ground_segment/lpc21iap/
/sw/ground_segment/lpc21iap/lpc21iap
@@ -81,11 +83,15 @@
/sw/ground_segment/tmtc/server
/sw/ground_segment/tmtc/diadec
/sw/ground_segment/misc/ivy2serial
+/sw/ground_segment/tmtc/GSM/SMS_GS
# /sw/ground_segment/joystick
/sw/ground_segment/joystick/input2ivy
/sw/ground_segment/joystick/test_stick
+/sw/in_progress/fdm/fdm_step
+/sw/in_progress/fdm/fms_steps_attitude
+
# /sw/lib/ocaml/
/sw/lib/ocaml/gtk_papget_editor.ml
/sw/lib/ocaml/gtk_papget_text_editor.ml
@@ -103,6 +109,13 @@
/sw/logalizer/gtk_export.ml
/sw/logalizer/sd2log
/sw/logalizer/plotprofile
+/sw/logalizer/ahrsview
+/sw/logalizer/ctrlstick
+/sw/logalizer/ffjoystick
+/sw/logalizer/imuview
+/sw/logalizer/ivy_example
+/sw/logalizer/motor_bench
+/sw/logalizer/tmclient
# /sw/simulator/
/sw/simulator/gaia
diff --git a/Makefile b/Makefile
index 8ca30a80ec..1ad6f073ee 100644
--- a/Makefile
+++ b/Makefile
@@ -61,14 +61,23 @@ UBX_XML = $(CONF)/ubx.xml
MTK_XML = $(CONF)/mtk.xml
XSENS_XML = $(CONF)/xsens_MTi-G.xml
TOOLS=$(PAPARAZZI_SRC)/sw/tools
+OCAML=$(shell which ocaml)
+OCAMLRUN=$(shell which ocamlrun)
+
+# try to find the paparazzi multilib toolchain
+TOOLCHAIN_DIR=$(shell find -L /opt/paparazzi/arm-multilib ~/sat -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1 | xargs dirname )
+ifneq ($(TOOLCHAIN_DIR),)
+#found the compiler from the paparazzi multilib package
+ARMGCC=$(TOOLCHAIN_DIR)/bin/arm-none-eabi-gcc
+else
+#try picking up the arm-none-eabi compiler from the path, otherwise use arm-elf
HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc)
ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),)
ARMGCC=$(shell which arm-elf-gcc)
else
ARMGCC=$(HAVE_ARM_NONE_EABI_GCC)
endif
-OCAML=$(shell which ocaml)
-OCAMLRUN=$(shell which ocamlrun)
+endif
all: conf commands static
diff --git a/Makefile.ac b/Makefile.ac
index 3e8d6c7ec1..3d04b1aa22 100644
--- a/Makefile.ac
+++ b/Makefile.ac
@@ -71,8 +71,9 @@ endif
all_ac_h: $(AIRFRAME_H) $(MODULES_H) $(SETTINGS_H) $(TUNING_H) $(MAKEFILE_AC) $(PERIODIC_H)
- @echo "TARGET: " $(TARGET) "\n" > $(ACINCLUDE)/$(TARGET)_srcs.list
- @echo "CFLAGS: " $($(TARGET).CFLAGS) "\n" >> $(ACINCLUDE)/$(TARGET)_srcs.list
+ @echo "TARGET: " $(TARGET)"\n" > $(ACINCLUDE)/$(TARGET)_srcs.list
+ @echo "CFLAGS: " $($(TARGET).CFLAGS)"\n" >> $(ACINCLUDE)/$(TARGET)_srcs.list
+ @echo "LDFLAGS: " $($(TARGET).LDFLAGS)"\n" >> $(ACINCLUDE)/$(TARGET)_srcs.list
@echo "srcs: " $($(TARGET).srcs) >> $(ACINCLUDE)/$(TARGET)_srcs.list
radio_ac_h : $(RADIO_H)
diff --git a/conf/Makefile.jsbsim b/conf/Makefile.jsbsim
index b09675fc0e..97ee1663b5 100644
--- a/conf/Makefile.jsbsim
+++ b/conf/Makefile.jsbsim
@@ -1,5 +1,5 @@
# Hey Emacs, this is a -*- makefile -*-
-#
+#
# $Id: Makefile.sim 3505 2009-06-17 12:59:32Z hecto $
# Copyright (C) 2006 Pascal Brisset, Antoine Drouin
#
@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
#
# This is the Makefile for the JSBSim target.
@@ -93,8 +93,8 @@ $(OBJDIR)/.depend:
@echo DEPEND $@
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),erase)
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),erase)
-include $(OBJDIR)/.depend
endif
endif
diff --git a/conf/Makefile.lpc21 b/conf/Makefile.lpc21
index 4f1b034859..1a8ae8eaef 100644
--- a/conf/Makefile.lpc21
+++ b/conf/Makefile.lpc21
@@ -31,25 +31,51 @@
# only define here or elsewhere?
SRC_ARCH = arch/lpc21
-# Define programs and commands.
+
+# Programs location
+# try to find the paparazzi multilib toolchain
+TOOLCHAIN_DIR=$(shell find -L /opt/paparazzi/arm-multilib ~/sat -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1 | xargs dirname )
+
+#
+# found the new paparazzi toolchain, use it
+#
+ifneq ($(TOOLCHAIN_DIR),)
+GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin
+GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib
+GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi
+CC = $(GCC_BIN_PREFIX)-gcc
+LD = $(GCC_BIN_PREFIX)-gcc
+OBJCOPY = $(GCC_BIN_PREFIX)-objcopy
+OBJDUMP = $(GCC_BIN_PREFIX)-objdump
+NM = $(GCC_BIN_PREFIX)-nm
+SIZE = $(GCC_BIN_PREFIX)-size
+OOCD = $(TOOLCHAIN_DIR)/bin/openocd
+
+#
+# If we can't find the toolchain (in /opt/paparazzi/arm-multilib or ~/sat) then try picking up the compilers from the path
+#
+else
+
+# see if we can find the new arm-none-eabi, otherwise use the older arm-elf
HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc)
ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),)
-CC = arm-elf-gcc
-LD = $(CC)
-SHELL = sh
-OBJCOPY = arm-elf-objcopy
-OBJDUMP = arm-elf-objdump
-SIZE = arm-elf-size
-NM = arm-elf-nm
+GCC_PREFIX = arm-elf
else
-CC = arm-none-eabi-gcc
-LD = $(CC)
-SHELL = sh
-OBJCOPY = arm-none-eabi-objcopy
-OBJDUMP = arm-none-eabi-objdump
-SIZE = arm-none-eabi-size
-NM = arm-none-eabi-nm
+GCC_PREFIX = arm-none-eabi
+GCC_LIB_DIR=$(shell dirname `which arm-none-eabi-gcc`)/../arm-none-eabi/lib
endif
+
+CC = $(shell which $(GCC_PREFIX)-gcc)
+LD = $(shell which $(GCC_PREFIX)-gcc)
+OBJCOPY = $(shell which $(GCC_PREFIX)-objcopy)
+OBJDUMP = $(shell which $(GCC_PREFIX)-objdump)
+NM = $(shell which $(GCC_PREFIX)-nm)
+SIZE = $(shell which $(GCC_PREFIX)-size)
+OOCD = $(shell which openocd)
+endif
+
+# Define some other programs and commands.
+SHELL = sh
REMOVE = rm -f
COPY = cp
@@ -87,7 +113,7 @@ CINCS = $(INCLUDES) -I $(SRC_ARCH)/include
CFLAGS = $(CINCS)
CFLAGS += -O$(OPT)
# CFLAGS += -malignment-traps
-CFLAGS += -Wall -Wcast-qual -Wimplicit -Wcast-align -Winline
+CFLAGS += -Wall -Wcast-qual -Wimplicit -Wcast-align
CFLAGS += -Wpointer-arith -Wswitch
CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused
CFLAGS += -Wa,-adhlns=$(OBJDIR)/$(notdir $(subst $(suffix $<),.lst,$<))
diff --git a/conf/Makefile.omap b/conf/Makefile.omap
index 51ca86d5eb..ed065c5dca 100644
--- a/conf/Makefile.omap
+++ b/conf/Makefile.omap
@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Define programs and commands.
@@ -56,17 +56,17 @@ CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused
# flags only for C
CFLAGS + = -Wstrict-prototypes -Wmissing-declarations
-CFLAGS += -Wmissing-prototypes -Wnested-externs
+CFLAGS += -Wmissing-prototypes -Wnested-externs
CFLAGS += $(CSTANDARD)
-CFLAGS += $($(TARGET).CFLAGS)
+CFLAGS += $($(TARGET).CFLAGS)
CXX = /opt/paparazzi/omap/overo-oe/tmp/sysroots/i686-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-g++
CXXFLAGS = -pipe -O3 -fshow-column -ffast-math -fPIC
-CXXFLAGS += -g -ffunction-sections -fdata-sections
+CXXFLAGS += -g -ffunction-sections -fdata-sections
CXXFLAGS += -mfloat-abi=softfp -mtune=cortex-a8 -mfpu=vfp -march=armv7-a
CXXFLAGS += -Wall -Wextra
-CXXFLAGS += $($(TARGET).CXXFLAGS)
+CXXFLAGS += $($(TARGET).CXXFLAGS)
SRC_C_OMAP = $($(TARGET).srcs)
@@ -81,7 +81,7 @@ build: elf
elf: $(OBJDIR)/$(TARGET).elf
-# Program the device.
+# Program the device.
load upload program: $(OBJDIR)/$(TARGET).elf
scp $(OBJDIR)/$(TARGET).elf $(USER)@$(HOST):$(TARGET_DIR)
@@ -91,20 +91,20 @@ load upload program: $(OBJDIR)/$(TARGET).elf
%.elf: $(OBJ_C_OMAP) $(OBJ_CPP_OMAP)
@echo LD $@
$(Q)if (expr "$($(TARGET).cpp_srcs)"); \
- then $(CXX) $(CXXFLAGS) $(OBJ_CPP_OMAP) $(OBJ_C_OMAP) --output $@ $(LDFLAGS) $($(TARGET).LDFLAGS); \
- else $(CC) $(CFLAGS) $(OBJ_C_OMAP) --output $@ $(LDFLAGS) $($(TARGET).LDFLAGS); fi
+ then $(CXX) $(CXXFLAGS) $(OBJ_CPP_OMAP) $(OBJ_C_OMAP) --output $@ $(LDFLAGS) $($(TARGET).LDFLAGS); \
+ else $(CC) $(CFLAGS) $(OBJ_C_OMAP) --output $@ $(LDFLAGS) $($(TARGET).LDFLAGS); fi
# Compile: create object files from C source files
$(OBJDIR)/%.o : %.c $(OBJDIR)/../Makefile.ac
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
- $(Q)$(CC) -c $(CFLAGS) $< -o $@
+ $(Q)$(CC) -c $(CFLAGS) $< -o $@
# Compile: create object files from C++ source files
$(OBJDIR)/%.o : %.cpp $(OBJDIR)/../Makefile.ac
@echo CXX $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
- $(Q)$(CXX) -c $(CXXFLAGS) $< -o $@
+ $(Q)$(CXX) -c $(CXXFLAGS) $< -o $@
# Listing of phony targets.
.PHONY : all build elf clean clean_list
@@ -118,8 +118,8 @@ $(OBJDIR)/.depend:
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),erase)
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),erase)
-include $(OBJDIR)/.depend
endif
endif
diff --git a/conf/Makefile.pentium-m b/conf/Makefile.pentium-m
index a6a6f4712e..bd42bc5476 100644
--- a/conf/Makefile.pentium-m
+++ b/conf/Makefile.pentium-m
@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Define programs and commands.
CC = gcc
@@ -54,9 +54,9 @@ CFLAGS += -m32
# flags only for C
CFLAGS += -Wstrict-prototypes -Wmissing-declarations
-CFLAGS += -Wmissing-prototypes -Wnested-externs
+CFLAGS += -Wmissing-prototypes -Wnested-externs
CFLAGS += $(CSTANDARD)
-CFLAGS += $($(TARGET).CFLAGS) $(LOCAL_CFLAGS)
+CFLAGS += $($(TARGET).CFLAGS) $(LOCAL_CFLAGS)
#Additional libraries.
MATH_LIB = -lm
@@ -72,7 +72,7 @@ build: elf
elf: $(OBJDIR)/$(TARGET).elf
-# Program the device.
+# Program the device.
load upload program: $(OBJDIR)/$(TARGET).elf
ifdef USER
ssh $(USER)@$(HOST) "sudo mount -o remount,rw /"
@@ -93,7 +93,7 @@ endif
$(OBJDIR)/%.o : %.c $(OBJDIR)/../Makefile.ac
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
- $(Q)$(CC) -c $(CFLAGS) $< -o $@
+ $(Q)$(CC) -c $(CFLAGS) $< -o $@
# Listing of phony targets.
.PHONY : all build elf clean clean_list
@@ -107,8 +107,8 @@ $(OBJDIR)/.depend:
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),erase)
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),erase)
-include $(OBJDIR)/.depend
endif
endif
diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32
index be9a360e33..817d936867 100644
--- a/conf/Makefile.stm32
+++ b/conf/Makefile.stm32
@@ -38,7 +38,7 @@ OPT = s
#OPT = 0
# Programs location
-TOOLCHAIN_DIR=$(shell find -L ~/sat /opt/paparazzi/stm32 -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1 | xargs dirname )
+TOOLCHAIN_DIR=$(shell find -L /opt/paparazzi/arm-multilib ~/sat /opt/paparazzi/stm32 -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1 | xargs dirname )
GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib
@@ -254,8 +254,8 @@ endif
start_gdb:
xterm -e "$(OOCD) -f interface/$(OOCD_INTERFACE).cfg -f target/$(OOCD_TARGET).cfg" &
- xterm -e "/opt/paparazzi/stm32/bin/openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg"&
- xterm -e "/opt/paparazzi/stm32/bin/openocd -f interface/flossjtag.cfg -f board/lisa-l.cfg"&
+ xterm -e "$(OOCD) -f interface/lisa-l.cfg -f board/lisa-l.cfg"&
+ xterm -e "$(OOCD) -f interface/flossjtag.cfg -f board/lisa-l.cfg"&
start_telnet:
xterm -e "telnet localhost 4444" &
diff --git a/conf/airframes/Poine/fuckyou.xml b/conf/airframes/Poine/fuckyou.xml
deleted file mode 100644
index f8b4617694..0000000000
--- a/conf/airframes/Poine/fuckyou.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- HOST=auto3
-
-
- # test 1
- test42.ARCHDIR = omap
- test42.CFLAGS += -I$(ACINCLUDE) -I. -I$(PAPARAZZI_HOME)/var/include
- test42.srcs = fms/libeknav/hello_world.c
-# test1.srcs += fms/bla.c
-
-
-
-
-
-
-
-
diff --git a/conf/airframes/Poine/turntable.xml b/conf/airframes/Poine/turntable.xml
index ae8f5a4f37..a0d389e319 100644
--- a/conf/airframes/Poine/turntable.xml
+++ b/conf/airframes/Poine/turntable.xml
@@ -5,7 +5,7 @@ ARCH=lpc21
FLASH_MODE = IAP
-MB=motor_bench
+MB=firmwares/motor_bench
main.ARCHDIR = $(ARCH)
@@ -13,6 +13,8 @@ main.CFLAGS += -DBOARD_CONFIG=\"boards/olimex_lpc_h2148.h\" -I$(MB)
main.CFLAGS += -DPERIPHERALS_AUTO_INIT
main.srcs = $(MB)/main_turntable.c
main.srcs += $(SRC_ARCH)/armVIC.c
+main.srcs += mcu.c
+main.srcs += $(SRC_ARCH)/mcu_arch.c
main.CFLAGS += -DUSE_LED
main.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1
@@ -25,6 +27,7 @@ main.srcs += sys_time.c $(MB)/turntable_systime.c
#main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=UsbS
main.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B115200
+main.srcs += mcu_periph/uart.c
main.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
main.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart0
diff --git a/conf/airframes/flixr_discovery.xml b/conf/airframes/flixr_discovery.xml
index 15e4822406..2f4019f0cc 100644
--- a/conf/airframes/flixr_discovery.xml
+++ b/conf/airframes/flixr_discovery.xml
@@ -32,6 +32,7 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation
+
diff --git a/conf/airframes/Poine/autoplato.xml b/conf/airframes/obsolete/autoplato.xml
similarity index 100%
rename from conf/airframes/Poine/autoplato.xml
rename to conf/airframes/obsolete/autoplato.xml
diff --git a/conf/airframes/Poine/booz2_a2.xml b/conf/airframes/obsolete/booz2_a2.xml
similarity index 100%
rename from conf/airframes/Poine/booz2_a2.xml
rename to conf/airframes/obsolete/booz2_a2.xml
diff --git a/conf/airframes/Poine/booz2_a3.xml b/conf/airframes/obsolete/booz2_a3.xml
similarity index 100%
rename from conf/airframes/Poine/booz2_a3.xml
rename to conf/airframes/obsolete/booz2_a3.xml
diff --git a/conf/airframes/Poine/booz2_a4.xml b/conf/airframes/obsolete/booz2_a4.xml
similarity index 100%
rename from conf/airframes/Poine/booz2_a4.xml
rename to conf/airframes/obsolete/booz2_a4.xml
diff --git a/conf/airframes/Poine/booz2_a5.xml b/conf/airframes/obsolete/booz2_a5.xml
similarity index 100%
rename from conf/airframes/Poine/booz2_a5.xml
rename to conf/airframes/obsolete/booz2_a5.xml
diff --git a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
index 5df712f8aa..34a12e0fa7 100644
--- a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
+++ b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile
@@ -1 +1 @@
-$(error Attitude estimation via infrared has been implemented as an AHRS subsystem now. Please replace with and add the module in your airframe file.)
+$(error Attitude estimation via infrared has been implemented as an AHRS subsystem now. Please replace with and add the module in your airframe file.)
diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile
index e5b985c325..16c9df0af2 100644
--- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile
+++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile
@@ -215,7 +215,7 @@ jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c $(SIMDIR)/sim_a
# external libraries
jsbsim.CFLAGS += -I$(SIMDIR) -I/usr/include -I$(JSBSIM_INC) -I$(OCAMLLIBDIR) `pkg-config glib-2.0 --cflags`
-jsbsim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/usr/lib -lJSBSim
+jsbsim.LDFLAGS += `pkg-config glib-2.0 --libs` -lglibivy -lm -L/usr/lib -lJSBSim
jsbsim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
jsbsim.srcs += downlink.c $(SRC_FIRMWARE)/datalink.c $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/jsbsim_transport.c
diff --git a/conf/autopilot/subsystems/fixedwing/settings_rc.makefile b/conf/autopilot/subsystems/fixedwing/settings_rc.makefile
new file mode 100644
index 0000000000..c372f43b17
--- /dev/null
+++ b/conf/autopilot/subsystems/fixedwing/settings_rc.makefile
@@ -0,0 +1,6 @@
+# Hey Emacs, this is a -*- makefile -*-
+
+# change settings via Remote Control, e.g. tune your aircraft
+
+$(TARGET).srcs += rc_settings.c
+$(TARGET).CFLAGS += -DRADIO_CONTROL_SETTINGS
diff --git a/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile b/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile
index ae74dc22a8..a2d817dc86 100644
--- a/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile
@@ -13,3 +13,8 @@ AHRS_SRCS += subsystems/ahrs.c
AHRS_SRCS += subsystems/ahrs/ahrs_int_cmpl_euler.c
AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
+ap.CFLAGS += $(AHRS_CFLAGS)
+ap.srcs += $(AHRS_SRCS)
+
+sim.CFLAGS += $(AHRS_CFLAGS)
+sim.srcs += $(AHRS_SRCS)
diff --git a/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile b/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile
index 25386fd627..1eb08fc6ac 100644
--- a/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile
@@ -21,5 +21,3 @@ ap.srcs += $(AHRS_SRCS)
sim.CFLAGS += $(AHRS_CFLAGS)
sim.srcs += $(AHRS_SRCS)
-
-
diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
index 1ddafe759c..491150d7eb 100644
--- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
+++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
@@ -21,7 +21,7 @@ sim.ARCHDIR = $(ARCH)
sim.CFLAGS += -DSITL -DUSE_NPS
sim.CFLAGS += `pkg-config glib-2.0 --cflags`
-sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -lgsl -lgslcblas
+sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lglibivy -lgsl -lgslcblas
sim.CFLAGS += -I$(NPSDIR) -I$(SRC_FIRMWARE) -I$(SRC_BOARD) -I../simulator -I$(PAPARAZZI_HOME)/conf/simulator/nps
# use the paparazzi-jsbsim package if it is installed, otherwise look for JSBsim under /opt/jsbsim
diff --git a/conf/conf.xml.example b/conf/conf.xml.example
index de5832bada..69d70d82b6 100644
--- a/conf/conf.xml.example
+++ b/conf/conf.xml.example
@@ -16,17 +16,6 @@
gui_color="white"
/>
-
-
-
+
diff --git a/conf/modules/infrared_i2c.xml b/conf/modules/infrared_i2c.xml
index b8c523a258..6928de4a13 100644
--- a/conf/modules/infrared_i2c.xml
+++ b/conf/modules/infrared_i2c.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/conf/settings/tuning_ins_rc.xml b/conf/settings/tuning_ins_rc.xml
new file mode 100644
index 0000000000..2249537bd2
--- /dev/null
+++ b/conf/settings/tuning_ins_rc.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/conf/telemetry/default.xml b/conf/telemetry/default.xml
index 33e5b3119c..6cde67ad03 100644
--- a/conf/telemetry/default.xml
+++ b/conf/telemetry/default.xml
@@ -20,6 +20,7 @@
+
diff --git a/conf/telemetry/default_fixedwing_imu.xml b/conf/telemetry/default_fixedwing_imu.xml
index 28e3f604b0..f1a70731a9 100644
--- a/conf/telemetry/default_fixedwing_imu.xml
+++ b/conf/telemetry/default_fixedwing_imu.xml
@@ -20,6 +20,7 @@
+
diff --git a/conf/telemetry/default_fixedwing_imu_9k6.xml b/conf/telemetry/default_fixedwing_imu_9k6.xml
index 0a0b6c80d9..02087f6deb 100644
--- a/conf/telemetry/default_fixedwing_imu_9k6.xml
+++ b/conf/telemetry/default_fixedwing_imu_9k6.xml
@@ -20,6 +20,7 @@
+
diff --git a/sw/airborne/arch/lpc21/lpcusb/Makefile b/sw/airborne/arch/lpc21/lpcusb/Makefile
index 505dae4dbc..62c70f9397 100644
--- a/sw/airborne/arch/lpc21/lpcusb/Makefile
+++ b/sw/airborne/arch/lpc21/lpcusb/Makefile
@@ -5,24 +5,46 @@ PKG_NAME = target
DATE = $$(date +%Y%m%d)
# Tool definitions
-HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc)
+# try to find the paparazzi multilib toolchain
+TOOLCHAIN_DIR=$(shell find -L /opt/paparazzi/arm-multilib ~/sat -maxdepth 1 -type d -name arm-none-eabi 2>/dev/null | head -n 1 | xargs dirname )
-ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),)
-CC = arm-elf-gcc
-LD = arm-elf-ld -v
-AR = arm-elf-ar
-AS = arm-elf-as
-CP = arm-elf-objcopy
-OD = arm-elf-objdump
+#
+# found the new paparazzi toolchain, use it
+#
+ifneq ($(TOOLCHAIN_DIR),)
+GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin
+GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib
+GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi
+CC = $(GCC_BIN_PREFIX)-gcc
+LD = $(GCC_BIN_PREFIX)-ld -v
+AR = $(GCC_BIN_PREFIX)-ar
+AS = $(GCC_BIN_PREFIX)-as
+CP = $(GCC_BIN_PREFIX)-objcopy
+OD = $(GCC_BIN_PREFIX)-objdump
+
+#
+# If we can't find the toolchain (in /opt/paparazzi/arm-multilib or ~/sat) then try picking up the compilers from the path
+#
else
-CC=arm-none-eabi-gcc
-LD=arm-none-eabi-ld -v
-AR=arm-none-eabi-ar
-AS=arm-none-eabi-ar
-CP=arm-none-eabi-objcopy
-OD=arm-none-eabi-objdump
+
+# see if we can find the new arm-none-eabi, otherwise use the older arm-elf
+HAVE_ARM_NONE_EABI_GCC := $(shell which arm-none-eabi-gcc)
+ifeq ($(strip $(HAVE_ARM_NONE_EABI_GCC)),)
+GCC_PREFIX = arm-elf
+else
+GCC_PREFIX = arm-none-eabi
+GCC_LIB_DIR=$(shell dirname `which arm-none-eabi-gcc`)/../arm-none-eabi/lib
endif
+CC = $(shell which $(GCC_PREFIX)-gcc)
+LD = $(shell which $(GCC_PREFIX)-ld) -v
+AR = $(shell which $(GCC_PREFIX)-ar)
+AS = $(shell which $(GCC_PREFIX)-as)
+CP = $(shell which $(GCC_PREFIX)-objcopy)
+OD = $(shell which $(GCC_PREFIX)-objdump)
+endif
+
+# Define some other programs and commands.
RM = rm
TAR = tar
diff --git a/sw/airborne/boards/tiny_1.1.h b/sw/airborne/boards/tiny_1.1.h
index 9f0d40070e..bec08225e0 100644
--- a/sw/airborne/boards/tiny_1.1.h
+++ b/sw/airborne/boards/tiny_1.1.h
@@ -10,9 +10,16 @@
/* CPU clock freq. */
#define CCLK (FOSC * PLL_MUL)
+#ifdef USE_USB_HIGH_PCLK
+/* Peripheral bus speed mask 0x00-> 4, 0x01-> 1, 0x02-> 2 */
+/* change both PBSD_BITS/VAL 15MHz, 60MHz, 30MHz */
+#define PBSD_BITS 0x02
+#define PBSD_VAL 2
+#else
/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
#define PBSD_BITS 0x00
#define PBSD_VAL 4
+#endif
/* Peripheral bus clock freq. */
#define PCLK (CCLK / PBSD_VAL)
diff --git a/sw/airborne/firmwares/fixedwing/autopilot.h b/sw/airborne/firmwares/fixedwing/autopilot.h
index 850e9c1c37..68f2a08bcc 100644
--- a/sw/airborne/firmwares/fixedwing/autopilot.h
+++ b/sw/airborne/firmwares/fixedwing/autopilot.h
@@ -33,6 +33,7 @@
#include
#include "std.h"
#include "sys_time.h"
+#include "estimator.h"
#define TRESHOLD_MANUAL_PPRZ (MIN_PPRZ / 2)
diff --git a/sw/airborne/firmwares/motor_bench/main_turntable.c b/sw/airborne/firmwares/motor_bench/main_turntable.c
index 8345c948e7..8ea42385e6 100644
--- a/sw/airborne/firmwares/motor_bench/main_turntable.c
+++ b/sw/airborne/firmwares/motor_bench/main_turntable.c
@@ -4,6 +4,8 @@
#include "led.h"
#include "interrupt_hw.h"
#include "mcu_periph/usb_serial.h"
+#include "mcu_periph/uart.h"
+#include "mcu_arch.h"
#include "messages.h"
#include "downlink.h"
diff --git a/sw/airborne/firmwares/motor_bench/mb_tacho.c b/sw/airborne/firmwares/motor_bench/mb_tacho.c
index 31e26ae80d..37d37c1c52 100644
--- a/sw/airborne/firmwares/motor_bench/mb_tacho.c
+++ b/sw/airborne/firmwares/motor_bench/mb_tacho.c
@@ -3,6 +3,7 @@
#include "LPC21xx.h"
#include "interrupt_hw.h"
+#include "mcu.h"
volatile uint32_t mb_tacho_duration;
volatile uint8_t got_one_pulse;
diff --git a/sw/airborne/rc_settings.c b/sw/airborne/rc_settings.c
index 91cdc614e7..d64857a4b4 100644
--- a/sw/airborne/rc_settings.c
+++ b/sw/airborne/rc_settings.c
@@ -25,8 +25,8 @@
#include
-#include "rc_settings.h"
#include "generated/radio.h"
+#include "rc_settings.h"
#include "autopilot.h"
#include "subsystems/nav.h"
#include "subsystems/sensors/infrared.h"
diff --git a/sw/airborne/rc_settings.h b/sw/airborne/rc_settings.h
index 0cbd78de78..2fd8677e25 100644
--- a/sw/airborne/rc_settings.h
+++ b/sw/airborne/rc_settings.h
@@ -28,11 +28,8 @@
*
* The 'rc_control' section of a XML flight plan allows the user to change the
* value of an autopilot internal variable through the rc transmitter.
- * C code is generated from this XML code (var/AC/inflight_calib.h). This
- * module handles the control of this setting mode.
+ * This module handles the control of this setting mode.
*
- * Note that this functionnality is deprecated since datalink use is a lot more
- * easier ('dl_settings' section)
*/
#ifndef RC_SETTINGS_H
@@ -46,6 +43,10 @@
#define RC_SETTINGS_MODE_DOWN 1
#define RC_SETTINGS_MODE_UP 2
+extern uint8_t rc_settings_mode;
+
+void rc_settings(bool_t mode_changed);
+
#define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE)
#define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < TRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
@@ -55,9 +56,6 @@
#define RcSettingsModeUpdate(_rc_channels) \
ModeUpdate(rc_settings_mode, RC_SETTINGS_MODE_OF_PULSE(_rc_channels[RADIO_CALIB]))
-extern uint8_t rc_settings_mode;
-void rc_settings(bool_t mode_changed);
-
#else /* RADIO_CALIB && defined RADIO_CONTROL_SETTINGS */
diff --git a/sw/airborne/test/ahrs/Makefile b/sw/airborne/test/ahrs/Makefile
index 2cde23ddab..35d01ecc24 100644
--- a/sw/airborne/test/ahrs/Makefile
+++ b/sw/airborne/test/ahrs/Makefile
@@ -131,7 +131,7 @@ run_ahrs_on_synth: run_ahrs_on_synth.c $(RAOS_SRCS) $(AHRS_SRCS)
$(Q) $(CC) $(CFLAGS) $(AHRS_CFLAGS) -o $@ $^ $(LDFLAGS)
IVY_CFLAGS=-g -O2 -Wall `pkg-config glib-2.0 --cflags`
-IVY_LDFLAGS=`pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+IVY_LDFLAGS=`pkg-config glib-2.0 --libs` -lglibivy
run_ahrs_on_synth_ivy: run_ahrs_on_synth_ivy.c $(RAOS_SRCS) $(AHRS_SRCS)
$(CC) $(CFLAGS) $(AHRS_CFLAGS) $(IVY_CFLAGS) -o $@ $^ $(LDFLAGS) $(IVY_LDFLAGS)
diff --git a/sw/ground_segment/cockpit/Makefile b/sw/ground_segment/cockpit/Makefile
index 76cd97c91c..23e70557a0 100644
--- a/sw/ground_segment/cockpit/Makefile
+++ b/sw/ground_segment/cockpit/Makefile
@@ -96,7 +96,7 @@ clean:
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags` $(FPIC)
-LDFLAGS=`pkg-config gtk+-2.0 --libs` -s `pcre-config --libs` -lglibivy
+LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lglibivy
ant_track : ant_track.c
diff --git a/sw/ground_segment/joystick/Makefile b/sw/ground_segment/joystick/Makefile
index 7c56f9f226..54c8459665 100644
--- a/sw/ground_segment/joystick/Makefile
+++ b/sw/ground_segment/joystick/Makefile
@@ -1,4 +1,4 @@
-#
+#
# $Id$
# Copyright (C) 2004 Pascal Brisset, Antoine Drouin
#
@@ -17,8 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Quiet compilation
Q=@
@@ -32,7 +32,7 @@ LIBPPRZCMA=$(OCAMLLIB)/lib-pprz.cma
all: test_stick input2ivy
test_stick: test_stick.o
- gcc -g -O2 -Wall -DSTICK_DBG `pkg-config glib-2.0 --cflags` -o $@ $^ usb_stick.c `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+ gcc -g -O2 -Wall -DSTICK_DBG `pkg-config glib-2.0 --cflags` -o $@ $^ usb_stick.c `pkg-config glib-2.0 --libs` -lglibivy
input2ivy: usb_stick.o ml_usb_stick.o input2ivy.cmo
$(OCAMLC) $(OCAMLINCLUDES) -custom -o $@ unix.cma str.cma glibivy-ocaml.cma xml-light.cma lib-pprz.cma lablgtk.cma $(TOOLSDIR)/fp_proc.cmo $^
@@ -47,4 +47,3 @@ input2ivy: usb_stick.o ml_usb_stick.o input2ivy.cmo
clean:
rm -f *~ core *.o *.bak .depend test_stick *.cmo *.cmi input2ivy
-
diff --git a/sw/ground_segment/tmtc/GSM/Makefile b/sw/ground_segment/tmtc/GSM/Makefile
index 24b1c40996..e731282280 100644
--- a/sw/ground_segment/tmtc/GSM/Makefile
+++ b/sw/ground_segment/tmtc/GSM/Makefile
@@ -1,7 +1,7 @@
all: SMS_GS
SMS_GS: SMS_Ground_UDtest_final.c
- gcc -g -O2 -Wall `pkg-config --cflags glib-2.0 gtk+-2.0` -L/usr/lib -lglibivy -o SMS_GS SMS_Ground_UDtest_final.c `pkg-config --libs glib-2.0 gtk+-2.0` `pcre-config --libs` -lglibivy
+ gcc -g -O2 -Wall `pkg-config --cflags glib-2.0 gtk+-2.0` -L/usr/lib -lglibivy -o SMS_GS SMS_Ground_UDtest_final.c `pkg-config --libs glib-2.0 gtk+-2.0` -lglibivy
clean:
rm SMS_GS
diff --git a/sw/ground_segment/tmtc/aircraft.ml b/sw/ground_segment/tmtc/aircraft.ml
index 773637af6c..b65a7a11f6 100644
--- a/sw/ground_segment/tmtc/aircraft.ml
+++ b/sw/ground_segment/tmtc/aircraft.ml
@@ -61,6 +61,12 @@ let svinfo_init = fun () ->
age = 0
}
+type inflight_calib = {
+ mutable if_mode : int; (* DOWN|OFF|UP *)
+ mutable if_val1 : float;
+ mutable if_val2 : float
+ }
+
type horiz_mode =
Circle of Latlong.geographic * int
| Segment of Latlong.geographic * Latlong.geographic
@@ -151,7 +157,8 @@ type aircraft = {
mutable survey : (Latlong.geographic * Latlong.geographic) option;
mutable last_msg_date : float;
mutable time_since_last_survey_msg : float;
- mutable dist_to_wp : float
+ mutable dist_to_wp : float;
+ inflight_calib : inflight_calib
}
let max_nb_dl_setting_values = 256 (** indexed iwth an uint8 (messages.xml) *)
@@ -181,5 +188,6 @@ let new_aircraft = fun id name fp airframe ->
horiz_mode = UnknownHorizMode;
horizontal_mode = 0;
waypoints = Hashtbl.create 3; survey = None; last_msg_date = 0.; dist_to_wp = 0.;
- time_since_last_survey_msg = 1729.
+ time_since_last_survey_msg = 1729.;
+ inflight_calib = { if_mode = 1 ; if_val1 = 0.; if_val2 = 0.}
}
diff --git a/sw/ground_segment/tmtc/aircraft.mli b/sw/ground_segment/tmtc/aircraft.mli
index 24a810a3e4..236d10ba9b 100644
--- a/sw/ground_segment/tmtc/aircraft.mli
+++ b/sw/ground_segment/tmtc/aircraft.mli
@@ -30,6 +30,12 @@ type ac_cam = {
mutable target : (float * float) (* meter*meter relative *)
}
+type inflight_calib = {
+ mutable if_mode : int;
+ mutable if_val1 : float;
+ mutable if_val2 : float;
+ }
+
type rc_status = string
type rc_mode = string
type fbw = { mutable rc_status : rc_status; mutable rc_mode : rc_mode; mutable rc_rate : int; mutable pprz_mode_msgs_since_last_fbw_status_msg : int; }
@@ -117,7 +123,8 @@ type aircraft = {
mutable survey : (Latlong.geographic * Latlong.geographic) option;
mutable last_msg_date : float;
mutable time_since_last_survey_msg : float;
- mutable dist_to_wp : float
+ mutable dist_to_wp : float;
+ inflight_calib : inflight_calib
}
val new_aircraft : string -> string -> Xml.xml -> Xml.xml -> aircraft
diff --git a/sw/ground_segment/tmtc/fw_server.ml b/sw/ground_segment/tmtc/fw_server.ml
index e03687d8c9..d734a6873e 100644
--- a/sw/ground_segment/tmtc/fw_server.ml
+++ b/sw/ground_segment/tmtc/fw_server.ml
@@ -206,6 +206,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
a.gaz_mode <- check_index (ivalue "ap_gaz") gaz_modes "AP_GAZ";
a.lateral_mode <- check_index (ivalue "ap_lateral") lat_modes "AP_LAT";
a.horizontal_mode <- check_index (ivalue "ap_horizontal") horiz_modes "AP_HORIZ";
+ a.inflight_calib.if_mode <- check_index (ivalue "if_calib_mode") if_modes "IF_MODE";
let mcu1_status = ivalue "mcu1_status" in
(** c.f. link_autopilot.h *)
if a.fbw.pprz_mode_msgs_since_last_fbw_status_msg < 10 then
@@ -263,6 +264,9 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
if !Kml.enabled then Kml.update_horiz_mode a
| _ -> ()
end
+ | "SETTINGS" ->
+ a.inflight_calib.if_val1 <- fvalue "slider_1_val";
+ a.inflight_calib.if_val2 <- fvalue "slider_2_val";
| "SURVEY" ->
begin
a.time_since_last_survey_msg <- 0.;
diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml
index c2a1049608..82964a1be8 100644
--- a/sw/ground_segment/tmtc/server.ml
+++ b/sw/ground_segment/tmtc/server.ml
@@ -182,6 +182,14 @@ let send_cam_status = fun a ->
"cam_target_long", Pprz.Float ((Rad>>Deg)twgs84.posn_long)] in
Ground_Pprz.message_send my_id "CAM_STATUS" values
+let send_if_calib = fun a ->
+ let if_mode = get_indexed_value if_modes a.inflight_calib.if_mode in
+ let values = ["ac_id", Pprz.String a.id;
+ "if_mode", Pprz.String if_mode;
+ "if_value1", Pprz.Float a.inflight_calib.if_val1;
+ "if_value2", Pprz.Float a.inflight_calib.if_val2] in
+ Ground_Pprz.message_send my_id "INFLIGH_CALIB" values
+
let send_fbw = fun a ->
let values = [ "ac_id", Pprz.String a.id;
"rc_mode", Pprz.String a.fbw.rc_mode;
@@ -384,6 +392,7 @@ let send_aircraft_msg = fun ac ->
Ground_Pprz.message_send my_id "AP_STATUS" values;
send_cam_status a;
+ send_if_calib a;
send_fbw a;
send_svsinfo a;
send_horiz_status a;
diff --git a/sw/ground_segment/tmtc/server_globals.ml b/sw/ground_segment/tmtc/server_globals.ml
index 900e103b01..9eea214c71 100644
--- a/sw/ground_segment/tmtc/server_globals.ml
+++ b/sw/ground_segment/tmtc/server_globals.ml
@@ -13,6 +13,7 @@ let state_filter_modes = [|"UNKNOWN";"INIT";"ALIGN";"OK";"GPS_LOST";"IMU_LOST";"
let _3D = 3
let gps_hybrid_modes = [|"OFF";"ON"|]
let horiz_modes = [|"WAYPOINT";"ROUTE";"CIRCLE";"ATTITUDE"|]
+let if_modes = [|"OFF";"DOWN";"UP"|]
let string_of_values = fun values ->
String.concat " " (List.map (fun (_, v) -> Pprz.string_of_value v) values)
diff --git a/sw/ground_segment/visu3d/Makefile b/sw/ground_segment/visu3d/Makefile
deleted file mode 100644
index 707d9f2684..0000000000
--- a/sw/ground_segment/visu3d/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-OCAMLOPT0 = ocamlopt
-OCAMLC = ocamlc $(shell ocamlfind query -r -i-format xml-light)
-
-MLFLAGS = $(shell ocamlfind query -r -i-format lablGL) $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format camlimages) -I ../../lib/ocaml
-
-OCAMLOPT = $(OCAMLOPT0) $(OCAMLOPT_OPTIONS)
-
-SRC = mapGL.ml
-
-OBJS= $(SRC:.ml=.cmo)
-
-LINK= $(OCAMLC) $(MLFLAGS)
-LIBS_CI = ci_core.cma ci_gif.cma ci_jpeg.cma ci_tiff.cma ci_bmp.cma ci_ppm.cma ci_png.cma \
- ci_xpm.cma ci_ps.cma ci_freetype.cma
-STDLIBS = unix.cma str.cma xml-light.cma lablgtk.cma lablgnomecanvas.cma lablgl.cma lablgtkgl.cma $(LIBS_CI)
-ADD_LIBS = glibivy-ocaml.cma lib-pprz.cma xlib-pprz.cma
-CLIBS = -cclib -lpthread
-
-all: mapGL
-
-clean:
- \rm -f mapGL *.cm* *.o *.a *~ *.opt *.out *.top *.output *obj *exe \
- stars_lexer.ml stars_parser.mli stars_parser.ml .depend
-
-# Executables
-mapGL: mapGL.ml
- $(OCAMLC) -custom $(MLFLAGS) $(STDLIBS) gtkInit.cmo $(ADD_LIBS) -o $@ $< $(CLIBS)
-
-# Do not edit below this line
-
-.depend:
- ocamldep *.mli *.ml *.mly *.mll > .depend
-
-.SUFFIXES: .ml .mli .cmo .cmi .cmx
-
-.ml.cmo:
- $(OCAMLC) $(MLFLAGS) -labels -w s -c $<
-.mli.cmi:
- $(OCAMLC) $(MLFLAGS) -labels -w s -c $<
-.ml.cmx:
- $(OCAMLOPT) $(MLFLAGS) -labels -w s -c $<
-
-ifneq ($(MAKECMDGOALS),clean)
--include .depend
-endif
diff --git a/sw/ground_segment/visu3d/TODO b/sw/ground_segment/visu3d/TODO
deleted file mode 100644
index 9f4ac6883e..0000000000
--- a/sw/ground_segment/visu3d/TODO
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-add waypoint icons
-add aircraft icon
-
-add camera trace on ground
-
-manage aircraft track length (limit to n minutes)
-
-map video frame (photos) on ground surface
-transform photos (translate, rotate, zoom)
-save photos position and visibility for future reload.
-manage photos (like layers in a cad program )
-
-add fact_alti adjust
-
-support several aircrafts, maybe with an identification label (3D radar track ? )
-select aircraft, waypoints (would it be possible??)
-
-support viewpoint selection using function keys - viewpoints are defined in the flight plan ?
diff --git a/sw/ground_segment/visu3d/mapGL.ml b/sw/ground_segment/visu3d/mapGL.ml
deleted file mode 100644
index 37057b1333..0000000000
--- a/sw/ground_segment/visu3d/mapGL.ml
+++ /dev/null
@@ -1,531 +0,0 @@
-(*
- * $Id$
- *
- * 3D OpenGL visualisation
- *
- * Copyright (C) 2004 CENA/ENAC, Yann Le Fablec, Pascal Brisset, Antoine Drouin
- *
- * 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, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- *)
-
-module Ground_Pprz = Pprz.Messages(struct let name = "ground" end)
-
-module OT = Ocaml_tools
-module G3d = Geometry_3d
-
-open Latlong
-
-let fos = fun x ->
- try
- float_of_string x
- with
- Failure("float_of_string") -> failwith ("float_of_string: "^ x)
-let float_attrib = fun xml a -> fos (ExtXml.attrib xml a)
-
-(* Version de l'appli *)
-let version = "0.1"
-
-(* 1 point tous les 50m *)
-let dx = 50 and dy = 50
-
-(* Facteur d'echelle pour les altitudes *)
-let fact_alti = 1
-
-(* Taille de la fenetre d'affichage *)
-let width = 800 and height = 600
-
-let tolerance_alti = 20.
-
-
-let color_trajs = [|`NAME "red"; `NAME "green"; `NAME "blue"|]
-
-let new_color =
- let i = ref (-1) in
- fun () ->
- i := (! i + 1) mod (Array.length color_trajs);
- color_trajs.(!i)
-
-let home = Env.paparazzi_home
-let (//) = Filename.concat
-let default_path_SRTM = home // "data" // "srtm"
-let default_path_maps = home // "data" // "maps/"
-let default_path_traj = home // "var" // "logs/"
-let default_path_missions = home // "conf"
-
-let color_pixmaps = Hashtbl.create 101
-
-let limits = ref ((min_float,min_float), (max_float, max_float))
-
-let track_filter = fun points ->
- let ((minx,miny), (maxx, maxy)) = !limits in
- let rec loop = fun last_alt points ->
- match points with
- [] -> []
- | (t,x,y,a)::ps ->
- if minx < x && x < maxx && miny < y && y < maxy
- then
- match last_alt with
- None -> (t,x,y,a)::loop (Some a) ps
- | (Some a') when abs_float (a-.a') < tolerance_alti ->
- (t,x,y,a)::loop (Some a) ps
- | _ -> loop last_alt ps
- else loop last_alt ps in
- loop None points
-
-(* Fichier d'aide contenant les touches clavier utilisees *)
-let filename_help_keys = Env.paparazzi_src // "conf" // "mapGL_help_keys.txt"
-
-(* ========================================================================= *)
-(* = Passage de couleur GTK vers GL = *)
-(* = = *)
-(* = color = couleur GTK (`NAME ou `RGB) a transformer = *)
-(* ========================================================================= *)
-let gtk_to_gl_color color =
- let t = GDraw.color color in
- ((float_of_int (Gdk.Color.red t))/.65535.0,
- (float_of_int (Gdk.Color.green t))/.65535.0,
- (float_of_int (Gdk.Color.blue t))/.65535.0)
-
-let gl_color_of_string = fun s -> gtk_to_gl_color (`NAME s)
-
-
-(* ========================================================================= *)
-(* = Passage de couleur GL vers GTK = *)
-(* = = *)
-(* = (r, g, b) = couleur GL a transformer en equivalent GTK = *)
-(* ========================================================================= *)
-let gl_to_gtk_color (r, g, b) =
- `RGB(int_of_float (r*.65535.0), int_of_float (g*.65535.0),
- int_of_float (b*.65535.0))
-
-(** Tracks loading from a log file = *)
-let read_traj_file filename =
- let h = Hashtbl.create 5 in
- let add_point = fun id p ->
- let track =
- try Hashtbl.find h id with
- Not_found ->
- let empty_track = ref [] in
- Hashtbl.add h id empty_track;
- empty_track in
- track := p :: !track in
-
- let match_func l error_func =
- match l with
- time::id::"GPS"::mode::utm_x::utm_y::_::alt::_ ->
- (try
- if mode = "3" then (* Else no pertinent info available *)
- let t = fos time
- and utm_x = fos utm_x /. 100.
- and utm_y = fos utm_y /. 100.
- and alt = fos alt /. 100. in
- add_point id (t, utm_x, utm_y, alt);
- with _ -> error_func ())
- | _ -> ()
- in
- OT.do_read_file filename match_func (fun () -> ());
- let tracks =
- Hashtbl.fold
- (fun _id track r -> (track_filter (List.rev !track), new_color ())::r)
- h
- [] in
- tracks
-
-(* ========================================================================= *)
-(* = Ajout de la surface = *)
-(* ========================================================================= *)
-let add_surface view3d texture_file (min_x, min_y) (max_x, max_y) utm_zone =
- (* Creation de la texture a partir d'une image *)
- Printf.printf "Loading texture...%!";
- let texture_id = Gtk_3d.create_texture_from_image texture_file in
- Printf.printf " OK\n%!";
-
- (* Creation d'une matrice contenant les elevations *)
- let nx = (max_x-min_x)/dx+1 and ny = (max_y-min_y)/dy+1 in
- let tab = Array.make_matrix ny nx {G3d.x3D=0.; G3d.y3D=0.; G3d.z3D=0.} in
-
- let y = ref max_y in
- try
- for i = 0 to ny - 1 do
- let x = ref min_x in
- let uy = float !y in
- for j = 0 to nx - 1 do
- let alt = (Srtm.of_utm {utm_x = float !x; utm_y = uy; utm_zone = utm_zone})*fact_alti in
- tab.(i).(j) <- {G3d.x3D = float !x; G3d.y3D= float !y; G3d.z3D = float alt} ;
- x:=!x+dx
- done ;
- y:=!y-dy
- done ;
-
- (* Ajout de cette matrice a la vue 3D *)
- view3d#add_object_surface_with_texture tab texture_id
- with
- Srtm.Tile_not_found s ->
- failwith (Printf.sprintf "SRTM tile '%s' not found, you can download it with %s" s (Srtm.error s))
-
-(* ========================================================================= *)
-(* = Ajout d'une trajectoire = *)
-(* ========================================================================= *)
-let point3D = fun (_, utm_x, utm_y, alt) ->
- {G3d.x3D=utm_x; G3d.y3D=utm_y; G3d.z3D=alt*. float fact_alti}
-let add_traj view3d (points, id) =
- let l = List.map point3D points in
-
- let color = gtk_to_gl_color id in
- view3d#add_object_line l color 2 false false
-
-
-type aircraft = { color : Gtk_3d.glcolor; mutable last_point : Geometry_3d.pt_3D option }
-let live_aircrafts = Hashtbl.create 3
-
-let create_ac = fun ac config ->
- let color = Pprz.string_assoc "default_gui_color" config in
- let gl_color = gl_color_of_string color in
- Hashtbl.add live_aircrafts ac { color = gl_color; last_point = None }
-
-let one_new_ac = fun ac ->
- if not (Hashtbl.mem live_aircrafts ac) then begin
- let get_config = fun _sender values -> create_ac ac values in
- Ground_Pprz.message_req "map3d" "CONFIG" ["ac_id", Pprz.String ac] get_config
- end
-
-let list_separator = Str.regexp ","
-let live_aircrafts_msg = fun acs ->
- let acs = Pprz.string_assoc "ac_list" acs in
- let acs = Str.split list_separator acs in
- List.iter one_new_ac acs
-
-
-(* Adding one more point to a track *)
-let add_point (view3d:Gtk_3d.widget_3d) (point, id) =
- let p = point3D point in
- try
- let ac = Hashtbl.find live_aircrafts id in
- begin
- match ac.last_point with
- Some last ->
- view3d#display (view3d#add_object_line [last;p] ac.color 2 false false)
- | None -> ()
- end;
- ac.last_point <- Some p
- with
- Not_found -> ()
-
-
-(* ========================================================================= *)
-(* = Load a map. Use SRTM elevation data to produce a 3d surface = *)
-(* ========================================================================= *)
-let load_surface view3d id_sol xml_map_file =
- let min_x = ref max_int and min_y = ref max_int
- and max_x = ref min_int and max_y = ref min_int
- and _texture_file = ref "" in
- let xml = Xml.parse_file xml_map_file in
- let texture_file = Xml.attrib xml "file" in
- let texture_file = Filename.concat (Filename.dirname xml_map_file) texture_file in
- let (_format, header) = Images.file_format texture_file in
- let _int_attrib x a = int_of_string (Xml.attrib x a) in
- begin
- match Xml.children xml with
- p::_ ->
- let utm_x = float_attrib p "utm_x"
- and utm_y = float_attrib p "utm_y"
- and x = float_attrib p "x"
- and y = float_attrib p "y"
- and scale = float_attrib xml "scale" in
- min_x := truncate (utm_x -. scale *. x);
- min_y := truncate (utm_y -. scale *. (float header.Images.header_height -. y));
- max_x := truncate (utm_x +. scale *. (float header.Images.header_width -. x));
- max_y := truncate (utm_y +. scale *. y)
- | _ -> failwith "load_surface"
- end;
- begin
- match !id_sol with
- Some x -> view3d#delete_object x
- | None -> ()
- end;
- let utm_zone = try int_of_string (Xml.attrib xml "utm_zone") with _ -> Printf.fprintf stderr "Warning: utm_zone attribute not specified in '%s'; default is 31\n" xml_map_file; flush stderr; 31 in
- id_sol:= Some (add_surface view3d texture_file (!min_x, !min_y) (!max_x, !max_y) utm_zone);
- limits := ((float !min_x, float !min_y), (float !max_x, float !max_y));
- view3d#display_func
-
-
-let load_mission = fun (view3d:Gtk_3d.widget_3d) xml ->
- let wps = ExtXml.child xml "waypoints" in
- let utm_x0 = float_attrib wps "utm_x0"
- and utm_y0 = float_attrib wps "utm_y0" in
- let display_waypoint = fun wp ->
- let utm_x = float_attrib wp "x" +. utm_x0
- and utm_y = float_attrib wp "y" +. utm_y0
- and alt = float_attrib wp "alt" in
- let p3d = point3D (0., utm_x, utm_y, alt)
- and p3d_label = point3D (0., utm_x+.10., utm_y+.10., alt) in
- view3d#display (view3d#add_object_point p3d p3d_label (ExtXml.attrib wp "name") (gtk_to_gl_color (`NAME "red")) true) in
- List.iter display_waypoint (Xml.children wps)
-
-(* ========================================================================= *)
-(* = Map loading callback = *)
-(* ========================================================================= *)
-let on_load_surface win view3d id_sol () =
- let priv_load_surf xml_map_file =
- load_surface view3d id_sol xml_map_file
- in
- try
- Gtk_tools.open_file_dlg "Map calibration file" priv_load_surf None default_path_maps false
- with x ->
- Gtk_tools.error_box win "Read error" (Printexc.to_string x)
-
-
-(* ========================================================================= *)
-(* = Chargement d'une trajectoire = *)
-(* ========================================================================= *)
-let load_trajectory view3d lst_ids_trajs () =
- let read_data f =
- let new_trajs = read_traj_file f in
- List.iter
- (fun traj -> lst_ids_trajs:=(add_traj view3d traj)::!lst_ids_trajs)
- new_trajs;
- (* Force display update *)
- view3d#display_func
- in
-
- Gtk_tools.open_file_dlg "Track" read_data None default_path_traj false
-
-(* ========================================================================= *)
-(* = Recherche/Ajout d'une pixmap de couleur dans la table = *)
-(* ========================================================================= *)
-let get_color_pixmap win color =
- let taille_x = 20 and taille_y = 8 in
- try Hashtbl.find color_pixmaps color
- with Not_found ->
- let pm = Gtk_tools.rectangle_pixmap win color taille_x taille_y in
- Hashtbl.add color_pixmaps color pm ;
- pm
-
-(* ========================================================================= *)
-(* = Selection de trajectoires = *)
-(* ========================================================================= *)
-let build_lst_traj tooltips view3d lst_ids_trajs () =
- let get_id idx = try List.nth !lst_ids_trajs idx with _ -> (-1) in
-
- let (window,boite) = Gtk_tools.create_window "Liste des trajectoires" 450 300 in
- let lst = Gtk_tools.create_managed_list
- [("Id", 40); ("Sel.", 40); ("Color", 60)] boite#add
- in
- let buts = Gtk_tools.create_buttons
- [("Hide", "Hide the track");
- ("Display", "Display the track");
- ("Color", "Change the color");
- ("Delete", "Delete the track") ;
- ("Close", "Close the window")] tooltips boite#pack
- in
- let but_masque = List.nth buts 0 and but_aff = List.nth buts 1
- and but_couleur = List.nth buts 2 and but_del = List.nth buts 3 in
- Gtk_tools.set_sensitive_list
- [but_couleur; but_del; but_masque; but_aff] false ;
-
- let current_selection = ref (-1) and current_idx = ref "" in
- let callback_traj index _ selection =
- if selection then begin
- current_selection:=get_id (int_of_string index) ;
- current_idx:=index ;
- let masquable = view3d#object_get_visibility !current_selection in
- Gtk_tools.set_sensitive but_masque masquable ;
- Gtk_tools.set_sensitive but_aff (not masquable) ;
- Gtk_tools.set_sensitive_list [but_couleur; but_del] true ;
- end else begin
- current_selection:=(-1); current_idx:="" ;
- Gtk_tools.set_sensitive_list
- [but_couleur; but_del; but_masque; but_aff] false
- end
- in
- let fill_list_traj = Gtk_tools.connect_managed_list
- lst 0 callback_traj ("track", true, true)
- in
- let fill_list () =
- let to_select = !current_idx in
- current_selection:=(-1); current_idx:="" ;
- let n = ref (-1) in
- let l = List.map (fun id ->
- incr n ;
- [string_of_int !n;
- (if view3d#object_get_visibility id then " x " else ""); ""]
- ) !lst_ids_trajs in
- fill_list_traj to_select l ;
- let row = ref 0 in
- List.iter (fun id ->
- let c = gl_to_gtk_color (view3d#object_get_color id) in
- (fst lst)#set_cell !row 2 ~pixmap:(get_color_pixmap window c) ;
- incr row) !lst_ids_trajs
- in
- fill_list () ;
-
- let func_masque_aff affiche =
- if !current_selection<>(-1) then begin
- view3d#object_set_visibility !current_selection affiche ;
- view3d#display_func ;
- fill_list ()
- end
- in
- let change_color () =
- if !current_selection<>(-1) then begin
- Gtk_tools.select_color (fun color ->
- view3d#object_set_color !current_selection (gtk_to_gl_color color) ;
- view3d#display_func ;
- fill_list ()) ;
- end
- in
- let delete_traj () =
- if !current_selection<>(-1) then begin
- view3d#delete_object !current_selection; view3d#display_func ;
- lst_ids_trajs:=
- List.filter (fun id -> id <> !current_selection) !lst_ids_trajs ;
- fill_list ()
- end
- in
-
- Gtk_tools.create_buttons_connect buts
- [(fun () -> func_masque_aff false); (fun () -> func_masque_aff true);
- change_color; delete_traj;
- (fun () -> window#destroy (); view3d#display_func)] ;
- window#show ()
-
-(* ========================================================================= *)
-(* = Fenetre About = *)
-(* ========================================================================= *)
-let build_fen_about () =
- (* Creation de la liste des fichiers de l'animation *)
- let l = ref [] and max_pixmaps = 15 in
- for i=1 to max_pixmaps do
- l:=(Printf.sprintf "Pixmaps/avion%d.xpm" i)::!l
- done ;
-
- let message = Printf.sprintf "Visu Drone v%s\n" version in
-
- Gtk_tools.animated_msg_box "About" message (List.rev !l)
-
-(* ========================================================================= *)
-(* = Creation de l'interface = *)
-(* ========================================================================= *)
-let build_interface = fun map_file mission_file ->
- let nb_menus = ref 0 in
-
- (* Liste des menus disponibles *)
- let liste_menus = ["Map"; "Tracks"; "Parameters"] in
-
- (* Mise en place des couleurs correctes *)
- Gtk_tools.init_colors () ;
-
- (* Initialisation de l'aide contextuelle *)
- let tooltips = Gtk_tools.init_tooltips () in
-
- (* Creation d'une fenetre *)
- let (window, vbox, factory, accel_group, menus, menu_help) =
- Gtk_tools.create_window_with_menubar_help ("Visu Drone v"^version)
- width height liste_menus in
- ignore (window#connect#destroy ~callback:GMain.Main.quit);
-
- (* Creation du Widget OpenGL *)
- let view3d = new Gtk_3d.widget_3d vbox#add false "" in
-
- (* Ajout des objets a la vue *)
- let id_sol = ref None in
- let lst_ids_trajs = ref [] in
-
- (* Creation des menus : Sol *)
- let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
- incr nb_menus ;
- ignore (factory#add_item "Load Background" ~key:GdkKeysyms._M
- ~callback:(on_load_surface window view3d id_sol)) ;
- let quit = fun () -> GMain.Main.quit (); exit 0 in
- ignore (factory#add_item "Quit" ~key:GdkKeysyms._Q ~callback:quit) ;
-
- (* Creation des menus : Trajectoires *)
- let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
- incr nb_menus ;
- ignore (factory#add_item "Load Track" ~key:GdkKeysyms._T ~callback:(load_trajectory view3d lst_ids_trajs)) ;
- ignore (factory#add_item "Edit Tracks"
- ~callback:(build_lst_traj tooltips view3d lst_ids_trajs)) ;
-
- (* Creation des menus : Parametres *)
- let factory = new GMenu.factory menus.(!nb_menus) ~accel_group in
- incr nb_menus ;
- ignore (factory#add_item "Edit" ~callback:(fun () -> ())) ;
-
- (* Aide *)
- let factory = new GMenu.factory menu_help in
- ignore (factory#add_item "Help keys/mouse"
- ~callback:(fun () -> Gtk_tools.display_file filename_help_keys
- "Help keys/mouse" 370 500 tooltips (Some "fixed"))) ;
-
- (* Affichage de la fenetre principale *)
- window#show () ;
-
- ignore (Ground_Pprz.message_bind "NEW_AIRCRAFT" (fun _sender vs -> one_new_ac (Pprz.string_assoc "ac_id" vs)));
-
- ignore (Glib.Timeout.add 5000 (fun () -> Ground_Pprz.message_req "map3d" "AIRCRAFTS" [] (fun _sender vs -> live_aircrafts_msg vs); false));
-
- let use_fp = fun _sender vs ->
- let ac_id = Pprz.string_assoc "ac_id" vs in
- let a = fun s -> Pprz.float_assoc s vs in
- let lat = a "lat"
- and long = a "long"
- and z = a "alt" in
- let utm = utm_of WGS84 { posn_lat=(Deg>>Rad)lat; posn_long=(Deg>>Rad)long} in
- add_point view3d ((0., utm.utm_x, utm.utm_y, z), ac_id) in
-
- ignore (Ground_Pprz.message_bind "FLIGHT_PARAM" use_fp);
-
- (* Loading an initial map *)
- if map_file <> "" then begin
- let xml_map_file = Filename.concat (default_path_maps) map_file in
- load_surface view3d id_sol xml_map_file
- end;
-
- (* Loading an initial mission *)
- if mission_file <> "" then begin
- let xml_file = Filename.concat (default_path_missions) mission_file in
- load_mission view3d (Xml.parse_file xml_file)
- end;
-
- window#add_accel_group accel_group;
- (* Lancement de la mainloop *)
- Gtk_tools.main_loop ()
-
-(* ========================================================================= *)
-(* = Programme principal = *)
-(* ========================================================================= *)
-let _ =
- let ivy_bus = Defivybus.default_ivy_bus and
- map_file = ref "" and
- mission_file = ref "" in
- let options =
- [ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf " Default is %s" !ivy_bus);
- "-m", Arg.String (fun x -> map_file := x), "Map description file";
- "-f", Arg.String (fun x -> mission_file := x), "Mission description file"] in
- Arg.parse (options)
- (fun x -> Printf.fprintf stderr "Warning: Don't do anything with %s\n" x)
- "Usage: ";
- (* *)
- Ivy.init "Paparazzi 3d visu" "READY" (fun _ _ -> ());
- Ivy.start !ivy_bus;
-
- Srtm.add_path default_path_SRTM;
-
- (* Lancement de l'interface *)
- build_interface !map_file !mission_file
diff --git a/sw/in_progress/button/Makefile b/sw/in_progress/button/Makefile
index 73b93e66ae..f2f0bcb54e 100644
--- a/sw/in_progress/button/Makefile
+++ b/sw/in_progress/button/Makefile
@@ -1,4 +1,4 @@
-#
+#
# $Id: Makefile 5874 2010-09-15 03:41:04Z aibara $
# Copyright (C) 2004 Pascal Brisset, Antoine Drouin
#
@@ -17,15 +17,15 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Quiet compilation
Q=@
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
-INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../../lib/ocaml
+INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../../lib/ocaml
all: panic
@@ -63,10 +63,10 @@ pt : ahrsview imuview ahrs2fg
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags`
-LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lgtkdatabox `pcre-config --libs` -lglibivy
+LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lgtkdatabox -lglibivy
+
+MORE_FLAGS = -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -rdynamic /usr/lib/libgtkgl.so -L/usr/lib -L/usr/X11R6/lib /usr/lib/libgtk.so /usr/lib/libgdk.so /usr/lib/libgmodule.so /usr/lib/libglib.so -ldl -lXi -lXext -lX11 -lm -lGLU -lGL -Wl,--rpath -Wl,/usr/local/lib -lglibivy `pcre-config --libs`
-MORE_FLAGS = -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -rdynamic /usr/lib/libgtkgl.so -L/usr/lib -L/usr/X11R6/lib /usr/lib/libgtk.so /usr/lib/libgdk.so /usr/lib/libgmodule.so /usr/lib/libglib.so -ldl -lXi -lXext -lX11 -lm -lGLU -lGL -Wl,--rpath -Wl,/usr/local/lib `pcre-config --libs` -lglibivy
-
MORE_CFLAGS = -DHAVE_DLFCN_H=1 -DSTDC_HEADERS=1 -I. -I. -I.. -g -O2 -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include
clean:
@@ -99,7 +99,7 @@ FGFS_ARGS = $(FGFS_COMMON_ARGS) $(FGFS_IN_GUI_ARGS)
#FGFS_GAME_ARGS)
panic: panic.c
- gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy -lhid
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy -lhid
#
# Dependencies
@@ -108,6 +108,6 @@ panic: panic.c
.depend: Makefile
ocamldep -I ../../lib/ocaml *.ml* > .depend
-ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),clean)
-include .depend
endif
diff --git a/sw/in_progress/fdm/Makefile b/sw/in_progress/fdm/Makefile
index 0d620ca127..1589709003 100644
--- a/sw/in_progress/fdm/Makefile
+++ b/sw/in_progress/fdm/Makefile
@@ -1,4 +1,4 @@
-#
+#
# $Id$
# Copyright (C) 2004 Pascal Brisset, Antoine Drouin
#
@@ -17,8 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Quiet compilation
Q=@
@@ -26,14 +26,13 @@ Q=@
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
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
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
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
clean:
rm -f *~ core *.o *.bak .depend fdm_step fms_steps_attitude
-
diff --git a/sw/in_progress/ir_calibration/Makefile b/sw/in_progress/ir_calibration/Makefile
index 47a072344d..6924422e1d 100644
--- a/sw/in_progress/ir_calibration/Makefile
+++ b/sw/in_progress/ir_calibration/Makefile
@@ -2,10 +2,10 @@
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags`
-LDFLAGS=`pkg-config gtk+-2.0 --libs` `pcre-config --libs` -lglibivy -lm -lgtkdatabox
+LDFLAGS=`pkg-config gtk+-2.0 --libs` -lglibivy -lm -lgtkdatabox
ir_calib : main.c calibrator.c gui.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
clean:
- rm -f *~ ir_calib
\ No newline at end of file
+ rm -f *~ ir_calib
diff --git a/sw/in_progress/motor_bench/Makefile b/sw/in_progress/motor_bench/Makefile
index 034cafc970..4e8f6bbd82 100644
--- a/sw/in_progress/motor_bench/Makefile
+++ b/sw/in_progress/motor_bench/Makefile
@@ -1,6 +1,6 @@
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags` -I ../../../var/MB
-LDFLAGS=`pkg-config gtk+-2.0 --libs` -s `pcre-config --libs` -lglibivy
+LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lglibivy
motor_bench : main.c
diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile
index 24a8a92e10..8a1eb2bbdf 100644
--- a/sw/lib/ocaml/Makefile
+++ b/sw/lib/ocaml/Makefile
@@ -1,4 +1,4 @@
-#
+#
# $Id$
# Copyright (C) 2003 Pascal Brisset, Antoine Drouin
#
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# Boston, MA 02111-1307, USA.
#
@@ -25,7 +25,7 @@ Q=@
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
- FPIC = -ccopt -fPIC
+ FPIC = -ccopt -fPIC
else
FPIC =
endif
@@ -164,6 +164,6 @@ clean :
.depend: Makefile
ocamldep *.ml* > .depend
-ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),clean)
-include .depend
endif
diff --git a/sw/lib/ocaml/ivy/Makefile b/sw/lib/ocaml/ivy/Makefile
index 34bb76568d..abacbdf640 100644
--- a/sw/lib/ocaml/ivy/Makefile
+++ b/sw/lib/ocaml/ivy/Makefile
@@ -63,7 +63,7 @@ deb :
cp debian/changelog.$(DISTRO) debian/changelog
dpkg-buildpackage -rfakeroot
-ivy : ivy-ocaml.cma ivy-ocaml.cmxa
+ivy : ivy-ocaml.cma ivy-ocaml.cmxa
glibivy : glibivy-ocaml.cma glibivy-ocaml.cmxa
tkivy : tkivy-ocaml.cma tkivy-ocaml.cmxa
@@ -101,7 +101,7 @@ tkivy-ocaml.cmxa : $(TKIVYCMX) civy.o ctkivy.o
.ml.cmo :
$(OCAMLC) $(OCAMLFLAGS) $(INCLUDES) -c $<
.c.o :
-
+
$(CC) -Wall -c $(FPIC) -I /opt/local/include/ $(OCAMLINC) $(GLIBINC) $<
.mli.cmi :
$(OCAMLMLI) $(OCAMLFLAGS) -c $<
diff --git a/sw/logalizer/Makefile b/sw/logalizer/Makefile
index 01dd11580b..71d397db08 100644
--- a/sw/logalizer/Makefile
+++ b/sw/logalizer/Makefile
@@ -1,4 +1,4 @@
-#
+#
# $Id$
# Copyright (C) 2004 Pascal Brisset, Antoine Drouin
#
@@ -17,15 +17,15 @@
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
+# Boston, MA 02111-1307, USA.
+#
# Quiet compilation
Q=@
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
-INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../lib/ocaml
+INCLUDES= $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format lablgtk2) -I ../lib/ocaml
all: play plotter plot sd2log plotprofile
@@ -81,7 +81,7 @@ pt : ahrsview imuview ahrs2fg
CC = gcc
CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags`
-LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lgtkdatabox `pcre-config --libs` -lglibivy
+LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lgtkdatabox -lglibivy
motor_bench : motor_bench.c sliding_plot.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
@@ -98,15 +98,15 @@ plot_roll_loop : plot_roll_loop.c sliding_plot.c
test_sliding_plot: test_sliding_plot.c sliding_plot.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
-MORE_FLAGS = -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -rdynamic /usr/lib/libgtkgl.so -L/usr/lib -L/usr/X11R6/lib /usr/lib/libgtk.so /usr/lib/libgdk.so /usr/lib/libgmodule.so /usr/lib/libglib.so -ldl -lXi -lXext -lX11 -lm -lGLU -lGL -Wl,--rpath -Wl,/usr/local/lib `pcre-config --libs` -lglibivy
-
+MORE_FLAGS = -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -rdynamic /usr/lib/libgtkgl.so -L/usr/lib -L/usr/X11R6/lib /usr/lib/libgtk.so /usr/lib/libgdk.so /usr/lib/libgmodule.so /usr/lib/libglib.so -ldl -lXi -lXext -lX11 -lm -lGLU -lGL -Wl,--rpath -Wl,/usr/local/lib -lglibivy `pcre-config --libs`
+
MORE_CFLAGS = -DHAVE_DLFCN_H=1 -DSTDC_HEADERS=1 -I. -I. -I.. -g -O2 -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include
disp3d: disp3d.c
$(CC) $(MORE_CFLAGS) -g -o $@ $^ $(MORE_FLAGS)
plotprofile: plotprofile.c
- gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
test1: test1.c
$(CC) $(MORE_CFLAGS) -g -o $@ $^ $(MORE_FLAGS) -lglut
@@ -146,23 +146,23 @@ FGFS_ARGS = $(FGFS_COMMON_ARGS) $(FGFS_IN_GUI_ARGS)
run_fg:
$(FGFS_ENV) $(FGFS) $(FGFS_ARGS)
-ahrs2fg: ahrs2fg.c network.c flight_gear.c utils.c
+ahrs2fg: ahrs2fg.c network.c flight_gear.c utils.c
$(CC) $(CFLAGS) -g -o $@ $^ $(LDFLAGS)
test_samere: test_samere.c network.c flight_gear.c utils.c
$(CC) $(CFLAGS) -I../airborne -I../airborne/test -I../include -g -o $@ $^ $(LDFLAGS)
ivy_example: ivy_example.c
- gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
tmclient: tmclient.c
- gcc -g -O1 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+ gcc -g -O1 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
ffjoystick: ffjoystick.c
- gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy -lm
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy -lm
ctrlstick: ctrlstick.c
- gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` `pcre-config --libs` -lglibivy
+ gcc -g -O2 -Wall `pkg-config glib-2.0 --cflags` -o $@ $^ `pkg-config glib-2.0 --libs` -lglibivy
#
# Dependencies
@@ -171,6 +171,6 @@ ctrlstick: ctrlstick.c
.depend: Makefile
ocamldep -I ../lib/ocaml *.ml* > .depend
-ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),clean)
-include .depend
endif
diff --git a/sw/logalizer/sliding_plot.c b/sw/logalizer/sliding_plot.c
index 4cc8aea861..c8b8f83556 100644
--- a/sw/logalizer/sliding_plot.c
+++ b/sw/logalizer/sliding_plot.c
@@ -4,7 +4,7 @@
#include
#include
#include
-#include
+#include
#include
diff --git a/sw/simulator/old_booz/tests/Makefile b/sw/simulator/old_booz/tests/Makefile
index 626e8076d2..35c5ec7f91 100644
--- a/sw/simulator/old_booz/tests/Makefile
+++ b/sw/simulator/old_booz/tests/Makefile
@@ -9,7 +9,7 @@
#CFLAGS += -I /usr/include/meschach -I /usr/local/include/
#LDFLAGS += -lmeschach -L /usr/lib
#CFLAGS += `pkg-config glib-2.0 --cflags`
-#LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy
+#LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lglibivy -lpcre
#test1: nps_test1.c nps_jsbsim.c
# $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
@@ -28,13 +28,10 @@ CFLAGS = -Wall \
-I ../../../var/BOOZ2_A1 \
-I ../../airborne \
-I ../../include \
- -I /usr/include/meschach \
-I $(JSBSIM)/include/JSBSim \
`pkg-config glib-2.0 --cflags` \
LDFLAGS = -lm \
- -lmeschach \
- -lpcre \
-lglibivy \
-L $(JSBSIM)/lib -lJSBSim \
`pkg-config glib-2.0 --libs` \
diff --git a/sw/supervision/paparazzi.pl b/sw/supervision/paparazzi.pl
deleted file mode 100755
index 789e20963e..0000000000
--- a/sw/supervision/paparazzi.pl
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl -w
-package Paparazzi;
-
-my $paparazzi_lib;
-BEGIN {
- $paparazzi_lib = (defined $ENV{PAPARAZZI_SRC}) ?
- $ENV{PAPARAZZI_SRC}."/sw/lib/perl" :
- "/usr/lib/paparazzi/";
-}
-use lib ($paparazzi_lib);
-if (exists $ENV{PAPARAZZI_SRC} and defined $ENV{PAPARAZZI_SRC}) {
-use lib ($ENV{PAPARAZZI_SRC}."/sw/supervision");
-}
-
-use Paparazzi::CpGui;
-@ISA = qw(Paparazzi::CpGui);
-
-use Paparazzi::Environment;
-
-use strict;
-
-use Tk;
-use Subject;
-
-use Data::Dumper;
-use Getopt::Long;
-
-sub populate {
- my ($self, $args) = @_;
- my $paparazzi_src = Paparazzi::Environment::paparazzi_src();
- my $paparazzi_home = Paparazzi::Environment::paparazzi_home();
- Paparazzi::Environment::check_paparazzi_home();
- $args->{-config_file} = $paparazzi_home."/conf/control_panel.xml";
- $args->{-variables} = {paparazzi_home => $paparazzi_home};
- $args->{-bin_base_dir} = defined $paparazzi_src ? $paparazzi_src : "/usr/share/paparazzi";
- $args->{-logo_file} = $paparazzi_home."/data/pictures/penguin_logo.gif";
- $self->SUPER::populate($args);
- $self->configspec(-variables => [S_SUPER, S_SUPER, S_SUPER, S_SUPER, S_SUPER, {}]);
-}
-
-sub completeinit {
- my ($self) = @_;
- $self->SUPER::completeinit();
- $self->parse_args();
-}
-
-sub parse_args {
- my ($self) = @_;
- my $options = {
- ivy_bus => undef,
- map => undef,
- render => undef,
- };
- GetOptions("b=s" => \$options->{ivy_bus},
- "m=s" => \$options->{map},
- "r=s" => \$options->{render},
- );
- my $variables = $self->get('-variables');
- foreach my $var (keys %{$options}) {
- $variables->{$var} = $options->{$var} if defined $options->{$var};
- }
-# print "in paparazzi::parse_args variables after\n".Dumper($variables);
-}
-
-sub catchSigTerm() {
- my ($paparazzi) = @_;
- printf("in catchSigTerm\n");
- $paparazzi->terminate_all();
-}
-
-my $paparazzi = Paparazzi->new();
-$SIG{TERM} = sub {$paparazzi->catchSigTerm()};
-Tk::MainLoop();
-$paparazzi->catchSigTerm();
-
-1;
-
-
-
-
-
-
-
-
-
diff --git a/sw/tools/gen_settings.ml b/sw/tools/gen_settings.ml
index 4be08f1bd6..8d2042dc9e 100644
--- a/sw/tools/gen_settings.ml
+++ b/sw/tools/gen_settings.ml
@@ -215,7 +215,11 @@ let parse_rc_setting = fun xml ->
and range = float_of_string (ExtXml.attrib xml "range") in
let t = (ExtXml.attrib xml "type") in
let param_macro = param_macro_of_type t in
- let var_init = var ^ "_init" in
+ let dot_pos =
+ try String.rindex var '.' + 1 with
+ Not_found -> 0 in
+ let var_nostruct = String.sub var dot_pos (String.length var - dot_pos) in
+ let var_init = var_nostruct ^ "_init" in
lprintf "if (rc_settings_mode == RC_SETTINGS_MODE_%s) { \\\n" (String.uppercase cm);
right ();