Skip to content

Commit

Permalink
use imu analog_gyro subsystem in microjet example and print errors if…
Browse files Browse the repository at this point in the history
… old gyro subsystems are used
  • Loading branch information
flixr committed Oct 31, 2011
1 parent 64c5aa0 commit 620e3b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
16 changes: 12 additions & 4 deletions conf/airframes/microjet_example.xml
Expand Up @@ -67,13 +67,19 @@
<define name="CORRECTION_RIGHT" value="1."/>
</section>

<section name="GYRO" prefix="GYRO_">
<!--section name="GYRO" prefix="GYRO_">
<define name="ADC_ROLL_NEUTRAL" value="500"/>
<define name="DYNAMIC_RANGE" value="300" unit="deg/s"/>
<define name="ADXRS300_RESISTOR_BRIDGE" value="(3.3/(3.3+1.8))"/>
<define name="ADXRS300_SENSITIVITY" value="5" unit="mV/(deg/s)"/>
<define name="ROLL_SCALE" value="3.3*1000./1024./(GYRO_ADXRS300_SENSITIVITY*GYRO_ADXRS300_RESISTOR_BRIDGE)" unit="deg/s/adc_unit"/>
<define name="ROLL_DIRECTION" value="1."/>
</section-->

<section name="IMU" prefix="IMU_">
<define name="GYRO_P_SIGN" value="1"/>
<define name="GYRO_P_NEUTRAL" value="32362"/>
<define name="GYRO_P_SENS" value="1.1032765" integer="16"/>
</section>

<section name="BAT">
Expand Down Expand Up @@ -186,9 +192,11 @@

<subsystem name="control"/>
<!-- Sensors -->
<subsystem name="gyro" type="roll"/>
<subsystem name="ahrs" type="infrared"/>
<subsystem name="gps" type="ublox_utm"/>
<subsystem name="imu" type="analog_gyro">
<configure name="GYRO_P" value="ADC_3"/>
</subsystem>
<subsystem name="ahrs" type="infrared"/>
<subsystem name="gps" type="ublox_utm"/>
<subsystem name="navigation"/>

</firmware>
Expand Down
20 changes: 7 additions & 13 deletions conf/autopilot/subsystems/fixedwing/gyro_pitch.makefile
@@ -1,14 +1,8 @@
# Hey Emacs, this is a -*- makefile -*-

# additional pitch stabilization with gyro
#
# this assumes you are already using a roll gyro
#
# default values for tiny and twog are:
# ADC_GYRO_PITCH = ADC_4
#
# to change just redefine these before including this file
#

ap.CFLAGS += -DADC_CHANNEL_GYRO_PITCH=$(ADC_GYRO_PITCH) -DUSE_$(ADC_GYRO_PITCH)
$(info Error: Please replace <subsystem name="gyro" type="pitch"/> with)
$(info <subsystem name="imu" type="analog_gyro">)
$(info <configure name="GYRO_P" value="ADC_3"/>)
$(info <configure name="GYRO_Q" value="ADC_4"/>)
$(info </subsystem>)
$(info in your airframe file.)

$(error The gyro_pitch subsystem has been removed)
22 changes: 6 additions & 16 deletions conf/autopilot/subsystems/fixedwing/gyro_roll.makefile
@@ -1,17 +1,7 @@
# Hey Emacs, this is a -*- makefile -*-
$(info Error: Please replace <subsystem name="gyro" type="roll"/> with)
$(info <subsystem name="imu" type="analog_gyro">)
$(info <configure name="GYRO_P" value="ADC_3"/>)
$(info </subsystem>)
$(info in your airframe file.)

# roll stabilization with gyro

#
# default values for tiny and twog are:
# ADC_GYRO_ROLL = ADC_3
# ADC_GYRO_NB_SAMPLES = 16
#
# to change just redefine these before including this file
#

ap.CFLAGS += -DADC_CHANNEL_GYRO_ROLL=$(ADC_GYRO_ROLL) -DUSE_$(ADC_GYRO_ROLL)
ap.CFLAGS += -DADC_CHANNEL_GYRO_NB_SAMPLES=$(ADC_GYRO_NB_SAMPLES)

ap.CFLAGS += -DUSE_GYRO -DADXRS150
ap.srcs += $(SRC_FIXEDWING)/gyro.c
$(error The gyro_pitch subsystem has been removed)

0 comments on commit 620e3b1

Please sign in to comment.