mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
[nps simulator] created the target 'nps' for the nps simulator
* currently only used for rotorcrafts * created and imu_nps implementation instead of using the sim arch to implement simulation of every IMU separately * updated makefiles and airframe files to new nps simulator
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
<define name="USE_GPS_ACC4R"/>
|
<define name="USE_GPS_ACC4R"/>
|
||||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<define name="USE_GPS_ACC4R"/>
|
<define name="USE_GPS_ACC4R"/>
|
||||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<!--define name="NPS_NO_SUPERVISION"/-->
|
<!--define name="NPS_NO_SUPERVISION"/-->
|
||||||
</target>
|
</target>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<define name="FAILSAFE_GROUND_DETECT"/>
|
<define name="FAILSAFE_GROUND_DETECT"/>
|
||||||
<define name="USE_GPS_ACC4R"/>
|
<define name="USE_GPS_ACC4R"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
|
|
||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="booz_1.0"/>
|
<target name="ap" board="booz_1.0"/>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
|
|||||||
@@ -220,7 +220,7 @@
|
|||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<subsystem name="actuators" type="asctec"/>
|
<subsystem name="actuators" type="asctec"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
<subsystem name="actuators" type="mkk"/>
|
||||||
|
|||||||
@@ -14,18 +14,17 @@
|
|||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<define name ="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
|
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
|
||||||
<define name ="OVERRIDE_UART5_IRQ_HANDLER"/>
|
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
|
<subsystem name="actuators" type="mkk"/>
|
||||||
<subsystem name="imu" type="aspirin_v1.5"/>
|
<subsystem name="imu" type="aspirin_v1.5"/>
|
||||||
<subsystem name="gps" type="ublox">
|
<subsystem name="gps" type="ublox">
|
||||||
<configure name="GPS_BAUD" value="B57600"/>
|
<configure name="GPS_BAUD" value="B57600"/>
|
||||||
@@ -84,13 +83,11 @@
|
|||||||
<axis name="THRUST" failsafe_value="0"/>
|
<axis name="THRUST" failsafe_value="0"/>
|
||||||
</commands>
|
</commands>
|
||||||
|
|
||||||
<!-- for the sim -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
||||||
<define name="NB" value="4"/>
|
<define name="NB" value="4"/>
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section name="SUPERVISION" prefix="SUPERVISION_">
|
<section name="SUPERVISION" prefix="SUPERVISION_">
|
||||||
<define name="MIN_MOTOR" value="2"/>
|
<define name="MIN_MOTOR" value="2"/>
|
||||||
<define name="MAX_MOTOR" value="210"/>
|
<define name="MAX_MOTOR" value="210"/>
|
||||||
@@ -268,7 +265,7 @@
|
|||||||
<section name="SIMULATOR" prefix="NPS_">
|
<section name="SIMULATOR" prefix="NPS_">
|
||||||
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
||||||
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
||||||
<define name="SENSORS_PARAMS" value=""nps_sensors_params_booz2_a1.h""/>
|
<define name="SENSORS_PARAMS" value=""nps_sensors_params_default.h""/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -8,23 +8,6 @@
|
|||||||
GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution)
|
GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution)
|
||||||
-->
|
-->
|
||||||
<airframe name="TestConfig">
|
<airframe name="TestConfig">
|
||||||
<!--
|
|
||||||
<firmware name="rotorcraft">
|
|
||||||
<target name="sim" board="pc"/>
|
|
||||||
<target name="ap" board="lisa_l_1.1"/>
|
|
||||||
|
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
|
||||||
<subsystem name="telemetry" type="xbee_api">
|
|
||||||
<configure name="MODEM_BAUD" value="B38400"/>
|
|
||||||
</subsystem>
|
|
||||||
<subsystem name="control"/>
|
|
||||||
<subsystem name="gps" type="ublox"/>
|
|
||||||
<subsystem name="imu" type="b2_v1.2"/>
|
|
||||||
<subsystem name="stabilization" type="euler"/>
|
|
||||||
<subsystem name="ahrs" type="int_cmpl_quat"/>
|
|
||||||
<subsystem name="navigation"/>
|
|
||||||
</firmware>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="lisa_l_1.1">
|
<target name="ap" board="lisa_l_1.1">
|
||||||
@@ -32,18 +15,17 @@
|
|||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<define name ="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
|
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
|
||||||
<define name ="OVERRIDE_UART5_IRQ_HANDLER"/>
|
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="actuators" type="mkk"/>
|
||||||
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<subsystem name="imu" type="b2_v1.2"/>
|
<subsystem name="imu" type="b2_v1.2"/>
|
||||||
<subsystem name="gps" type="ublox">
|
<subsystem name="gps" type="ublox">
|
||||||
<configure name="GPS_BAUD" value="B57600"/>
|
<configure name="GPS_BAUD" value="B57600"/>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<define name="USE_INS_NAV_INIT"/>
|
<define name="USE_INS_NAV_INIT"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -183,18 +183,17 @@
|
|||||||
<target name="ap" board="lisa_l_1.1">
|
<target name="ap" board="lisa_l_1.1">
|
||||||
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
|
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
|
||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<subsystem name="actuators" type="asctec_v2"/>
|
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
|
||||||
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
|
<subsystem name="actuators" type="asctec_v2"/>
|
||||||
<subsystem name="imu" type="b2_v1.1"/>
|
<subsystem name="imu" type="b2_v1.1"/>
|
||||||
<subsystem name="gps" type="ublox"/>
|
<subsystem name="gps" type="ublox"/>
|
||||||
<subsystem name="stabilization" type="euler"/>
|
<subsystem name="stabilization" type="euler"/>
|
||||||
|
|||||||
@@ -191,7 +191,7 @@
|
|||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
<subsystem name="actuators" type="mkk"/>
|
||||||
|
|||||||
@@ -39,13 +39,6 @@
|
|||||||
|
|
||||||
</command_laws>
|
</command_laws>
|
||||||
|
|
||||||
<!-- for the sim -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
|
||||||
<define name="NB" value="4"/>
|
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<section name="SUPERVISION" prefix="SUPERVISION_">
|
<section name="SUPERVISION" prefix="SUPERVISION_">
|
||||||
<define name="STOP_MOTOR" value="1000"/>
|
<define name="STOP_MOTOR" value="1000"/>
|
||||||
<define name="MIN_MOTOR" value="1100"/>
|
<define name="MIN_MOTOR" value="1100"/>
|
||||||
@@ -187,19 +180,19 @@
|
|||||||
<target name="ap" board="lisa_m_2.0">
|
<target name="ap" board="lisa_m_2.0">
|
||||||
<!-- <define name="BOOZ_START_DELAY" value="1"/> -->
|
<!-- <define name="BOOZ_START_DELAY" value="1"/> -->
|
||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<subsystem name="actuators" type="pwm_supervision"/>
|
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<define name="SERVO_HZ" value="400"/>
|
|
||||||
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<!--define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/-->
|
<!--define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/-->
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="actuators" type="pwm_supervision">
|
||||||
|
<define name="SERVO_HZ" value="400"/>
|
||||||
|
</subsystem>
|
||||||
<subsystem name="imu" type="aspirin_v2.1"/>
|
<subsystem name="imu" type="aspirin_v2.1"/>
|
||||||
<subsystem name="gps" type="ublox"/>
|
<subsystem name="gps" type="ublox"/>
|
||||||
<subsystem name="stabilization" type="int_quat"/>
|
<subsystem name="stabilization" type="int_quat"/>
|
||||||
|
|||||||
@@ -30,13 +30,6 @@
|
|||||||
|
|
||||||
</command_laws>
|
</command_laws>
|
||||||
|
|
||||||
<!-- for the sim -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
|
||||||
<define name="NB" value="4"/>
|
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<section name="SUPERVISION" prefix="SUPERVISION_">
|
<section name="SUPERVISION" prefix="SUPERVISION_">
|
||||||
<define name="STOP_MOTOR" value="1000"/>
|
<define name="STOP_MOTOR" value="1000"/>
|
||||||
<define name="MIN_MOTOR" value="1200"/>
|
<define name="MIN_MOTOR" value="1200"/>
|
||||||
@@ -206,19 +199,20 @@
|
|||||||
<target name="ap" board="lisa_m_1.0">
|
<target name="ap" board="lisa_m_1.0">
|
||||||
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
|
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
|
||||||
<subsystem name="radio_control" type="spektrum"/>
|
<subsystem name="radio_control" type="spektrum"/>
|
||||||
<subsystem name="actuators" type="pwm_supervision"/>
|
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
|
||||||
<define name="SERVO_HZ" value="400"/>
|
|
||||||
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
<define name="RADIO_MODE" value="RADIO_AUX2"/>
|
||||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="actuators" type="pwm_supervision">
|
||||||
|
<define name="SERVO_HZ" value="400"/>
|
||||||
|
</subsystem>
|
||||||
|
|
||||||
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<subsystem name="imu" type="aspirin_v1.0"/>
|
<subsystem name="imu" type="aspirin_v1.0"/>
|
||||||
<subsystem name="gps" type="ublox"/>
|
<subsystem name="gps" type="ublox"/>
|
||||||
<subsystem name="stabilization" type="euler"/>
|
<subsystem name="stabilization" type="euler"/>
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
<define name = "RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
|
<define name = "RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
|
||||||
<define name = "OVERRIDE_UART5_IRQ_HANDLER"/>
|
<define name = "OVERRIDE_UART5_IRQ_HANDLER"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
<subsystem name="actuators" type="mkk"/>
|
||||||
|
|||||||
@@ -14,12 +14,10 @@
|
|||||||
<axis name="THRUST" failsafe_value="0"/>
|
<axis name="THRUST" failsafe_value="0"/>
|
||||||
</commands>
|
</commands>
|
||||||
|
|
||||||
<!-- not needed anymore - in subsystem -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
||||||
<define name="NB" value="4"/>
|
<define name="NB" value="4"/>
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
||||||
</section>
|
</section>
|
||||||
<!-- -->
|
|
||||||
|
|
||||||
<section name="SUPERVISION" prefix="SUPERVISION_">
|
<section name="SUPERVISION" prefix="SUPERVISION_">
|
||||||
<define name="MIN_MOTOR" value="2"/>
|
<define name="MIN_MOTOR" value="2"/>
|
||||||
@@ -196,7 +194,7 @@
|
|||||||
|
|
||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="booz_1.0"/>
|
<target name="ap" board="booz_1.0"/>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
|
|||||||
@@ -7,13 +7,17 @@
|
|||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="lisa_m_2.0"/>
|
<target name="ap" board="lisa_m_2.0"/>
|
||||||
|
|
||||||
|
<target name="nps" board="pc">
|
||||||
|
<subsystem name="fdm" type="nps"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<subsystem name="actuators" type="pwm_supervision">
|
<subsystem name="actuators" type="pwm_supervision">
|
||||||
<define name="SERVO_HZ" value="400"/>
|
<define name="SERVO_HZ" value="400"/>
|
||||||
</subsystem>
|
</subsystem>
|
||||||
|
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<subsystem name="imu" type="aspirin_v2.0"/>
|
<subsystem name="imu" type="aspirin_v2.1"/>
|
||||||
<subsystem name="gps" type="ublox"/>
|
<subsystem name="gps" type="ublox"/>
|
||||||
<subsystem name="stabilization" type="int_quat"/>
|
<subsystem name="stabilization" type="int_quat"/>
|
||||||
<subsystem name="ahrs" type="int_cmpl_quat"/>
|
<subsystem name="ahrs" type="int_cmpl_quat"/>
|
||||||
@@ -175,6 +179,12 @@
|
|||||||
<define name="IGAIN" value="0"/>
|
<define name="IGAIN" value="0"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section name="SIMULATOR" prefix="NPS_">
|
||||||
|
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
||||||
|
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
||||||
|
<define name="SENSORS_PARAMS" value=""nps_sensors_params_default.h""/>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section name="AUTOPILOT">
|
<section name="AUTOPILOT">
|
||||||
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
|
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
|
||||||
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/>
|
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<target name="ap" board="lisa_m_1.0">
|
<target name="ap" board="lisa_m_1.0">
|
||||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
<section name="SIMULATOR" prefix="NPS_">
|
<section name="SIMULATOR" prefix="NPS_">
|
||||||
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
||||||
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
||||||
<define name="SENSORS_PARAMS" value=""nps_sensors_params_aspirin_1.5.h""/>
|
<define name="SENSORS_PARAMS" value=""nps_sensors_params_default.h""/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section name="AUTOPILOT">
|
<section name="AUTOPILOT">
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
|
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
<section name="SIMULATOR" prefix="NPS_">
|
<section name="SIMULATOR" prefix="NPS_">
|
||||||
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
<define name="ACTUATOR_NAMES" value="{"front_motor", "back_motor", "right_motor", "left_motor"}"/>
|
||||||
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
<define name="INITIAL_CONDITITONS" value=""reset00""/>
|
||||||
<define name="SENSORS_PARAMS" value=""nps_sensors_params_aspirin_1.5.h""/>
|
<define name="SENSORS_PARAMS" value=""nps_sensors_params_default.h""/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section name="AUTOPILOT">
|
<section name="AUTOPILOT">
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
<axis name="THRUST" failsafe_value="0"/>
|
<axis name="THRUST" failsafe_value="0"/>
|
||||||
</commands>
|
</commands>
|
||||||
|
|
||||||
<!-- for the sim -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
||||||
<define name="NB" value="4"/>
|
<define name="NB" value="4"/>
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x58, 0x56 }"/>
|
<define name="ADDR" value="{ 0x52, 0x54, 0x58, 0x56 }"/>
|
||||||
@@ -191,7 +190,7 @@
|
|||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
<subsystem name="actuators" type="mkk"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
<subsystem name="actuators" type="mkk"/>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
|
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,14 @@
|
|||||||
|
|
||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="lisa_m_1.0">
|
<target name="ap" board="lisa_m_1.0">
|
||||||
<subsystem name="actuators" type="pwm_supervision">
|
|
||||||
<define name="SERVO_HZ" value="400"/>
|
|
||||||
|
|
||||||
</subsystem>
|
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="actuators" type="pwm_supervision">
|
||||||
|
<define name="SERVO_HZ" value="400"/>
|
||||||
|
</subsystem>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<subsystem name="imu" type="aspirin_v1.5"/>
|
<subsystem name="imu" type="aspirin_v1.5"/>
|
||||||
@@ -41,13 +39,6 @@
|
|||||||
<!-- but can be empty if no additional servos are used -->
|
<!-- but can be empty if no additional servos are used -->
|
||||||
</command_laws>
|
</command_laws>
|
||||||
|
|
||||||
<!-- only for the nps sim -->
|
|
||||||
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
|
|
||||||
<define name="NB" value="4"/>
|
|
||||||
<!-- FRONT, BACK, RIGHT, LEFT -->
|
|
||||||
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section name="SUPERVISION" prefix="SUPERVISION_">
|
<section name="SUPERVISION" prefix="SUPERVISION_">
|
||||||
<define name="STOP_MOTOR" value="1000"/>
|
<define name="STOP_MOTOR" value="1000"/>
|
||||||
<define name="MIN_MOTOR" value="1100"/>
|
<define name="MIN_MOTOR" value="1100"/>
|
||||||
|
|||||||
@@ -4,15 +4,14 @@
|
|||||||
|
|
||||||
<firmware name="rotorcraft">
|
<firmware name="rotorcraft">
|
||||||
<target name="ap" board="lisa_m_2.0">
|
<target name="ap" board="lisa_m_2.0">
|
||||||
<subsystem name="actuators" type="pwm_supervision">
|
|
||||||
<define name="SERVO_HZ" value="400"/>
|
|
||||||
</subsystem>
|
|
||||||
</target>
|
</target>
|
||||||
<target name="sim" board="pc">
|
<target name="nps" board="pc">
|
||||||
<subsystem name="fdm" type="nps"/>
|
<subsystem name="fdm" type="nps"/>
|
||||||
<subsystem name="actuators" type="mkk"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<subsystem name="actuators" type="pwm_supervision">
|
||||||
|
<define name="SERVO_HZ" value="400"/>
|
||||||
|
</subsystem>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
<subsystem name="telemetry" type="transparent"/>
|
<subsystem name="telemetry" type="transparent"/>
|
||||||
<subsystem name="imu" type="aspirin_v2.1"/>
|
<subsystem name="imu" type="aspirin_v2.1"/>
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# Simulator
|
# Simulator
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
|
||||||
sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0
|
nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ ap.CFLAGS += -DUSE_I2C1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Simulator
|
# Simulator
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c
|
||||||
sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0
|
nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ ap.CFLAGS += -DUSE_I2C1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Simulator
|
# Simulator
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c
|
||||||
sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0
|
nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c
|
|||||||
ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c
|
ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c
|
||||||
|
|
||||||
# Simulator
|
# Simulator
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Simulator
|
# Simulator
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_skiron.c
|
nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_skiron.c
|
||||||
sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c0
|
nps.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c0
|
||||||
|
|
||||||
|
|||||||
@@ -30,5 +30,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
|
|||||||
ap.CFLAGS += $(AHRS_CFLAGS)
|
ap.CFLAGS += $(AHRS_CFLAGS)
|
||||||
ap.srcs += $(AHRS_SRCS)
|
ap.srcs += $(AHRS_SRCS)
|
||||||
|
|
||||||
sim.CFLAGS += $(AHRS_CFLAGS)
|
nps.CFLAGS += $(AHRS_CFLAGS)
|
||||||
sim.srcs += $(AHRS_SRCS)
|
nps.srcs += $(AHRS_SRCS)
|
||||||
|
|||||||
@@ -30,5 +30,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
|
|||||||
ap.CFLAGS += $(AHRS_CFLAGS)
|
ap.CFLAGS += $(AHRS_CFLAGS)
|
||||||
ap.srcs += $(AHRS_SRCS)
|
ap.srcs += $(AHRS_SRCS)
|
||||||
|
|
||||||
sim.CFLAGS += $(AHRS_CFLAGS)
|
nps.CFLAGS += $(AHRS_CFLAGS)
|
||||||
sim.srcs += $(AHRS_SRCS)
|
nps.srcs += $(AHRS_SRCS)
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
|
|||||||
ap.CFLAGS += $(AHRS_CFLAGS)
|
ap.CFLAGS += $(AHRS_CFLAGS)
|
||||||
ap.srcs += $(AHRS_SRCS)
|
ap.srcs += $(AHRS_SRCS)
|
||||||
|
|
||||||
sim.CFLAGS += $(AHRS_CFLAGS)
|
nps.CFLAGS += $(AHRS_CFLAGS)
|
||||||
sim.srcs += $(AHRS_SRCS)
|
nps.srcs += $(AHRS_SRCS)
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
|
|||||||
ap.CFLAGS += $(AHRS_CFLAGS)
|
ap.CFLAGS += $(AHRS_CFLAGS)
|
||||||
ap.srcs += $(AHRS_SRCS)
|
ap.srcs += $(AHRS_SRCS)
|
||||||
|
|
||||||
sim.CFLAGS += $(AHRS_CFLAGS)
|
nps.CFLAGS += $(AHRS_CFLAGS)
|
||||||
sim.srcs += $(AHRS_SRCS)
|
nps.srcs += $(AHRS_SRCS)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
|||||||
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
||||||
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c
|
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_AHRS_LKF -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
|
nps.CFLAGS += -DUSE_AHRS_LKF -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
|||||||
ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c
|
ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c
|
||||||
ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_opt.c
|
ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_opt.c
|
||||||
|
|
||||||
sim.CFLAGS += -I$(SRC_BOOZ_PRIV)
|
nps.CFLAGS += -I$(SRC_BOOZ_PRIV)
|
||||||
sim.CFLAGS += -DAHRS_ALIGNER_LED=3
|
nps.CFLAGS += -DAHRS_ALIGNER_LED=3
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
|
||||||
sim.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c
|
nps.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c
|
||||||
sim.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf_opt.c
|
nps.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf_opt.c
|
||||||
|
|||||||
@@ -17,28 +17,28 @@ SRC_BOARD=boards/$(BOARD)
|
|||||||
NPSDIR = $(SIMDIR)/nps
|
NPSDIR = $(SIMDIR)/nps
|
||||||
|
|
||||||
|
|
||||||
sim.ARCHDIR = $(ARCH)
|
nps.ARCHDIR = sim
|
||||||
|
|
||||||
sim.CFLAGS += -DSITL -DUSE_NPS
|
nps.CFLAGS += -DSITL -DUSE_NPS
|
||||||
sim.CFLAGS += `pkg-config glib-2.0 --cflags`
|
nps.CFLAGS += `pkg-config glib-2.0 --cflags`
|
||||||
sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lglibivy -lgsl -lgslcblas
|
nps.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
|
nps.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
|
# use the paparazzi-jsbsim package if it is installed, otherwise look for JSBsim under /opt/jsbsim
|
||||||
ifndef JSBSIM_PKG
|
ifndef JSBSIM_PKG
|
||||||
JSBSIM_PKG = $(shell pkg-config JSBSim --exists && echo 'yes')
|
JSBSIM_PKG = $(shell pkg-config JSBSim --exists && echo 'yes')
|
||||||
endif
|
endif
|
||||||
ifeq ($(JSBSIM_PKG), yes)
|
ifeq ($(JSBSIM_PKG), yes)
|
||||||
sim.CFLAGS += `pkg-config JSBSim --cflags`
|
nps.CFLAGS += `pkg-config JSBSim --cflags`
|
||||||
sim.LDFLAGS += `pkg-config JSBSim --libs`
|
nps.LDFLAGS += `pkg-config JSBSim --libs`
|
||||||
else
|
else
|
||||||
JSBSIM_PKG = no
|
JSBSIM_PKG = no
|
||||||
sim.CFLAGS += -I$(JSBSIM_INC)
|
nps.CFLAGS += -I$(JSBSIM_INC)
|
||||||
sim.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
|
nps.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
sim.srcs += $(NPSDIR)/nps_main.c \
|
nps.srcs += $(NPSDIR)/nps_main.c \
|
||||||
$(NPSDIR)/nps_fdm_jsbsim.c \
|
$(NPSDIR)/nps_fdm_jsbsim.c \
|
||||||
$(NPSDIR)/nps_random.c \
|
$(NPSDIR)/nps_random.c \
|
||||||
$(NPSDIR)/nps_sensors.c \
|
$(NPSDIR)/nps_sensors.c \
|
||||||
@@ -57,53 +57,53 @@ sim.srcs += $(NPSDIR)/nps_main.c \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sim.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
|
nps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
|
||||||
|
|
||||||
sim.srcs += firmwares/rotorcraft/main.c
|
nps.srcs += firmwares/rotorcraft/main.c
|
||||||
sim.srcs += mcu.c
|
nps.srcs += mcu.c
|
||||||
sim.srcs += $(SRC_ARCH)/mcu_arch.c
|
nps.srcs += $(SRC_ARCH)/mcu_arch.c
|
||||||
|
|
||||||
ifeq ($(TARGET), sim)
|
ifeq ($(TARGET), nps)
|
||||||
include $(CFG_SHARED)/i2c_select.makefile
|
include $(CFG_SHARED)/i2c_select.makefile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
sim.CFLAGS += -DPERIODIC_FREQUENCY=512
|
nps.CFLAGS += -DPERIODIC_FREQUENCY=512
|
||||||
#sim.CFLAGS += -DUSE_LED
|
#nps.CFLAGS += -DUSE_LED
|
||||||
sim.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
|
nps.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
|
||||||
|
|
||||||
sim.srcs += subsystems/settings.c
|
nps.srcs += subsystems/settings.c
|
||||||
sim.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
|
nps.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
|
||||||
|
|
||||||
sim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
|
nps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
|
||||||
sim.srcs += $(SRC_FIRMWARE)/telemetry.c \
|
nps.srcs += $(SRC_FIRMWARE)/telemetry.c \
|
||||||
subsystems/datalink/downlink.c \
|
subsystems/datalink/downlink.c \
|
||||||
$(SRC_ARCH)/ivy_transport.c
|
$(SRC_ARCH)/ivy_transport.c
|
||||||
|
|
||||||
sim.srcs += $(SRC_FIRMWARE)/commands.c
|
nps.srcs += $(SRC_FIRMWARE)/commands.c
|
||||||
|
|
||||||
sim.srcs += $(SRC_FIRMWARE)/datalink.c
|
nps.srcs += $(SRC_FIRMWARE)/datalink.c
|
||||||
|
|
||||||
#
|
#
|
||||||
# Math functions
|
# Math functions
|
||||||
#
|
#
|
||||||
sim.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c
|
nps.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c
|
||||||
|
|
||||||
sim.CFLAGS += -DROTORCRAFT_BARO_LED=2
|
nps.CFLAGS += -DROTORCRAFT_BARO_LED=2
|
||||||
sim.srcs += $(SRC_BOARD)/baro_board.c
|
nps.srcs += $(SRC_BOARD)/baro_board.c
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_ADC
|
nps.CFLAGS += -DUSE_ADC
|
||||||
sim.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
|
nps.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
|
||||||
sim.srcs += subsystems/electrical.c
|
nps.srcs += subsystems/electrical.c
|
||||||
# baro has variable offset amplifier on booz board
|
# baro has variable offset amplifier on booz board
|
||||||
#sim.CFLAGS += -DUSE_DAC
|
#nps.CFLAGS += -DUSE_DAC
|
||||||
#sim.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c
|
#nps.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c
|
||||||
|
|
||||||
|
|
||||||
#sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\"
|
#nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\"
|
||||||
#sim.CFLAGS += -DIMU_B2_VERSION_1_1
|
#nps.CFLAGS += -DIMU_B2_VERSION_1_1
|
||||||
|
|
||||||
sim.srcs += $(SRC_FIRMWARE)/autopilot.c
|
nps.srcs += $(SRC_FIRMWARE)/autopilot.c
|
||||||
|
|
||||||
#
|
#
|
||||||
# in makefile section of airframe xml
|
# in makefile section of airframe xml
|
||||||
@@ -112,9 +112,9 @@ sim.srcs += $(SRC_FIRMWARE)/autopilot.c
|
|||||||
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile
|
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile
|
||||||
#
|
#
|
||||||
|
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_rate.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_rate.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_none.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_none.c
|
||||||
|
|
||||||
|
|
||||||
NUM_TYPE=integer
|
NUM_TYPE=integer
|
||||||
@@ -124,39 +124,39 @@ STAB_TYPE=euler
|
|||||||
#STAB_TYPE=quaternion
|
#STAB_TYPE=quaternion
|
||||||
|
|
||||||
ifeq ($(NUM_TYPE), integer)
|
ifeq ($(NUM_TYPE), integer)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\"
|
||||||
ifeq ($(STAB_TYPE), euler)
|
ifeq ($(STAB_TYPE), euler)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_int.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_int.h\"
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_int.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_int.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_int.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_int.c
|
||||||
else ifeq ($(STAB_TYPE), quaternion)
|
else ifeq ($(STAB_TYPE), quaternion)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_int.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_int.h\"
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_int.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_int.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_int.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_int.c
|
||||||
endif
|
endif
|
||||||
else ifeq ($(NUM_TYPE), float)
|
else ifeq ($(NUM_TYPE), float)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\"
|
||||||
ifeq ($(STAB_TYPE), euler)
|
ifeq ($(STAB_TYPE), euler)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_float.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_float.h\"
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_float.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_float.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_float.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_float.c
|
||||||
else ifeq ($(STAB_TYPE), quaternion)
|
else ifeq ($(STAB_TYPE), quaternion)
|
||||||
sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_float.h\"
|
nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_float.h\"
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_float.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_float.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_float.c
|
nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_float.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_NAVIGATION
|
nps.CFLAGS += -DUSE_NAVIGATION
|
||||||
sim.srcs += $(SRC_FIRMWARE)/guidance/guidance_h.c
|
nps.srcs += $(SRC_FIRMWARE)/guidance/guidance_h.c
|
||||||
sim.srcs += $(SRC_FIRMWARE)/guidance/guidance_v.c
|
nps.srcs += $(SRC_FIRMWARE)/guidance/guidance_v.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ins.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ins.c
|
||||||
|
|
||||||
# vertical filter float version
|
# vertical filter float version
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c
|
||||||
sim.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)'
|
nps.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)'
|
||||||
|
|
||||||
#
|
#
|
||||||
# INS choice
|
# INS choice
|
||||||
@@ -167,5 +167,5 @@ sim.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)'
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
sim.srcs += $(SRC_FIRMWARE)/navigation.c
|
nps.srcs += $(SRC_FIRMWARE)/navigation.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c
|
|||||||
|
|
||||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c
|
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_GPS
|
nps.CFLAGS += -DUSE_GPS
|
||||||
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
|
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
|
|||||||
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_skytraq.c
|
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_skytraq.c
|
||||||
|
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_GPS
|
nps.CFLAGS += -DUSE_GPS
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ifneq ($(GPS_LED),none)
|
|||||||
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
|
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_GPS
|
nps.CFLAGS += -DUSE_GPS
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
|
||||||
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
|
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
|
||||||
|
|||||||
@@ -83,12 +83,4 @@ ap.srcs += $(imu_srcs)
|
|||||||
#
|
#
|
||||||
# Simulator
|
# Simulator
|
||||||
#
|
#
|
||||||
|
include $(CFG_SHARED)/imu_nps.makefile
|
||||||
sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_crista.h\"
|
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu.c
|
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_crista.c
|
|
||||||
sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_crista_arch.c
|
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_AMI601
|
|
||||||
sim.srcs += peripherals/ami601.c
|
|
||||||
sim.CFLAGS += -DUSE_I2C1
|
|
||||||
|
|||||||
@@ -84,12 +84,4 @@ ap.srcs += $(imu_srcs)
|
|||||||
#
|
#
|
||||||
# Simulator
|
# Simulator
|
||||||
#
|
#
|
||||||
|
include $(CFG_SHARED)/imu_nps.makefile
|
||||||
sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_crista.h\"
|
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu.c
|
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_crista.c
|
|
||||||
sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_crista_arch.c
|
|
||||||
|
|
||||||
sim.CFLAGS += -DUSE_AMI601
|
|
||||||
sim.srcs += peripherals/ami601.c
|
|
||||||
sim.CFLAGS += -DUSE_I2C1
|
|
||||||
|
|||||||
@@ -2,26 +2,12 @@
|
|||||||
#
|
#
|
||||||
# Common part for all Aspirin IMUs
|
# Common part for all Aspirin IMUs
|
||||||
#
|
#
|
||||||
|
# if ACCEL and GYRO SENS/NEUTRAL are not defined,
|
||||||
|
# the defaults from the datasheet will be used
|
||||||
#
|
#
|
||||||
# required xml:
|
# required xml:
|
||||||
# <section name="IMU" prefix="IMU_">
|
# <section name="IMU" prefix="IMU_">
|
||||||
#
|
#
|
||||||
# <define name="GYRO_X_NEUTRAL" value="33924"/>
|
|
||||||
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
|
|
||||||
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
|
|
||||||
#
|
|
||||||
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
|
|
||||||
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
|
|
||||||
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
|
|
||||||
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
|
|
||||||
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
||||||
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
||||||
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
||||||
@@ -34,8 +20,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
# imu aspirin
|
|
||||||
|
|
||||||
# for fixedwing firmware and ap only
|
# for fixedwing firmware and ap only
|
||||||
ifeq ($(TARGET), ap)
|
ifeq ($(TARGET), ap)
|
||||||
IMU_ASPIRIN_CFLAGS = -DUSE_IMU
|
IMU_ASPIRIN_CFLAGS = -DUSE_IMU
|
||||||
@@ -60,5 +44,4 @@ IMU_ASPIRIN_CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2
|
|||||||
IMU_ASPIRIN_CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA
|
IMU_ASPIRIN_CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sim.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -DHMC5843_NO_IRQ
|
include $(CFG_SHARED)/imu_nps.makefile
|
||||||
sim.srcs += $(IMU_ASPIRIN_SRCS)
|
|
||||||
|
|||||||
@@ -3,25 +3,12 @@
|
|||||||
# Aspirin IMU v1.0
|
# Aspirin IMU v1.0
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# if ACCEL and GYRO SENS/NEUTRAL are not defined,
|
||||||
|
# the defaults from the datasheet will be used
|
||||||
|
#
|
||||||
# required xml:
|
# required xml:
|
||||||
# <section name="IMU" prefix="IMU_">
|
# <section name="IMU" prefix="IMU_">
|
||||||
#
|
#
|
||||||
# <define name="GYRO_X_NEUTRAL" value="33924"/>
|
|
||||||
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
|
|
||||||
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
|
|
||||||
#
|
|
||||||
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
|
|
||||||
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
|
|
||||||
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
|
|
||||||
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
|
|
||||||
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
||||||
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
||||||
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
||||||
@@ -32,9 +19,6 @@
|
|||||||
#
|
#
|
||||||
# </section>
|
# </section>
|
||||||
#
|
#
|
||||||
#
|
|
||||||
|
|
||||||
# imu aspirin
|
|
||||||
|
|
||||||
include $(CFG_SHARED)/imu_aspirin_common.makefile
|
include $(CFG_SHARED)/imu_aspirin_common.makefile
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,12 @@
|
|||||||
# Aspirin IMU v1.5
|
# Aspirin IMU v1.5
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# if ACCEL and GYRO SENS/NEUTRAL are not defined,
|
||||||
|
# the defaults from the datasheet will be used
|
||||||
|
#
|
||||||
# required xml:
|
# required xml:
|
||||||
# <section name="IMU" prefix="IMU_">
|
# <section name="IMU" prefix="IMU_">
|
||||||
#
|
#
|
||||||
# <define name="GYRO_X_NEUTRAL" value="33924"/>
|
|
||||||
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
|
|
||||||
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
|
|
||||||
#
|
|
||||||
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
|
|
||||||
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
|
|
||||||
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
|
|
||||||
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
|
|
||||||
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
||||||
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
||||||
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
||||||
@@ -32,9 +19,6 @@
|
|||||||
#
|
#
|
||||||
# </section>
|
# </section>
|
||||||
#
|
#
|
||||||
#
|
|
||||||
|
|
||||||
# imu aspirin
|
|
||||||
|
|
||||||
include $(CFG_SHARED)/imu_aspirin_common.makefile
|
include $(CFG_SHARED)/imu_aspirin_common.makefile
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,12 @@
|
|||||||
# Aspirin IMU v2.0
|
# Aspirin IMU v2.0
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# if ACCEL and GYRO SENS/NEUTRAL are not defined,
|
||||||
|
# the defaults from the datasheet will be used
|
||||||
|
#
|
||||||
# required xml:
|
# required xml:
|
||||||
# <section name="IMU" prefix="IMU_">
|
# <section name="IMU" prefix="IMU_">
|
||||||
#
|
#
|
||||||
# <define name="GYRO_X_NEUTRAL" value="33924"/>
|
|
||||||
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
|
|
||||||
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
|
|
||||||
#
|
|
||||||
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
|
|
||||||
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
|
|
||||||
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
|
|
||||||
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
|
|
||||||
#
|
|
||||||
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
|
|
||||||
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
|
|
||||||
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
|
|
||||||
#
|
|
||||||
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
||||||
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
||||||
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
||||||
@@ -34,8 +21,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
# imu aspirin
|
|
||||||
|
|
||||||
IMU_ASPIRIN_CFLAGS = -DUSE_IMU
|
IMU_ASPIRIN_CFLAGS = -DUSE_IMU
|
||||||
IMU_ASPIRIN_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin2.h\" -DIMU_OVERRIDE_CHANNELS
|
IMU_ASPIRIN_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin2.h\" -DIMU_OVERRIDE_CHANNELS
|
||||||
IMU_ASPIRIN_SRCS = $(SRC_SUBSYSTEMS)/imu.c \
|
IMU_ASPIRIN_SRCS = $(SRC_SUBSYSTEMS)/imu.c \
|
||||||
@@ -62,3 +47,7 @@ IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_2_1
|
|||||||
ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS)
|
ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS)
|
||||||
ap.srcs += $(IMU_ASPIRIN_SRCS)
|
ap.srcs += $(IMU_ASPIRIN_SRCS)
|
||||||
|
|
||||||
|
#
|
||||||
|
# NPS simulator
|
||||||
|
#
|
||||||
|
include $(CFG_SHARED)/imu_nps.makefile
|
||||||
|
|||||||
@@ -61,17 +61,18 @@ endif
|
|||||||
#
|
#
|
||||||
# Simulator
|
# Simulator
|
||||||
#
|
#
|
||||||
|
include $(CFG_SHARED)/imu_nps.makefile
|
||||||
|
|
||||||
sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\"
|
#sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\"
|
||||||
sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601
|
#sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601
|
||||||
sim.CFLAGS += -DIMU_B2_VERSION_1_0
|
#sim.CFLAGS += -DIMU_B2_VERSION_1_0
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu.c
|
#sim.srcs += $(SRC_SUBSYSTEMS)/imu.c
|
||||||
sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c
|
#sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c
|
||||||
sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c
|
#sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c
|
||||||
|
#
|
||||||
sim.srcs += peripherals/max1168.c
|
#sim.srcs += peripherals/max1168.c
|
||||||
sim.srcs += $(SRC_ARCH)/peripherals/max1168_arch.c
|
#sim.srcs += $(SRC_ARCH)/peripherals/max1168_arch.c
|
||||||
|
#
|
||||||
sim.CFLAGS += -DUSE_AMI601
|
#sim.CFLAGS += -DUSE_AMI601
|
||||||
sim.srcs += peripherals/ami601.c
|
#sim.srcs += peripherals/ami601.c
|
||||||
sim.CFLAGS += -DUSE_I2C1
|
#sim.CFLAGS += -DUSE_I2C1
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
|
#
|
||||||
|
# simulated IMU for NPS (NewPaparazziSim)
|
||||||
|
#
|
||||||
|
# If ACCEL and GYRO SENS/NEUTRAL are not defined,
|
||||||
|
# the defaults of aspirin v1.5 are used.
|
||||||
|
# This fits the nps_sensors_params_default.h
|
||||||
|
#
|
||||||
|
# required xml:
|
||||||
|
# <section name="IMU" prefix="IMU_">
|
||||||
|
#
|
||||||
|
# <define name="MAG_X_NEUTRAL" value="2358"/>
|
||||||
|
# <define name="MAG_Y_NEUTRAL" value="2362"/>
|
||||||
|
# <define name="MAG_Z_NEUTRAL" value="2119"/>
|
||||||
|
#
|
||||||
|
# <define name="MAG_X_SENS" value="3.4936416" integer="16"/>
|
||||||
|
# <define name="MAG_Y_SENS" value="3.607713" integer="16"/>
|
||||||
|
# <define name="MAG_Z_SENS" value="4.90788848" integer="16"/>
|
||||||
|
#
|
||||||
|
# </section>
|
||||||
|
#
|
||||||
|
|
||||||
|
nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_nps.h\"
|
||||||
|
nps.srcs += $(SRC_SUBSYSTEMS)/imu.c $(SRC_SUBSYSTEMS)/imu/imu_nps.c
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NPS_SENSORS_PARAMS_H
|
||||||
|
#define NPS_SENSORS_PARAMS_H
|
||||||
|
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
#include "subsystems/imu.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define NPS_BODY_TO_IMU_PHI IMU_BODY_TO_IMU_PHI
|
||||||
|
#define NPS_BODY_TO_IMU_THETA IMU_BODY_TO_IMU_THETA
|
||||||
|
#define NPS_BODY_TO_IMU_PSI IMU_BODY_TO_IMU_PSI
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Accelerometer
|
||||||
|
*/
|
||||||
|
/* ADXL345 configured to +-16g with 13bit resolution */
|
||||||
|
#define NPS_ACCEL_MIN -4095
|
||||||
|
#define NPS_ACCEL_MAX 4095
|
||||||
|
/* ms-2 */
|
||||||
|
/* aka 2^10/ACCEL_X_SENS */
|
||||||
|
#define NPS_ACCEL_SENSITIVITY_XX ACCEL_BFP_OF_REAL(1./IMU_ACCEL_X_SENS)
|
||||||
|
#define NPS_ACCEL_SENSITIVITY_YY ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Y_SENS)
|
||||||
|
#define NPS_ACCEL_SENSITIVITY_ZZ ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Z_SENS)
|
||||||
|
|
||||||
|
#define NPS_ACCEL_NEUTRAL_X IMU_ACCEL_X_NEUTRAL
|
||||||
|
#define NPS_ACCEL_NEUTRAL_Y IMU_ACCEL_Y_NEUTRAL
|
||||||
|
#define NPS_ACCEL_NEUTRAL_Z IMU_ACCEL_Z_NEUTRAL
|
||||||
|
/* m2s-4 */
|
||||||
|
#define NPS_ACCEL_NOISE_STD_DEV_X 5.e-2
|
||||||
|
#define NPS_ACCEL_NOISE_STD_DEV_Y 5.e-2
|
||||||
|
#define NPS_ACCEL_NOISE_STD_DEV_Z 5.e-2
|
||||||
|
/* ms-2 */
|
||||||
|
#define NPS_ACCEL_BIAS_X 0
|
||||||
|
#define NPS_ACCEL_BIAS_Y 0
|
||||||
|
#define NPS_ACCEL_BIAS_Z 0
|
||||||
|
/* s */
|
||||||
|
#define NPS_ACCEL_DT (1./512.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gyrometer
|
||||||
|
*/
|
||||||
|
/* IMU-3000 has 16 bit resolution */
|
||||||
|
#define NPS_GYRO_MIN -32767
|
||||||
|
#define NPS_GYRO_MAX 32767
|
||||||
|
|
||||||
|
/* 2^12/GYRO_X_SENS */
|
||||||
|
#define NPS_GYRO_SENSITIVITY_PP RATE_BFP_OF_REAL(1./IMU_GYRO_P_SENS)
|
||||||
|
#define NPS_GYRO_SENSITIVITY_QQ RATE_BFP_OF_REAL(1./IMU_GYRO_Q_SENS)
|
||||||
|
#define NPS_GYRO_SENSITIVITY_RR RATE_BFP_OF_REAL(1./IMU_GYRO_R_SENS)
|
||||||
|
|
||||||
|
#define NPS_GYRO_NEUTRAL_P IMU_GYRO_P_NEUTRAL
|
||||||
|
#define NPS_GYRO_NEUTRAL_Q IMU_GYRO_Q_NEUTRAL
|
||||||
|
#define NPS_GYRO_NEUTRAL_R IMU_GYRO_R_NEUTRAL
|
||||||
|
|
||||||
|
#define NPS_GYRO_NOISE_STD_DEV_P RadOfDeg(0.)
|
||||||
|
#define NPS_GYRO_NOISE_STD_DEV_Q RadOfDeg(0.)
|
||||||
|
#define NPS_GYRO_NOISE_STD_DEV_R RadOfDeg(0.)
|
||||||
|
|
||||||
|
#define NPS_GYRO_BIAS_INITIAL_P RadOfDeg( 0.0)
|
||||||
|
#define NPS_GYRO_BIAS_INITIAL_Q RadOfDeg( 0.0)
|
||||||
|
#define NPS_GYRO_BIAS_INITIAL_R RadOfDeg( 0.0)
|
||||||
|
|
||||||
|
#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_P RadOfDeg(0.5)
|
||||||
|
#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_Q RadOfDeg(0.5)
|
||||||
|
#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_R RadOfDeg(0.5)
|
||||||
|
/* s */
|
||||||
|
#define NPS_GYRO_DT (1./512.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magnetometer
|
||||||
|
*/
|
||||||
|
/* HMC5843 has 12 bit resolution */
|
||||||
|
#define NPS_MAG_MIN -2047
|
||||||
|
#define NPS_MAG_MAX 2047
|
||||||
|
|
||||||
|
#define NPS_MAG_IMU_TO_SENSOR_PHI 0.
|
||||||
|
#define NPS_MAG_IMU_TO_SENSOR_THETA 0.
|
||||||
|
#define NPS_MAG_IMU_TO_SENSOR_PSI 0.
|
||||||
|
|
||||||
|
#define NPS_MAG_SENSITIVITY_XX MAG_BFP_OF_REAL(1./IMU_MAG_X_SENS)
|
||||||
|
#define NPS_MAG_SENSITIVITY_YY MAG_BFP_OF_REAL(1./IMU_MAG_Y_SENS)
|
||||||
|
#define NPS_MAG_SENSITIVITY_ZZ MAG_BFP_OF_REAL(1./IMU_MAG_Z_SENS)
|
||||||
|
|
||||||
|
#define NPS_MAG_NEUTRAL_X IMU_MAG_X_NEUTRAL
|
||||||
|
#define NPS_MAG_NEUTRAL_Y IMU_MAG_Y_NEUTRAL
|
||||||
|
#define NPS_MAG_NEUTRAL_Z IMU_MAG_Z_NEUTRAL
|
||||||
|
|
||||||
|
#define NPS_MAG_NOISE_STD_DEV_X 2e-3
|
||||||
|
#define NPS_MAG_NOISE_STD_DEV_Y 2e-3
|
||||||
|
#define NPS_MAG_NOISE_STD_DEV_Z 2e-3
|
||||||
|
|
||||||
|
#define NPS_MAG_DT (1./100.)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Range meter
|
||||||
|
*/
|
||||||
|
#define BSM_RANGEMETER_RESOLUTION (1024)
|
||||||
|
#define BSM_RANGEMETER_SENSITIVITY (1024. / 12.)
|
||||||
|
#define BSM_RANGEMETER_MAX_RANGE (6. * BSM_RANGEMETER_SENSITIVITY)
|
||||||
|
#define BSM_RANGEMETER_DT (1./20.)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Barometer
|
||||||
|
*/
|
||||||
|
/* m */
|
||||||
|
/* aka 2^8/INS_BARO_SENS */
|
||||||
|
#define NPS_BARO_QNH 900.
|
||||||
|
#define NPS_BARO_SENSITIVITY 17.066667
|
||||||
|
#define NPS_BARO_DT (1./100.)
|
||||||
|
#define NPS_BARO_NOISE_STD_DEV 5.e-2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GPS
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GPS_PERFECT
|
||||||
|
#define GPS_PERFECT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if GPS_PERFECT
|
||||||
|
|
||||||
|
#define NPS_GPS_SPEED_NOISE_STD_DEV 0.
|
||||||
|
#define NPS_GPS_SPEED_LATENCY 0.
|
||||||
|
#define NPS_GPS_POS_NOISE_STD_DEV 0.001
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_X 0.
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_Y 0.
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_Z 0.
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 0.
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 0.
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 0.
|
||||||
|
#define NPS_GPS_POS_LATENCY 0.
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define NPS_GPS_SPEED_NOISE_STD_DEV 0.5
|
||||||
|
#define NPS_GPS_SPEED_LATENCY 0.2
|
||||||
|
#define NPS_GPS_POS_NOISE_STD_DEV 2
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_X 0e-1
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_Y -0e-1
|
||||||
|
#define NPS_GPS_POS_BIAS_INITIAL_Z -0e-1
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-3
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-3
|
||||||
|
#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-3
|
||||||
|
#define NPS_GPS_POS_LATENCY 0.2
|
||||||
|
|
||||||
|
#endif /* GPS_PERFECT */
|
||||||
|
|
||||||
|
#define NPS_GPS_DT (1./4.)
|
||||||
|
|
||||||
|
#endif /* NPS_SENSORS_PARAMS_H */
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "subsystems/imu.h"
|
||||||
|
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
|
||||||
|
#include "nps_sensors.h"
|
||||||
|
|
||||||
|
struct ImuNps imu_nps;
|
||||||
|
|
||||||
|
void imu_impl_init(void) {
|
||||||
|
|
||||||
|
imu_nps.gyro_available = FALSE;
|
||||||
|
imu_nps.mag_available = FALSE;
|
||||||
|
imu_nps.accel_available = FALSE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void imu_periodic(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void imu_feed_gyro_accel(void) {
|
||||||
|
|
||||||
|
RATES_ASSIGN(imu.gyro_unscaled, sensors.gyro.value.x, sensors.gyro.value.y, sensors.gyro.value.z);
|
||||||
|
VECT3_ASSIGN(imu.accel_unscaled, sensors.accel.value.x, sensors.accel.value.y, sensors.accel.value.z);
|
||||||
|
|
||||||
|
// set availability flags...
|
||||||
|
imu_nps.accel_available = TRUE;
|
||||||
|
imu_nps.gyro_available = TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void imu_feed_mag(void) {
|
||||||
|
|
||||||
|
VECT3_ASSIGN(imu.mag_unscaled, sensors.mag.value.x, sensors.mag.value.y, sensors.mag.value.z);
|
||||||
|
imu_nps.gyro_available = TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef IMU_NPS_H
|
||||||
|
#define IMU_NPS_H
|
||||||
|
|
||||||
|
#include "subsystems/imu.h"
|
||||||
|
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
|
||||||
|
/** we just define some defaults for aspirin v1.5 for now
|
||||||
|
*/
|
||||||
|
#if !defined IMU_GYRO_P_SENS & !defined IMU_GYRO_Q_SENS & !defined IMU_GYRO_R_SENS
|
||||||
|
#define IMU_GYRO_P_SENS 4.359
|
||||||
|
#define IMU_GYRO_P_SENS_NUM 4359
|
||||||
|
#define IMU_GYRO_P_SENS_DEN 1000
|
||||||
|
#define IMU_GYRO_Q_SENS 4.359
|
||||||
|
#define IMU_GYRO_Q_SENS_NUM 4359
|
||||||
|
#define IMU_GYRO_Q_SENS_DEN 1000
|
||||||
|
#define IMU_GYRO_R_SENS 4.359
|
||||||
|
#define IMU_GYRO_R_SENS_NUM 4359
|
||||||
|
#define IMU_GYRO_R_SENS_DEN 1000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/** we just define some defaults for aspirin v1.5 for now
|
||||||
|
*/
|
||||||
|
#if !defined IMU_ACCEL_X_SENS & !defined IMU_ACCEL_Y_SENS & !defined IMU_ACCEL_Z_SENS
|
||||||
|
#define IMU_ACCEL_X_SENS 37.91
|
||||||
|
#define IMU_ACCEL_X_SENS_NUM 3791
|
||||||
|
#define IMU_ACCEL_X_SENS_DEN 100
|
||||||
|
#define IMU_ACCEL_Y_SENS 37.91
|
||||||
|
#define IMU_ACCEL_Y_SENS_NUM 3791
|
||||||
|
#define IMU_ACCEL_Y_SENS_DEN 100
|
||||||
|
#define IMU_ACCEL_Z_SENS 39.24
|
||||||
|
#define IMU_ACCEL_Z_SENS_NUM 3924
|
||||||
|
#define IMU_ACCEL_Z_SENS_DEN 100
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
struct ImuNps {
|
||||||
|
uint8_t mag_available;
|
||||||
|
uint8_t accel_available;
|
||||||
|
uint8_t gyro_available;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct ImuNps imu_nps;
|
||||||
|
|
||||||
|
extern void imu_feed_gyro_accel(void);
|
||||||
|
extern void imu_feed_mag(void);
|
||||||
|
|
||||||
|
#define ImuMagEvent(_mag_handler) { \
|
||||||
|
if (imu_nps.mag_available) { \
|
||||||
|
imu_nps.mag_available = FALSE; \
|
||||||
|
_mag_handler(); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) { \
|
||||||
|
if (imu_nps.accel_available) { \
|
||||||
|
imu_nps.accel_available = FALSE; \
|
||||||
|
_accel_handler(); \
|
||||||
|
} \
|
||||||
|
if (imu_nps.gyro_available) { \
|
||||||
|
imu_nps.gyro_available = FALSE; \
|
||||||
|
_gyro_handler(); \
|
||||||
|
} \
|
||||||
|
ImuMagEvent(_mag_handler); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ImuScaleGyro(_imu) { \
|
||||||
|
RATES_COPY(_imu.gyro_prev, _imu.gyro); \
|
||||||
|
_imu.gyro.p = ((_imu.gyro_unscaled.p - _imu.gyro_neutral.p) * IMU_GYRO_P_SENS_NUM) / IMU_GYRO_P_SENS_DEN; \
|
||||||
|
_imu.gyro.q = ((_imu.gyro_unscaled.q - _imu.gyro_neutral.q) * IMU_GYRO_Q_SENS_NUM) / IMU_GYRO_Q_SENS_DEN; \
|
||||||
|
_imu.gyro.r = ((_imu.gyro_unscaled.r - _imu.gyro_neutral.r) * IMU_GYRO_R_SENS_NUM) / IMU_GYRO_R_SENS_DEN; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ImuScaleAccel(_imu) { \
|
||||||
|
VECT3_COPY(_imu.accel_prev, _imu.accel); \
|
||||||
|
_imu.accel.x = ((_imu.accel_unscaled.x - _imu.accel_neutral.x) * IMU_ACCEL_X_SENS_NUM) / IMU_ACCEL_X_SENS_DEN; \
|
||||||
|
_imu.accel.y = ((_imu.accel_unscaled.y - _imu.accel_neutral.y) * IMU_ACCEL_Y_SENS_NUM) / IMU_ACCEL_Y_SENS_DEN; \
|
||||||
|
_imu.accel.z = ((_imu.accel_unscaled.z - _imu.accel_neutral.z) * IMU_ACCEL_Z_SENS_NUM) / IMU_ACCEL_Z_SENS_DEN; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ImuScaleMag(_imu) { \
|
||||||
|
_imu.mag.x = ((_imu.mag_unscaled.x - _imu.mag_neutral.x) * IMU_MAG_X_SENS_NUM) / IMU_MAG_X_SENS_DEN; \
|
||||||
|
_imu.mag.y = ((_imu.mag_unscaled.y - _imu.mag_neutral.y) * IMU_MAG_Y_SENS_NUM) / IMU_MAG_Y_SENS_DEN; \
|
||||||
|
_imu.mag.z = ((_imu.mag_unscaled.z - _imu.mag_neutral.z) * IMU_MAG_Z_SENS_NUM) / IMU_MAG_Z_SENS_DEN; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* IMU_NPS_H */
|
||||||
Reference in New Issue
Block a user