Merge pull request #1123 from paparazzi/rm_jsbsim

Remove the jsbsim simulator target, as it is a subset of NPS (when using JSBSim as FDM) with less capabilities.
This commit is contained in:
Felix Ruess
2015-03-02 18:10:31 +01:00
58 changed files with 29 additions and 1470 deletions
-105
View File
@@ -1,105 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2006 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.
#
#
# This is the Makefile for the JSBSim target.
# Compilator: g++
#
SRC_ARCH = arch/sim
CC = g++
SIMDIR = $(PAPARAZZI_SRC)/sw/simulator
OPT ?= 2
# Launch with "make Q=''" to get full command display
Q=@
#
# Compilation flags
#
CFLAGS = -W -Wall $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/airborne/$(SRC_ARCH) $($(TARGET).CFLAGS) $(USER_CFLAGS) -O$(OPT)
LDFLAGS = -lm $($(TARGET).LDFLAGS)
#
# General rules
#
$(TARGET).srcsnd = $(notdir $($(TARGET).srcs))
$(TARGET).objso = $($(TARGET).srcs:%.c=$(OBJDIR)/%.o)
$(TARGET).objs = $($(TARGET).objso:%.S=$(OBJDIR)/%.o)
all compile: check_jsbsim $(OBJDIR) $(OBJDIR)/simsitl
check_jsbsim:
@echo Paparazzi jsbsim package found: $(JSBSIM_PKG)
$(OBJDIR):
@echo CREATING object dir $(OBJDIR)
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
$(OBJDIR)/simsitl : $($(TARGET).objs)
@echo LD $@
$(Q)$(CC) $(CFLAGS) -o $@ $($(TARGET).objs) $(LDFLAGS)
%.s: %.c
$(CC) $(CFLAGS) -S -o $@ $<
%.s: %.cpp
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.s: %.c
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.s: %.cpp
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) -MMD $(CFLAGS) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/../Makefile.ac
@echo CC $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) -MMD $(CFLAGS) -c -o $@ $<
.PHONY: all compile check_jsbsim
#
# Dependencies
#
DEPS = $(addprefix $(OBJDIR)/,$($(TARGET).srcs:.c=.d))
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif
-9
View File
@@ -7,9 +7,6 @@
<target name="sim" board="pc">
<subsystem name="ahrs" type="int_cmpl_quat"/>
</target>
<target name="jsbsim" board="pc">
<subsystem name="ahrs" type="int_cmpl_quat"/>
</target>
<define name="AGR_CLIMB" />
<define name="LOITER_TRIM" />
@@ -145,12 +142,6 @@
<define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
</section>
<section name="SIMU">
<define name="JSBSIM_MODEL" value="&quot;Malolo1&quot;"/>
<define name="JSBSIM_IR_ROLL_NEUTRAL" value="0." unit="deg"/>
<define name="JSBSIM_IR_PITCH_NEUTRAL" value="0." unit="deg"/>
</section>
<section name="INS" prefix="INS_">
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
-7
View File
@@ -155,16 +155,9 @@
<define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
</section>
<section name="SIMU">
<define name="JSBSIM_MODEL" value="&quot;Malolo1&quot;"/>
<define name="JSBSIM_IR_ROLL_NEUTRAL" value="0." unit="deg"/>
<define name="JSBSIM_IR_PITCH_NEUTRAL" value="0." unit="deg"/>
</section>
<firmware name="fixedwing">
<target name="sim" board="pc" />
<target name="jsbsim" board="pc"/>
<target name="ap" board="tiny_1.1"/>
<define name="AGR_CLIMB" />
-219
View File
@@ -1,219 +0,0 @@
<!DOCTYPE airframe SYSTEM "airframe.dtd">
<!-- Funjet Multiplex (http://www.multiplex-rc.de/)
Tiny 2.1 board (http://wiki.paparazziuav.org/wiki/index.php/Tiny_v2)
Tilted infrared sensor (http://wiki.paparazziuav.org/wiki/index.php/Image:Tiny_v2_1_Funjet.jpg)
Radiotronix modem
-->
<airframe name="Funjet 1 Tiny 2.1">
<!-- commands section -->
<servos>
<servo name="MOTOR" no="0" min="1000" neutral="1000" max="2000"/>
<servo name="AILEVON_LEFT" no="2" min="1130" neutral="1500" max="1880"/>
<servo name="AILEVON_RIGHT" no="6" min="1980" neutral="1515" max="1170"/>
</servos>
<commands>
<axis name="THROTTLE" failsafe_value="0"/>
<axis name="ROLL" failsafe_value="0"/>
<axis name="PITCH" failsafe_value="0"/>
</commands>
<rc_commands>
<set command="THROTTLE" value="@THROTTLE"/>
<set command="ROLL" value="@ROLL"/>
<set command="PITCH" value="@PITCH"/>
</rc_commands>
<section name="MIXER">
<define name="AILEVON_AILERON_RATE" value="0.75"/>
<define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
</section>
<command_laws>
<let var="aileron" value="@ROLL * AILEVON_AILERON_RATE"/>
<let var="elevator" value="@PITCH * AILEVON_ELEVATOR_RATE"/>
<set servo="MOTOR" value="@THROTTLE"/>
<set servo="AILEVON_LEFT" value="$elevator + $aileron"/>
<set servo="AILEVON_RIGHT" value="$elevator - $aileron"/>
</command_laws>
<section name="AUTO1" prefix="AUTO1_">
<define name="MAX_ROLL" value="0.85"/>
<define name="MAX_PITCH" value="0.6"/>
</section>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="ADC_1"/>
<define name="IR2" value="ADC_2"/>
<define name="IR_TOP" value="ADC_0"/>
<define name="IR_NB_SAMPLES" value="16"/>
</section>
<section name="INFRARED" prefix="IR_">
<define name="ADC_IR1_NEUTRAL" value="512"/>
<define name="ADC_IR2_NEUTRAL" value="512"/>
<define name="ADC_TOP_NEUTRAL" value="512"/>
<define name="LATERAL_CORRECTION" value="1."/>
<define name="LONGITUDINAL_CORRECTION" value="1."/>
<define name="VERTICAL_CORRECTION" value="1.5"/>
<define name="HORIZ_SENSOR_TILTED" value="1"/>
<define name="IR2_SIGN" value="-1"/>
<define name="TOP_SIGN" value="-1"/>
<define name="ROLL_NEUTRAL_DEFAULT" value="-3.6" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="6" unit="deg"/>
<define name="CORRECTION_UP" value="1."/>
<define name="CORRECTION_DOWN" value="1."/>
<define name="CORRECTION_LEFT" value="1."/>
<define name="CORRECTION_RIGHT" value="1."/>
</section>
<section name="IMU" prefix="IMU_">
<define name="GYRO_P_SIGN" value="-1."/>
<define name="GYRO_P_NEUTRAL" value="512"/>
<define name="GYRO_P_SENS" value="1." integer="16"/>
</section>
<section name="BAT">
<define name="MILLIAMP_AT_FULL_THROTTLE" value="2000"/>
<define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
</section>
<section name="MISC">
<define name="NOMINAL_AIRSPEED" value="17." unit="m/s"/>
<define name="CARROT" value="5." unit="s"/>
<define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
<define name="CONTROL_FREQUENCY" value="60" unit="Hz"/>
<!-- <define name="XBEE_INIT" value="\"ATPL2\rATRN1\rATTT80\r\""/> -->
<!-- <define name="NO_XBEE_API_INIT" value="TRUE"/> -->
<define name="TRIGGER_DELAY" value="1."/>
<define name="DEFAULT_CIRCLE_RADIUS" value="80."/>
</section>
<section name="VERTICAL CONTROL" prefix="V_CTL_">
<define name="POWER_CTL_BAT_NOMINAL" value="11.1" unit="volt"/>
<!-- outer loop proportional gain -->
<define name="ALTITUDE_PGAIN" value="0.04"/>
<!-- outer loop saturation -->
<define name="ALTITUDE_MAX_CLIMB" value="2."/>
<!-- auto throttle inner loop -->
<define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.35"/>
<define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.3"/>
<define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.80"/>
<define name="AUTO_THROTTLE_LOITER_TRIM" value="1500"/>
<define name="AUTO_THROTTLE_DASH_TRIM" value="-1000"/>
<define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.1" unit="%/(m/s)"/>
<define name="AUTO_THROTTLE_PGAIN" value="0.02"/>
<define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
<define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.1"/>
<!-- auto pitch inner loop -->
<define name="AUTO_PITCH_PGAIN" value="0.05"/>
<define name="AUTO_PITCH_IGAIN" value="0.075"/>
<define name="AUTO_PITCH_MAX_PITCH" value="0.35"/>
<define name="AUTO_PITCH_MIN_PITCH" value="-0.35"/>
<define name="THROTTLE_SLEW" value="0.5"/>
</section>
<section name="HORIZONTAL CONTROL" prefix="H_CTL_">
<define name="COURSE_PGAIN" value="1."/>
<define name="ROLL_MAX_SETPOINT" value="0.7" unit="rad"/>
<define name="PITCH_MAX_SETPOINT" value="0.5" unit="rad"/>
<define name="PITCH_MIN_SETPOINT" value="-0.5" unit="rad"/>
<define name="PITCH_PGAIN" value="10000."/>
<define name="PITCH_DGAIN" value="1.5"/>
<define name="ELEVATOR_OF_ROLL" value="2500"/>
<define name="ROLL_ATTITUDE_GAIN" value="7500"/>
<define name="ROLL_RATE_GAIN" value="1500"/>
</section>
<section name="NAV">
<define name="NAV_GLIDE_PITCH_TRIM" value="0"/>
<define name="NAV_CROSS_TRACK_ERROR_IGAIN" value="0.05"/>
<define name="NAV_CROSS_TRACK_ERROR_MAX" value="10." unit="deg"/>
</section>
<section name="AGGRESSIVE" prefix="AGR_">
<define name="BLEND_START" value="20"/><!-- Altitude Error to Initiate Aggressive Climb CANNOT BE ZERO!!-->
<define name="BLEND_END" value="10"/><!-- Altitude Error to Blend Aggressive to Regular Climb Modes CANNOT BE ZERO!!-->
<define name="CLIMB_THROTTLE" value="0.7"/><!-- Gaz for Aggressive Climb -->
<define name="CLIMB_PITCH" value="0.25"/><!-- Pitch for Aggressive Climb -->
<define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for Aggressive Decent -->
<define name="DESCENT_PITCH" value="-0.15"/><!-- Pitch for Aggressive Decent -->
<define name="CLIMB_NAV_RATIO" value="0.8"/><!-- Percent Navigation for Altitude Error Equal to Start Altitude -->
<define name="DESCENT_NAV_RATIO" value="1.0"/>
</section>
<section name="GYRO_GAINS">
<define name="GYRO_MAX_RATE" value="200."/>
<define name="ROLLRATESUM_NB_SAMPLES" value="64"/>
<define name="ALT_ROLL__PGAIN" value="1.0"/>
<define name="ROLL_RATE_PGAIN" value="1000.0"/>
<define name="ROLL_RATE_IGAIN" value="0.0"/>
<define name="ROLL_RATE_DGAIN" value="0.0"/>
</section>
<section name="FAILSAFE" prefix="FAILSAFE_">
<define name="DELAY_WITHOUT_GPS" value="1" unit="s"/>
<define name="DEFAULT_THROTTLE" value="0.3" unit="%"/>
<define name="DEFAULT_ROLL" value="0.3" unit="rad"/>
<define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
<define name="HOME_RADIUS" value="100" unit="m"/>
</section>
<section name="SIMU">
<define name="JSBSIM_MODEL" value="&quot;Malolo1&quot;"/>
<define name="JSBSIM_INIT" value="&quot;Malolo1-IC&quot;"/>
<define name="JSBSIM_LAUNCHSPEED" value="15.0"/>
<define name="JSBSIM_IR_ROLL_NEUTRAL" value="0." unit="deg"/>
<define name="JSBSIM_IR_PITCH_NEUTRAL" value="0." unit="deg"/>
</section>
<firmware name="fixedwing">
<target name="sim" board="pc" />
<target name="jsbsim" board="pc"/>
<target name="ap" board="tiny_2.1"/>
<define name="AGR_CLIMB" />
<define name="LOITER_TRIM" />
<subsystem name="radio_control" type="ppm"/>
<!-- Communication -->
<subsystem name="telemetry" type="transparent">
<configure name="MODEM_BAUD" value="B9600"/>
</subsystem>
<subsystem name="control"/>
<!-- Sensors -->
<subsystem name="imu" type="analog">
<configure name="GYRO_P" value="ADC_3"/>
</subsystem>
<subsystem name="ahrs" type="infrared"/>
<subsystem name="gps" type="ublox_utm"/>
<subsystem name="navigation"/>
</firmware>
<modules>
<load name="infrared_adc.xml"/>
</modules>
</airframe>
@@ -56,6 +56,3 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
@@ -57,5 +57,3 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
@@ -45,6 +45,3 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
@@ -58,5 +58,3 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
@@ -186,43 +186,6 @@ sim.srcs += $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_adc_generic.c
# hack: always compile some of the sim functions, so ocaml sim does not complain about no-existing functions
sim.srcs += $(SRC_ARCH)/sim_ahrs.c $(SRC_ARCH)/sim_ir.c
######################################################################
##
## JSBSIM THREAD SPECIFIC
##
JSBSIM_ROOT ?= /opt/jsbsim
JSBSIM_INC = $(JSBSIM_ROOT)/include/JSBSim
JSBSIM_LIB = $(JSBSIM_ROOT)/lib
# use the paparazzi-jsbsim package if it is installed,
# otherwise look for JSBsim under /opt/jsbsim
JSBSIM_PKG ?= $(shell pkg-config JSBSim --exists && echo 'yes')
ifeq ($(JSBSIM_PKG), yes)
jsbsim.CFLAGS += $(shell pkg-config JSBSim --cflags)
jsbsim.LDFLAGS += $(shell pkg-config JSBSim --libs)
else
JSBSIM_PKG = no
jsbsim.CFLAGS += -I$(JSBSIM_INC)
jsbsim.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
endif
jsbsim.CFLAGS += $(fbw_CFLAGS) $(ap_CFLAGS)
jsbsim.srcs += $(fbw_srcs) $(ap_srcs)
jsbsim.CFLAGS += -DSITL -DUSE_JSBSIM
jsbsim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c $(SIMDIR)/sim_ac_flightgear.c
# external libraries
jsbsim.CFLAGS += -I/usr/include $(shell pkg-config glib-2.0 --cflags)
jsbsim.LDFLAGS += $(shell pkg-config glib-2.0 --libs) -lglibivy -lm $(shell pcre-config --libs)
jsbsim.CFLAGS += -DDOWNLINK -DPERIODIC_TELEMETRY -DDOWNLINK_TRANSPORT=ivy_tp -DDOWNLINK_DEVICE=ivy_tp -DDefaultPeriodic='&telemetry_Ap'
jsbsim.srcs += subsystems/datalink/downlink.c $(SRC_FIRMWARE)/datalink.c subsystems/datalink/ivy_transport.c $(SRC_FIRMWARE)/ap_downlink.c $(SRC_FIRMWARE)/fbw_downlink.c subsystems/datalink/telemetry.c
jsbsim.srcs += $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ahrs.c $(SRC_ARCH)/jsbsim_transport.c
######################################################################
##
## Final Target Allocations
@@ -23,9 +23,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -22,9 +22,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -22,9 +22,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -27,9 +27,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
@@ -20,9 +20,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -21,9 +21,6 @@ sim.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -20,9 +20,6 @@ $(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c
sim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
jsbsim.CFLAGS += -DUSE_GPS -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
jsbsim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
nps.CFLAGS += -DUSE_GPS -DGPS_USE_LATLONG
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
@@ -45,6 +45,3 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
@@ -10,9 +10,6 @@ ap.srcs += $(ins_srcs)
sim.CFLAGS += $(ins_CFLAGS)
sim.srcs += $(ins_srcs)
jsbsim.CFLAGS += $(ins_CFLAGS)
jsbsim.srcs += $(ins_srcs)
nps.CFLAGS += $(ins_CFLAGS)
nps.srcs += $(ins_srcs)
@@ -47,7 +47,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
#########################################
## Simulator
SIM_TARGETS = sim jsbsim nps
SIM_TARGETS = sim nps
ifneq (,$(findstring $(TARGET),$(SIM_TARGETS)))
@@ -41,7 +41,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
#########################################
## Simulator
SIM_TARGETS = sim jsbsim nps
SIM_TARGETS = sim nps
ifneq (,$(findstring $(TARGET),$(SIM_TARGETS)))
@@ -41,8 +41,5 @@ ahrssim_srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_sim.c
sim.CFLAGS += $(ahrssim_CFLAGS)
sim.srcs += $(ahrssim_srcs)
jsbsim.CFLAGS += $(ahrssim_CFLAGS)
jsbsim.srcs += $(ahrssim_srcs)
test_ahrs.CFLAGS += $(AHRS_CFLAGS)
test_ahrs.srcs += $(AHRS_SRCS)
+1 -1
View File
@@ -14,7 +14,7 @@
<init fun="baro_sim_init()"/>
<periodic fun="baro_sim_periodic()" freq="10."/>
<makefile target="sim|jsbsim">
<makefile target="sim">
<file name="baro_sim.c"/>
<define name="USE_BARO_BOARD" value="FALSE"/>
</makefile>
+1 -1
View File
@@ -54,7 +54,7 @@
<periodic fun="gpio_cam_ctrl_periodic()" freq="4" autorun="TRUE"/>
<makefile target="ap|sim|nps|jsbsim">
<makefile target="ap|sim|nps">
<define name="DIGITAL_CAM" />
<file name="gpio_cam_ctrl.c"/>
<file name="dc.c"/>
+1 -1
View File
@@ -23,7 +23,7 @@
<periodic fun="servo_cam_ctrl_periodic()" freq="4" autorun="TRUE"/>
<makefile target="ap|sim|nps|jsbsim">
<makefile target="ap|sim|nps">
<define name="DIGITAL_CAM"/>
<file name="servo_cam_ctrl.c"/>
<file name="dc.c"/>
+1 -1
View File
@@ -41,7 +41,7 @@
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
</raw>
</makefile>
<makefile target="sim|jsbsim">
<makefile target="sim">
<file name="gps_sim.c" dir="subsystems/gps"/>
<define name="USE_GPS"/>
<define name="GPS_USE_LATLONG"/>
+1 -1
View File
@@ -31,7 +31,7 @@
</header>
<init fun="infrared_adc_init()"/>
<periodic fun="infrared_adc_update()" freq="60."/>
<makefile target="ap|sim|jsbsim">
<makefile target="ap|sim">
<define name="USE_INFRARED_TELEMETRY"/>
<file name="infrared.c" dir="subsystems/sensors"/>
<file name="infrared_adc.c" dir="subsystems/sensors"/>
+1 -1
View File
@@ -30,7 +30,7 @@
<periodic fun="infrared_i2c_update()" freq="60."/>
<!--periodic fun="infrared_i2cDownlink()" freq="1."/-->
<event fun="infrared_i2cEvent()"/>
<makefile target="ap|sim|jsbsim">
<makefile target="ap|sim">
<define name="USE_INFRARED_TELEMETRY"/>
<file name="infrared.c" dir="subsystems/sensors"/>
<file name="infrared_i2c.c" dir="subsystems/sensors"/>
+1 -1
View File
@@ -22,7 +22,7 @@
<header>
<file name="nav_bungee_takeoff.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_bungee_takeoff.c"/>
</makefile>
</module>
+1 -1
View File
@@ -35,7 +35,7 @@
<init fun="nav_catapult_setup()"/>
<!-- Run High Rate Lauch Detector -->
<periodic fun="nav_catapult_highrate_module()" autorun="TRUE"/>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_catapult.c"/>
</makefile>
</module>
+1 -1
View File
@@ -27,7 +27,7 @@
<header>
<file name="nav_cube.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_cube.c"/>
</makefile>
</module>
+1 -1
View File
@@ -11,7 +11,7 @@
<header>
<file name="nav_drop.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_drop.c"/>
</makefile>
</module>
+1 -1
View File
@@ -9,7 +9,7 @@
<header>
<file name="nav_flower.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_flower.c"/>
</makefile>
</module>
+1 -1
View File
@@ -12,7 +12,7 @@
<header>
<file name="nav_gls.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_gls.c"/>
</makefile>
</module>
+1 -1
View File
@@ -14,7 +14,7 @@
<header>
<file name="nav_line.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_line.c"/>
</makefile>
</module>
+1 -1
View File
@@ -19,7 +19,7 @@
<header>
<file name="nav_line_border.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_line_border.c"/>
</makefile>
</module>
+1 -1
View File
@@ -9,7 +9,7 @@
<header>
<file name="nav_line_osam.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_line_osam.c"/>
</makefile>
</module>
+1 -1
View File
@@ -16,7 +16,7 @@
<header>
<file name="nav_smooth.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_smooth.c"/>
</makefile>
</module>
+1 -1
View File
@@ -14,7 +14,7 @@
<header>
<file name="nav_spiral.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_spiral.c"/>
</makefile>
</module>
+1 -1
View File
@@ -9,7 +9,7 @@
<header>
<file name="nav_survey_disc.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_survey_disc.c"/>
</makefile>
</module>
+1 -1
View File
@@ -28,7 +28,7 @@ You can use:
<header>
<file name="nav_survey_poly_osam.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_survey_poly_osam.c"/>
</makefile>
</module>
+1 -1
View File
@@ -29,7 +29,7 @@ Block example:
<header>
<file name="nav_survey_polygon.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_survey_polygon.c"/>
</makefile>
</module>
+1 -1
View File
@@ -9,7 +9,7 @@
<header>
<file name="nav_survey_zamboni.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_survey_zamboni.c"/>
</makefile>
</module>
+1 -1
View File
@@ -9,7 +9,7 @@
<header>
<file name="nav_vertical_raster.h"/>
</header>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<file name="nav_vertical_raster.c"/>
</makefile>
</module>
+1 -1
View File
@@ -22,7 +22,7 @@
</header>
<init fun="servo_switch_init()"/>
<periodic fun="servo_switch_periodic()" freq="10."/>
<makefile target="ap|sim|jsbsim|nps">
<makefile target="ap|sim|nps">
<!-- these parameters should be set for that module in the airframe file unless you want the defaults
Servo value in usec
-30
View File
@@ -1,30 +0,0 @@
/** \file jsbsim_ahrs.c
* \brief Regroup functions to simulate an ahrs
*
* Ahrs soft simulation.
*/
#include "std.h"
float sim_phi; ///< in radians
float sim_theta; ///< in radians
float sim_psi; ///< in radians
float sim_p; ///< in radians/s
float sim_q; ///< in radians/s
float sim_r; ///< in radians/s
bool_t ahrs_sim_available;
// Updates from jsbsim
void provide_attitude_and_rates(float phi, float theta, float psi, float p, float q, float r)
{
sim_phi = phi;
sim_theta = theta;
sim_psi = psi;
sim_p = p;
sim_q = q;
sim_r = r;
ahrs_sim_available = TRUE;
}
-72
View File
@@ -1,72 +0,0 @@
/* OCaml binding to link the simulator to autopilot functions. */
#include <assert.h>
#include <math.h>
#include <inttypes.h>
/** From airborne/autopilot/ */
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "autopilot.h"
#include "subsystems/gps.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_geodetic_int.h"
// currently needed to get nav_utm_zone0
#include "subsystems/navigation/common_nav.h"
void sim_use_gps_pos(double lat, double lon, double alt, double course, double gspeed, double climb, double time)
{
gps.fix = 3; // Mode 3D
gps.course = course * 1e7;
gps.hmsl = alt * 1000.;
gps.gspeed = gspeed * 100.;
gps.ned_vel.z = -climb * 100.;
gps.week = 0; // FIXME
gps.tow = time * 1000.;
//TODO set alt above ellipsoid and hmsl
struct LlaCoor_f lla_f;
struct UtmCoor_f utm_f;
lla_f.lat = lat;
lla_f.lon = lon;
utm_f.zone = nav_utm_zone0;
utm_of_lla_f(&utm_f, &lla_f);
LLA_BFP_OF_REAL(gps.lla_pos, lla_f);
gps.utm_pos.east = utm_f.east * 100;
gps.utm_pos.north = utm_f.north * 100;
gps.utm_pos.zone = nav_utm_zone0;
gps_available = TRUE;
}
/** Space vehicle info simulation */
void sim_update_sv(void)
{
gps.nb_channels = 7;
int i;
static int time;
time++;
for (i = 0; i < gps.nb_channels; i++) {
gps.svinfos[i].svid = 7 + i;
gps.svinfos[i].elev = (cos(((100 * i) + time) / 100.) + 1) * 45;
gps.svinfos[i].azim = (time / gps.nb_channels + 50 * i) % 360;
gps.svinfos[i].cno = 40 + sin((time + i * 10) / 100.) * 10.;
gps.svinfos[i].flags = ((time / 10) % (i + 1) == 0 ? 0x00 : 0x01);
gps.svinfos[i].qi = (int)((time / 1000.) + i) % 8;
}
gps.pdop = gps.sacc = gps.pacc = 500 + 200 * sin(time / 100.);
gps.num_sv = 7;
}
void ubxsend_cfg_rst(uint16_t a __attribute__((unused)), uint8_t b __attribute__((unused)))
{
return;
}
-35
View File
@@ -1,35 +0,0 @@
/* Definitions and declarations required to compile autopilot code on a
i386 architecture */
#include "jsbsim_hw.h"
#include <stdio.h>
#include <assert.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
/* Dummy definitions to replace the ones from the files not compiled in the simulator */
//uint8_t ir_estim_mode;
//uint8_t vertical_mode;
//uint8_t inflight_calib_mode;
//bool_t rc_event_1, rc_event_2;
uint8_t gps_nb_ovrn, link_fbw_fbw_nb_err, link_fbw_nb_err;
//float alt_roll_pgain;
//float roll_rate_pgain;
uint16_t adc_generic_val1;
uint16_t adc_generic_val2;
//uint16_t ppm_pulses[ PPM_NB_PULSES ];
//volatile bool_t ppm_valid;
uint8_t ac_id;
void update_bat(double bat)
{
electrical.vsupply = (int)(bat * 10.);
}
void adc_generic_init(void) {}
void adc_generic_periodic(void) {}
-65
View File
@@ -1,65 +0,0 @@
/*
*
* Copyright (C) 2009 Enac
*
* 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.
*
*/
/** \file jsbsim_hw.h
*/
#ifndef JSBSIM_HW_H
#define JSBSIM_HW_H
#include <inttypes.h>
#include "std.h"
#include "inter_mcu.h"
#include "firmwares/fixedwing/autopilot.h"
#include "subsystems/gps.h"
#include "subsystems/navigation/traffic_info.h"
#include "generated/flight_plan.h"
#include "generated/airframe.h"
#include "generated/settings.h"
#include "firmwares/fixedwing/nav.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "subsystems/sensors/infrared.h"
#include "subsystems/commands.h"
#include "firmwares/fixedwing/main_ap.h"
#include "subsystems/datalink/downlink.h"
#include "sim_uart.h"
#include "subsystems/datalink/datalink.h"
void sim_use_gps_pos(double lat, double lon, double alt, double course, double gspeed, double climb, double time);
void sim_update_sv(void);
void set_ir(double roll, double pitch);
void provide_attitude_and_rates(float phi, float theta, float psi, float p, float q, float r);
void update_bat(double bat);
void parse_dl_ping(char *argv[]);
void parse_dl_acinfo(char *argv[]);
void parse_dl_setting(char *argv[]);
void parse_dl_get_setting(char *argv[]);
void parse_dl_block(char *argv[]);
void parse_dl_move_wp(char *argv[]);
#endif
-36
View File
@@ -1,36 +0,0 @@
/**
* \brief Regroup functions to simulate autopilot/infrared.c
*
* Infrared soft simulation.
*/
#include "jsbsim_hw.h"
#include <math.h>
#ifndef JSBSIM_IR_ROLL_NEUTRAL
#define JSBSIM_IR_ROLL_NEUTRAL 0.
#endif
#ifndef JSBSIM_IR_PITCH_NEUTRAL
#define JSBSIM_IR_PITCH_NEUTRAL 0.
#endif
void set_ir(double roll __attribute__((unused)), double pitch __attribute__((unused)))
{
// INFRARED_TELEMETRY : Stupid hack to use with modules
#if USE_INFRARED || USE_INFRARED_TELEMETRY
double ir_contrast = 150; //FIXME
double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral;
double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral;
infrared.roll = sin(roll_sensor) * ir_contrast;
infrared.pitch = sin(pitch_sensor) * ir_contrast;
infrared.top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast;
#endif
}
void ir_gain_calib(void) {}
/** Required by infrared.c:ir_init() */
void adc_buf_channel(uint8_t adc_channel __attribute__((unused)), struct adc_buf *s __attribute__((unused)),
uint8_t av_nb_sample __attribute__((unused))) {}
-73
View File
@@ -1,73 +0,0 @@
/* Datalink parsing functions */
#include "jsbsim_hw.h"
#include "math/pprz_geodetic_float.h"
#include <stdlib.h>
#define MOfCm(_x) (((float)(_x))/100.)
#define MOfMM(_x) (((float)(_x))/1000.)
void parse_dl_ping(char *argv[] __attribute__((unused)))
{
DOWNLINK_SEND_PONG(DefaultChannel, DefaultDevice);
}
void parse_dl_acinfo(char *argv[] __attribute__((unused)))
{
#ifdef TRAFFIC_INFO
uint8_t id = atoi(argv[8]);
float ux = MOfCm(atoi(argv[2]));
float uy = MOfCm(atoi(argv[3]));
float a = MOfCm(atoi(argv[4]));
float c = RadOfDeg(((float)atoi(argv[1])) / 10.);
float s = MOfCm(atoi(argv[6]));
float cl = MOfCm(atoi(argv[7]));
uint32_t t = atoi(argv[5]);
SetAcInfo(id, ux, uy, c, a, s, cl, t);
#endif
}
void parse_dl_setting(char *argv[])
{
uint8_t index = atoi(argv[2]);
float value = atof(argv[3]);
DlSetting(index, value);
DOWNLINK_SEND_DL_VALUE(DefaultChannel, DefaultDevice, &index, &value);
}
void parse_dl_get_setting(char *argv[])
{
uint8_t index = atoi(argv[2]);
float value = settings_get_value(index);
DOWNLINK_SEND_DL_VALUE(DefaultChannel, DefaultDevice, &index, &value);
}
void parse_dl_block(char *argv[])
{
int block = atoi(argv[1]);
nav_goto_block(block);
}
void parse_dl_move_wp(char *argv[])
{
uint8_t wp_id = atoi(argv[1]);
float a = MOfMM(atoi(argv[5]));
/* Computes from (lat, long) in the referenced UTM zone */
struct LlaCoor_f lla;
lla.lat = RadOfDeg((float)(atoi(argv[3]) / 1e7));
lla.lon = RadOfDeg((float)(atoi(argv[4]) / 1e7));
struct UtmCoor_f utm;
utm.zone = nav_utm_zone0;
utm_of_lla_f(&utm, &lla);
nav_move_waypoint(wp_id, utm.east, utm.north, a);
/* Waypoint range is limited. Computes the UTM pos back from the relative
coordinates */
utm.east = waypoints[wp_id].x + nav_utm_east0;
utm.north = waypoints[wp_id].y + nav_utm_north0;
DOWNLINK_SEND_WP_MOVED(DefaultChannel, DefaultDevice, &wp_id, &utm.east, &utm.north, &a, &nav_utm_zone0);
}

Some files were not shown because too many files have changed in this diff Show More